Hi, I'm new here and to HomeSeer. I hope this post isn't redundant. If it is, I apologize in advance.
I just wanted a quick and dirty way to do a few things from my Android devices on my way out of the house, on my way home, and when I’m in my house, and integrate some HS commands with Tasker for Android. The HS3 Touch Android app leaves a lot to be desired. It takes way too many steps to do things, the sounds are annoying, etc. etc. I started writing my own Android App, but quickly realized that the time investment wasn’t worth it, at least until Google releases its own development API.
I found several posts from people wondering how to control HS3 with HTTP Post commands (it won’t accept get by the way), but turned up a whole bunch of nothing. So, having a lot of networking and web development experience, it didn’t take more than a few minutes to come up with some code to do what I want. So, what I have now is a shortcut on my home screen that loads a quick and dirty web page to run events and control devices. I decided to actually place the HTML file on the devices’ flash memory instead of my Raspberry PI for the moment so the page loads faster. (I know I’ll get more control out of having the page on the Raspberry PI, but at that point I might as well not use HTTP for control.) I then loaded the page in Firefox, and added a shortcut to it on my home screen through Firefox.
Anyhow, all you have to do is use the web development tools in the desktop version of Firefox and inspect the controls on the HS web pages for whatever it is you want to do.
To run an event, just post Run_EventID to /Events. So, for example, if your inspection shows that the event ID you want to control is 1234, you would post Run_1234 to /Events. To turn on or off a device, there are three parameters you need to post to /deviceutility. First is ref. This is the id for the device to control. You have to find this by inspection. Second is action, this needs to be set to devicecontrol. Last is CAPIControl. Set this to 0 to turn a device on, 1 to turn a device off. Note that everything here is of course, case sensitive.
That’s all there is to it. If anyone wants some sample HTML source, let me know.
I just wanted a quick and dirty way to do a few things from my Android devices on my way out of the house, on my way home, and when I’m in my house, and integrate some HS commands with Tasker for Android. The HS3 Touch Android app leaves a lot to be desired. It takes way too many steps to do things, the sounds are annoying, etc. etc. I started writing my own Android App, but quickly realized that the time investment wasn’t worth it, at least until Google releases its own development API.
I found several posts from people wondering how to control HS3 with HTTP Post commands (it won’t accept get by the way), but turned up a whole bunch of nothing. So, having a lot of networking and web development experience, it didn’t take more than a few minutes to come up with some code to do what I want. So, what I have now is a shortcut on my home screen that loads a quick and dirty web page to run events and control devices. I decided to actually place the HTML file on the devices’ flash memory instead of my Raspberry PI for the moment so the page loads faster. (I know I’ll get more control out of having the page on the Raspberry PI, but at that point I might as well not use HTTP for control.) I then loaded the page in Firefox, and added a shortcut to it on my home screen through Firefox.
Anyhow, all you have to do is use the web development tools in the desktop version of Firefox and inspect the controls on the HS web pages for whatever it is you want to do.
To run an event, just post Run_EventID to /Events. So, for example, if your inspection shows that the event ID you want to control is 1234, you would post Run_1234 to /Events. To turn on or off a device, there are three parameters you need to post to /deviceutility. First is ref. This is the id for the device to control. You have to find this by inspection. Second is action, this needs to be set to devicecontrol. Last is CAPIControl. Set this to 0 to turn a device on, 1 to turn a device off. Note that everything here is of course, case sensitive.
That’s all there is to it. If anyone wants some sample HTML source, let me know.
Comment