# wanted: basic menu that sends http 'commands'



## MichaelK

i dont know how to code. 
last time I did anything was probably on an atari 400 with BASIC.

so i can't really make anything myself.

my newest gadget is a vera. Basically it's an asus router that a company called micasaverde puts their software on and you can use it as a z-wave home automation controller. Pretty neat little lightweight gadget.

you can control it anywhere from a webpage. And there's a couple 3rd party native apps to control it from android or apple phones.

So I was thinking- would be neat to have a tivo app so i can send commands from the tv. basically I can sent HTTP- "commands" to get it to do things. 
-if it matters it would be something like 
http://ipaddress:49451/data_request...witchPower1&action=SetTarget&newTargetValue=1 
- and it would return some xml that looks like this:


> <?xml version="1.0"?>
> <u:SetTargetResponse xmlns:u="urn:schemas-upnp-org:service:SwitchPower:1">
> <JobID>7354</JobID>
> </u:SetTargetResponse>


 I saw this thread years ago:
http://www.tivocommunity.com/tivo-vb/showthread.php?t=225075&highlight=home+automation
about an app that creates basica menus and then sends x10 commands with a command line app instead of http. No one seems to have a copy of that- I figured maybe i could look at that and try to edit it to make the commands http instead of command line. But since I can't find it anywhere- no such luck.

then I stumbled on david blackledge's calendar app from here http://david.blackledge.com/tivo/ (thanks david!)- it apparently will give me a list of 'links' on the tivo and then try to open the webpages and display the results (I think..). So I figured that was as good a start as any and i could try to fiddle with that. So I downloaded it and edited the launcher.txt file with my link names and addesses and try to run it but i get an error "class not found: turn. check the classpath and access permissions. failed to initiate any HME apps." *UPDATE]* _- Never mind- that- redownloaded and tried with default launcher.txt and got it to run- but see that it doesn't give me a menu like i need_[/B]

so that didn't get me anywhere.

So anyone have a suggestion for a really simple hme app that just gives me a list of links that i can click on?

I think galleon had an ability to do that- but now i have pytivo running on my one always on computer and since i'm not that tech savy I'm weary of trying to install that with pytivo at the same time. *UPDATE]* _- looked at galleon and looks like it too just fetches pages without giving my an option first._[/B]

any thoughts, help, suggestions much appreciated.

thanks!
mike


----------



## davidblackledge

FYI, it'd be pretty trivial to throw together an app that builds a list of labeled buttons from either launcher args or a properties file that make HTTP requests and ignore the results.
If that's all you really need, I can throw it together when I get a chance in between my latest efforts getting a nice Google Maps app working (it works nicely right now, but I want it to support HD and other niceties like hooking up one of my keyboards to enter addresses).
If it needs to be fancier than that, post what else it needs, but it might take a while unless somebody else tackles it.


----------



## MichaelK

davidblackledge said:


> FYI, it'd be pretty trivial to throw together an app that builds a list of labeled buttons from either launcher args or a properties file that make HTTP requests and ignore the results.
> If that's all you really need, I can throw it together when I get a chance in between my latest efforts getting a nice Google Maps app working (it works nicely right now, but I want it to support HD and other niceties like hooking up one of my keyboards to enter addresses).
> If it needs to be fancier than that, post what else it needs, but it might take a while unless somebody else tackles it.


you rock!

since i'm clueless myself- obviously whenever you got to it would be better than what i could do- thanks so much.

I would love to be able to just edit a properties file with the button names and the link to request. A dream would be that I could create menus 2-3 levels deep- so I could make a top level with the room name and then the next level would be the devices or commands in the room.

like:
-living room
-- light on
-- light off
-- fan on
-- fan off.
-front porch
-- light on
-- light off

(Or if you got crazy 3 levels)
-living room
--light
---on
---off
--fan
---on
---off
-front porch
--light
---on
---off

thanks again-


----------



## davidblackledge

Ok, it's available for download on my website... very quick and dirty, but I think it does the trick.
urlmenu.properties has to be in your "home" directory per java's "user.home" property... e.g. in windows that might be 
c:\documents and settings\Owner\urlmenu.properties
labels have to be escaped per properties file rules (e.g. backslashes in front of spaces and colons)
Labels will be sorted alphabetically, so it's up to you to name them so your list looks nice.
"select" or "right" to activate (and "ding"; or "bonk" if there was an exception)
"left" to quit

http://david.blackledge.com/tivo

Let me know if there's a problem.

Really quick and dirty... no icon, name is "URLMenu", no options aside from the contents of the properties file.... you get the idea.


----------



## MichaelK

thanks a TON!

I'll play over the weekend to confirm it's fine.

PS- you have a 'donate' link somewhere so I can buy you a cup of coffee?


----------



## jwagner010

I was experimenting with this program. Great little program. I need to pass a user ID and password with the HTTP command line eg

My\ First\ Menu=http://*user : [email protected][/B]url.to.be.executed.com/with/other?information

It doesn't work for me. Is it possible to pass a user ID and password with this program?*


----------



## davidblackledge

Have you tried that url with the user: [email protected] in a browser? If it works in the browser, then maybe you just need to backslash-escape the colons and maybe the @-sign. (and I'm assuming the "spaces" in the url are not in the real entry, just there to prevent smilies like I had to do also)
My\ First\ Menu=http\://user\: password\@url.to.be.executed.com/with/other?information

If it doesn't work in a browser, then I'd have to add support for user/pass handled via authentication protocols... not that big a deal, but it's a matter of finding time to do it.
Let me know if that's required and I'll make a point of doing it. Otherwise I'll assume the backslashes fixed it.


----------



## jwagner010

Here is what I found. I installed firefox and tested the URL with user[email protected] and it worked.

I tried the backslash-escape suggested above for both colons and the @ plus also tried just for the second colon and the @. Still no luck.

Also tried percent encoding and still no luck.


----------



## davidblackledge

I just remembered that I hit the same problem when developing the HMO Client library... user/password on the URL worked to connect to the TiVos, but didn't work via the Java URL connection, so I had to put together all the code to make it connect through the protocols. This should be less code vs. the TiVos which use an untrusted authority and some other oddities.

No time right this moment, though...sorry.


----------



## jwagner010

David, I know the answer but I will ask nicely !!! Have you had anytime to look at this so I can pass a user ID and password with the HTTP command line? Pretty Please


----------

