iPod, iPhone, and iPad support via iRule

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

iPod, iPhone, and iPad support via iRule

Post by Osler »

I downloaded a program from iTunes a few days ago onto my iPad so that I could play with it. The program is called iRule and can be used as a standalone universal remote via its ability to natively find and connect to Global Cache devices. What interested me most was its ability to also send control commands via both TCP and HTTP. Through trial and error today as well as some input from Scott, I was able to have one-way communication with HouseBot via an External Control device, allowing my iPad to change property values within HouseBot. There is currently a version of iRule in beta (2.0) that is supposed to allow two-way communication.

If you want to give this a try, download iRule from the app store onto your iPod, iPhone, or iPad. It is free to download. Once you have done that, go to http://builder.iruleathome.com and log in using your google sign on (14 day trial). The user interface is designed online using an editor similar to what is found in HouseBot. Once you have done this, you can enter your credentials into iRule on your apple device and it will download what we would call a "Theme" to your device.

To enable control of HouseBot, you will need to create an External Control device with an appropriate port number and set "ASCII Protocol" to Yes. Once this is done, you can send commands to HouseBot from within iRule. To do this, you will need to create a device in the iRule theme editor online. Select "Devices" at the right and then select "Actions" -> "Create Item". My first device was a HouseBot Task Device. To create this, highlight the newly created device and give it a name at the bottom left panel and set "attach to" to network. Now expand your new device in the right pane and right click "Network Codes" and select "Add Device Code". Give your new device code a name in the bottom left pane and set the data to /C ET /T <name of task to execute> \x0D \x0A. You must have the \x0D \x0A at the end of each command sent to the External Control device (new line) otherwise HouseBot will ignore what is being sent. Property value changes would be similar, but would have data of /C SPV /D <device name> /P <property to change> /V <new value> \x0D \x0A.

Once this is done, you will need to create a network gateway in iRule on you apple device with the ip address of your HouseBot server and the port number for your External Control device. After you have done this, assign the HouseBot device you created in the iRule theme editor to this gateway.

iRule is pretty cool and allows you to use gestures to send commands and will also allow you to use the swiping motion to change between panels in your theme. The lack of 2-way communication is somewhat limiting but not a total killer. Another cool feature is that you can embed webpages into your iRule remote. It can also send commands to the ISY-99i to allow for direct control of Insteon gear.

Anyhow, I was thrilled with the results of todays experimentation and thought I would share with the group.

I also must say that even though Scott hasn't changed HouseBot in quite a while, the "basics" that he has included make it an extremely versatile piece of automation software. Kudos to Scott!!!

Osler
roussell
Advanced Member
Posts: 268
Joined: Wed Dec 15, 2004 9:07 am
Location: Pelham, AL

Re: iPod, iPhone, and iPad support via iRule

Post by roussell »

Good find Osler - have you seen Command Fusion? http://www.commandfusion.com/

Similar app, but more advanced (and more expensive) but you can get a free single-use dev license.
Terry
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: iPod, iPhone, and iPad support via iRule

Post by Osler »

Roussell:

Yep! Command Fusion is very nice but I didn't want to invest the time it would take to get it going. Digital joins, serial joins, etc. It's enough to make my head spin. I had iRule up and running in very little time. Plus I am on a "decentralize" kick and am starting to offload some things from the server. IRule could still control all of my av stuff even if the server went down since it can directly connect to the global cache devices.

Osler
PServais
Member
Posts: 29
Joined: Tue Feb 03, 2009 6:13 am
Location: Maastricht, Netherlands

Re: iPod, iPhone, and iPad support via iRule

Post by PServais »

Roussell,

do you use Commandfusion with Housebot?
I have tried to setup a page in CF to communicate with Housebot but nothing happens.
I have used the external control device in ascii mode.
Am i going the right direction or do I need to do something else?

Greetings

Patrick
roussell
Advanced Member
Posts: 268
Joined: Wed Dec 15, 2004 9:07 am
Location: Pelham, AL

Re: iPod, iPhone, and iPad support via iRule

Post by roussell »

No, don't use it. Just noticed the product and somewhat follow their forums.
Terry
CouchPotatoe
Senior Member
Posts: 103
Joined: Sun Jul 31, 2005 2:43 pm
Location: Yorkshire UK

Re: iPod, iPhone, and iPad support via iRule

Post by CouchPotatoe »

I too have played with iRule but until it has two way communication it is fairly limited. Interestingly this was a feature promised from launch over a year ago and the several updates that have happened have always postphoned the feature. I know it's a difficult issue and that v2 (in beta) is tackling it but until that appears I'm holding off. I do hope it supports things like images for cover art etc but I get the impression it has limited developer resource. It needs lists and sliders too otherwise it will still be an IR remote replacement with key state feedback.

I use Command Fusion's iViewer but I go via xAP which provides access to all my HA devices, this means I then can get into HouseBot via Edwards xAP plugin. Their join paradigm of analog, serial and binary exactly matches the xAP BSC (Basic Status and Control schema) operation , and nicely also the way Crestron and AMX work. iViewer is licensed per client , and fairly expensive - but good.

Patrick, I expect your issue will be to do with the constant poll / heartbeat that the iViewer clients send to the server - in this case HouseBot - and require acknowledging , do you see an 'experiencing data loss' message or just a connection failure ? Also their end of message delimiter is a <03> character which is unusual.

Kevin
FletcherFregoe
Member
Posts: 2
Joined: Sat Mar 12, 2011 2:33 am

Re: iPod, iPhone, and iPad support via iRule

Post by FletcherFregoe »

PServais wrote:Roussell,

do you use Commandfusion with Housebot?
I have tried to setup a page in CF to communicate with Housebot but nothing happens.
I have used the external control device in ascii mode.
Am i going the right direction or do I need to do something else?

Greetings

Patrick
I have tried to setup a page in CF to communicate with Housebot but nothing happens.
PServais
Member
Posts: 29
Joined: Tue Feb 03, 2009 6:13 am
Location: Maastricht, Netherlands

Re: iPod, iPhone, and iPad support via iRule

Post by PServais »

Hi Kevin,

I have managed to get iViewer to talk to Housebot.
It was a simple solution (after a loooooooong struggle to find it), just had to end each send message with a "\x0A"
Setting up iViewer is a head spinning task (analog join, serial join, pfffffff).
Today I read about the xap protocol, is it recommended to use this instead of directly communicating to Housebot?
The only devices I use at this time are KlikAanKlikUit light switches controlled by a RfxCom transmitter.
I have started to read all the info on xAP available on the net, but it is a bit much to understand.
Is it as simple as sending a "xAP command" from iViewer, or does it need some more programming?
I already found the xAP plugin from Edward on his site.
Could you maybe give me some advice/tips please?

Thanks,

Patrick
CouchPotatoe
Senior Member
Posts: 103
Joined: Sun Jul 31, 2005 2:43 pm
Location: Yorkshire UK

Re: iPod, iPhone, and iPad support via iRule

Post by CouchPotatoe »

Hi Patrick,

xAP is just one way of getting data in and out of HouseBot - and most other HA applications - in realtime. It's purpose was to try and create a very simple message construct - human readable and easily coded - that could be expanded in capabilities should you wish to cater for more complex devices. I use it as a common message format between all my applications and devices which means they can all talk to each other. It's a kind of glue that holds everything together. As you can choose whatever language you want to write xAP conduits, you're not constrained to the plugin SDK's flavour.

For me xAP was one of those Eureka moments that provided a methodology to achieve a fully integrated and expandable system as it provided the mechanism for interoperability. Any and all xAP devices can interact with each other as they use broadcast communication. Converting devices to talk xAP is much easier than writing a separate plugin for each device into HouseBot and other controllers / applications and the devices do not become attached soley to HouseBot in the way plugins typically monopolise a device. Hence every device is standalone and multiple controllers can control or eavesdrop on the same device. eg a SqueezeServer (music) screen can display a popup caller ID message or the outside temperature.

Should you use it ? Well I'm not advocating it as the solution to everyone's needs and you will need a bit of programming skill and patience to get it all working as you want. There is a bit of a learning curve to get over. xAP hasn't taken off as much as I'd hoped as it is a 'free' hobbyist protocol rather than commercially marketed product. It is however implemented in most leading HA software and even used internally in some commercial software as the event notifier.

For a specific need between one device and one controlling application you are probably better coding a HB plugin or using the external control device if that's workable. Every intermediate 'step' that you can remove in communications improves reliability and creates tighter coupling. If you have ambitions that might require a more dispersed HA control model , maybe with two or more controllers (HouseBot being one) then xAP starts to show it's strengths. xAP can also be implemented in small embedded devices - in fact I use one for my iViewer clients which attach to a small box that converts the iViewer protocol to xAP on Ethernet. It's not the tidiest of solutions as there's still a lot of mapping to undertake between xAP endpoints and iViewer joins.

In my HA system I have taken an approach of trying to select best of breed solutions for my lighting, security, heating, music, video, telephony etc - things that work standalone without depending on other aspects of the home automation - and most specifically no PC dependence. I then interlink them using xAP to provide integration and basic automation control using embedded controllers which provide near 100% uptime. Most of my time scheduling and logic interaction is done this way. Lastly I have PC's (eg HouseBot) used for the more complex data (weather, news, email, TV listings etc) and providing the whizzo HA features that aren't necessary but are fun. Should these fail - as PC's do - then all your basic functionality still works which keeps the family onside. Creating HA alienation within your family is just too easy to do when things don't work and you're away.

I use Flash based touchscreens for my control and that left me with a gap when I bought my iPhone and iPad - hence looking at iViewer and iRule. I should explore html5 really. I have some experience with AMX and Crestron and hence iViewer is more familiar to me and is way more capable than iRule currently. Digital, Analog and Serial joins are a very common way of representing most data that is useful for control and can extend to selecting audio, video and graphic information by name (via a serial or text join).

Many devices and software applications have xAP conduits and so can interoperate - in fact that's one of the strengths of xAP in that you can relatively easily swap from one system or application to another, or use both. There is a xAP conduit for your RFXCom for example although the inbuilt HB one will be preferred.

From within iViewer I currently don't implement xAP natively - I go via an Ethernet embedded controller. This was really because the early iViewer releases did not support broadcast UDP which is required for xAP. The next release of iViewer has new features that might well make direct xAP support achievable. I will take another look at this at some time in the future.

Yes you can just send a xAP 'command' message via UDP targeted at the device you wish to control - it will instantly respond with an 'event' to tell you it has reacted which you can use to update the displayed status. It is really fast as it is implemented over Ethernet. So you could theoretically just create a xAP endpoint in HouseBot and then command it to change state from iViewer . The HB endpoint could be mapped to any HB property. If it changes state in HB it will update iViewer. What this solution probably won't be able to do is 'synch' at startup as iViewer is essentially dumb and just reacts to status messages. Maybe at startup (iViewer connect) a HB script could automatically run that updates all the visible button states in iViewer ....

K

PS That 0A sounds like it might be a nuance of the HB external control device I guess - as iViewer uses 03
FletcherFregoe
Member
Posts: 2
Joined: Sat Mar 12, 2011 2:33 am

Re: iPod, iPhone, and iPad support via iRule

Post by FletcherFregoe »

PServais wrote:Roussell,
do you use Commandfusion with Housebot?
I have tried to setup a page in CF to communicate with Housebot but nothing happens.
I have used the external control device in ascii mode.
Am i going the right direction or do I need to do something else?
I have managed to get iViewer to talk to Housebot.
Denae Floch
Member
Posts: 1
Joined: Sun Sep 18, 2011 10:43 pm

Re: iPod, iPhone, and iPad support via iRule

Post by Denae Floch »

HouseBot doesn't have a native iPhone/touch/pad client so there isn't a direct comparison. You can however follow the guidelines I posted here to view HouseBot through a Remote Desktop Session on your iPhone/Touch and it should work equally well on an iPad. I had toyed with writing a SWRemote for the iDevices but to be honest, the solution above works so well that I haven't thought about it anymore.
andymarcus1968
Member
Posts: 1
Joined: Mon Jan 02, 2012 1:22 pm

Re: iPod, iPhone, and iPad support via iRule

Post by andymarcus1968 »

PServais wrote:Roussell,

do you use Commandfusion with Housebot?
I have tried to setup a page in CF to communicate with Housebot but nothing happens.
I have used the external control device in ascii mode.
Am i going the right direction or do I need to do something else?

Greetings

Patrick
I have been using the external control device in ascii mode and have had no trouble setting up a page in CF to communicate with Housebot. I suggest you try again because there are no issues here for me. It was having problems for me because I had installed a app on my phone, but after I redownloaded both, there were no problems.
-Andy
Last edited by andymarcus1968 on Fri May 08, 2015 2:40 pm, edited 3 times in total.
art
Member
Posts: 43
Joined: Fri Apr 15, 2005 8:01 pm

Re: iPod, iPhone, and iPad support via iRule

Post by art »

Has anyone looked at Openremote? http://www.openremote.org
Post Reply