Announcements‎ > ‎

OpenRemote controls panStamps via HTTP

posted Apr 25, 2012, 3:23 PM by Daniel Berenguer   [ updated Apr 25, 2012, 3:42 PM ]
OpenRemote is an open source application which implements touch screen control interfaces for iPhones, iPads and Android devices. It's basically a client-server solution where mobile devices act as clients and OpenRemote Controller is the server. Integration with automation networks and multimedia servers is done through a set of plugins and the availability of configurable protocol wrappers. HTTP, Telnet and TCP commands can be configured to control devices supporting any of these protocols.

A Lagarto-SWAP server, connected to a SWAP network of panStamps, can be controlled and queried via HTTP GET/POST commands so connectivity with OpenRemote is straightforward. In our example OpenRemote Controller and Lagarto-SWAP run on the same computer for simplicity.

Figure 1: Common server running OpenRemote and Lagarto-SWAP

Settings and GUI panels are configured from the on-line Designer tool and then uploaded to the controller through the synchronization embedded page.

Figure 2: OpenRemote Controller page used for synchronization with the on-line Designer tool

OpenRemote Designer is one of the key pieces of the solution. This tool lets us create our own graphical panels and program the interaction with physical devices.

Figure 3: OpenRemote designer -  Custom panel showing different temperatures and humidities being measured by panStamps

Figure 4: OpenRemote Designer - Custom panel controlling some lights attached to a panStamp running binouts

Graphical panels consist of images, labels, buttons, switches and sliders. Each GUI component is attached to virtual sensors and actuators which send HTTP commands to Lagarto-SWAP. Then, Lagarto-SWAP communicates with panStamps, as explained in the tutorials.

OpenRemote commands read and write values from/to physical devices. In our example we have to define a read command for each SWAP endpoint, input or output, and an additional write command for each output.

Figure 5: OpenRemote Designer - Custom command reading Garden.Temperature every 30 seconds

Lagarto-SWAP supports two formats of HTTP requests. The simple format allows accessing individual endpoints and getting plain text responses. This is the preferred format for OpenRemote since no regular expression or filter has to be defined. Thus, for reading Garden.Temperature we would use the followung HTTP query:

http://lagarto_swap_ip_address:port/values/Garden/Temperature/?

And writing to a wireless output:

http://lagarto_swap_ip_address:port/values/Garden/Light1/?value=ON

Once the command created, we can attach it to a virtual sensor or actuator.

Figure 6: OpenRemote sensor attached to read command

Figure 7: OpenRemote switch attached to write command

Figure 8: OpenRemote slider attached to write command

Using remotes is very simple. OpenRemote is freely available from Android and iPhone app stores. After installing the application on your phone you will only have to start it and select the controller previously auto-discovered. Panels are then transferred from the controller to the remotes, ready to be used.

 
 
Figure 9: OpenRemote panels working on an Android phone (remote)

The above example is quite modest; just a couple of panels showing and controlling values from some panStamps, but possibilities offered by OpenRemote seem endless.

Comments