Housebot's ability to create native "remote control" applications sets it apart from other home automation solutions. However, "native" implies a Windows-based operating system.
There are many low-cost, Internet Appliances with touch-sensitive screens (3Com Audrey, Nokia 770, etc) that would make excellent remote-controls but do not use a Microsoft operating system (derivations of Linux). The same is true for Internet-enabled cellphones. However, they all have web browsers that support JavaScript.
I propose a new feature that generates web pages using the information found in Themes. In effect, a Web Server Application would mimic the functionality of SWRemote. It would read Theme data and create web pages containing nothing more sophisticated than JavaScript (i.e. no Java, no Flash, nothing that needs plug-ins).
Most of the functionality found in a Theme has a comparable analogue in the web world (OK, not so sure about object transparency!). With some guidance from the Theme Editor (i.e. "this feature is not supported for web pages") one could make Themes that look and operate the same way when viewed with a PDA, Internet Appliance, or cell phone.
Implement "SWRemote" as a Web Server Application
I've never documented it, because is really supposed to be just an internal file for the SWRemote.
However, with a little cyphering you can probably deduce the meanings of the properties. If you look at the property window for any particular control, each setting in the property dialog for that control will typically have an attribute in the XML for the setting. The attribute names are short to keep the file size down, but they kinda resemble what it is.
You can use the External Control plugin (like the ActiveX control) to make the requests, but you would need to periodically refresh to get the current status of things (if the panel had any status type controls).
Also might be tricky getting the images and dealing with the multiple state images in an image file. Another challenge would be that the XML defines devices, properties, tasks, etc. by their ID. Whereas the external control wants to work with the description.
Sounds like fun though
However, with a little cyphering you can probably deduce the meanings of the properties. If you look at the property window for any particular control, each setting in the property dialog for that control will typically have an attribute in the XML for the setting. The attribute names are short to keep the file size down, but they kinda resemble what it is.
You can use the External Control plugin (like the ActiveX control) to make the requests, but you would need to periodically refresh to get the current status of things (if the panel had any status type controls).
Also might be tricky getting the images and dealing with the multiple state images in an image file. Another challenge would be that the XML defines devices, properties, tasks, etc. by their ID. Whereas the external control wants to work with the description.
Sounds like fun though
Scott
In lieu of the External Control plugin, would it not be possible to query HBdata.mdb directly? I noticed "P_ID=36" simply refers to record ID=36 in the Properties table ("Name=Power State").
I realize this technique may break if the schema changes in future versions but it's an expedient solution. The only problem I see is if Housebot opens the MDB in exclusive mode and locks out all other applications (I haven't tested this yet).
I don't know how SWRemote monitors properties (i.e. state changes) but it must be either:
1. SWRemote polls HouseBot
2. HouseBot broadcasts to SWRemote
If it is option #1, then the Web App will need to poll the MDB at least once every second (to properly update a System Time object). If option #2, then I'm out of luck unless you reveal the port address and protocol you're using to announce state changes.
*** OR ***
I can use the External Control to read/write a property, as Scott intended. :-)
However, I'd need to access the database directly to translate a "P_ID" into the property's name so that I can feed that to the External Control.
I suspect the External Control ensures all property changes are announced to Housebot. I noticed that if I change a property value directly (using Access), Housebot has no clue the property has changed (well, at least Housebot UI shows no evidence that the property was modified). I'm assuming it doesn't poll its own database but relies on "agents", like the External Control, to announce any modifications.
Flying on a wing and a prayer here ... whatever guidance you can offer would be appreciated!
I realize this technique may break if the schema changes in future versions but it's an expedient solution. The only problem I see is if Housebot opens the MDB in exclusive mode and locks out all other applications (I haven't tested this yet).
I don't know how SWRemote monitors properties (i.e. state changes) but it must be either:
1. SWRemote polls HouseBot
2. HouseBot broadcasts to SWRemote
If it is option #1, then the Web App will need to poll the MDB at least once every second (to properly update a System Time object). If option #2, then I'm out of luck unless you reveal the port address and protocol you're using to announce state changes.
*** OR ***
I can use the External Control to read/write a property, as Scott intended. :-)
However, I'd need to access the database directly to translate a "P_ID" into the property's name so that I can feed that to the External Control.
I suspect the External Control ensures all property changes are announced to Housebot. I noticed that if I change a property value directly (using Access), Housebot has no clue the property has changed (well, at least Housebot UI shows no evidence that the property was modified). I'm assuming it doesn't poll its own database but relies on "agents", like the External Control, to announce any modifications.
Flying on a wing and a prayer here ... whatever guidance you can offer would be appreciated!
Sure. You can always get anything you need from the database, as long as the HTTP server is on the HB machine. You also need to be a bit careful accessing the database concurrently with HB. Access/Jet doesn't handle concurrent access very well sometimes. You may be OK if you are just reading though.HB Guy wrote:In lieu of the External Control plugin, would it not be possible to query HBdata.mdb directly?
The server broadcasts changes to the remotes over the proprietary socket. You would need to just poll for status.I don't know how SWRemote monitors properties (i.e. state changes) but it must be either:
1. SWRemote polls HouseBot
2. HouseBot broadcasts to SWRemote
If you really wanted to get into it, you could create your own plugin (and not use the external control plugin) that communicates with the HTTP server or even directly with the client. That plugin can setup notifications with the HB server so it is informed whenever a Property Value changes. It could then send the notification to anyone who wants to know.
That's probably what I would suggest. Just open the DB when starting and create a table that maps the Devices, Property, Tasks, etc. descriptions to their IDs.I can use the External Control to read/write a property, as Scott intended. :-)
However, I'd need to access the database directly to translate a "P_ID" into the property's name so that I can feed that to the External Control.
Don't update stuff in the database. Just use it for read-only. If you update something, HB won't recognize the update AND it may even overwrite your change. The External Control device will manage it safely.I suspect the External Control ensures all property changes are announced to Housebot. I noticed that if I change a property value directly (using Access), Housebot has no clue the property has changed (well, at least Housebot UI shows no evidence that the property was modified). I'm assuming it doesn't poll its own database but relies on "agents", like the External Control, to announce any modifications.
Scott
Thanks Scott!
My initial strategy will be based on the following:
1. Read HBdata.mdb for the sole purpose of translating Theme codes (i.e. "P_ID") into Device, Property, Task, etc.
2. Use the External Control Device for all read/write operations.
I can hardly wait to see a Theme rendered as a web page!
My initial strategy will be based on the following:
1. Read HBdata.mdb for the sole purpose of translating Theme codes (i.e. "P_ID") into Device, Property, Task, etc.
2. Use the External Control Device for all read/write operations.
I can hardly wait to see a Theme rendered as a web page!