panStamps are now officially supported devices by OpenRemote, a powerful open source home automation software for iPhones, iPads and Android devices. OpenRemote's main strength is in our opinion the fact that anyone can create custom graphic layouts for their preferred mobile platforms and make them interoperate with a long list of home automation hardware. And all this for free, by simply using OpenRemote's online designer and uploading the generated files to a computer running OpenRemote Controller.
Before this release, panStamp was integrable with OpenRemote by means of the http engine included in lagarto-swap. An old tutorial explained this in fact. What makes the current release really interesting is that OpenRemote does not need polling values from lagarto anymore. New OpenRemote's protocol extension for lagarto is now able to receive events from lagarto without the need to be continuously querying our SWAP servers. Another advantage about the new extension is that users can create their custom GUI frontends faster from OpenRemote Designer.... but we will talk about this along the current tutorial.
Firstly, you need to download OpenRemote Controller 2.1.0 snapshot for lagarto.
Also download and install the latest version of lagarto as explained here. The current OpenRemote snapshot does not include the necessary binary ZeroMQ libraries (libzmq.so and libjzmq.so files on linux and some dll's on Windows). You have to locate these files on your computer and place them under OpenRemote/webapps/controller/WEB-INF/lib/native/.
Now it's time to run lagarto-max:
You can run OpenRemote after that:
And finally run lagarto-swap:
Now it's time co configure OpenRemote from the online Designer tool. Simply open the following URL from a web browser: http://composer.openremote.org/preview
and create the necessary commands, sensors and actuators. Let's start by creating a device called “Lagarto-SWAP” or whatever name you prefer. Once we have our device created we can then proceed with the creation of commands, sensors and actuators attached to our device.
Before creating a sensor object from OpenRemote Designer we need to define a command to link OpenRemote to the actual SWAP sensor. We can then create our sensor from Designer and attach it to the command previously defined.
1. Annotate the endpoint id appearing on the first column from lagarto-swap's Network page. This id uniquely represents each endpoint in lagarto-swap.
Figure 1 : Endpoint id's from lagarto-swap
In the above example our Temperature0 endpoint has the id "10.12.0"
2. Create a new command from OpenRemote Designer and select “panStamp lagarto” from the protocol field.
Figure 2 : Sensor command
3. Create a sensor object from OpenRemote Designer's device manager
Figure 3 :Sensor object
Enter a name for the sensor and attach it to the command defined in the precedent step. Set the "Type" field to "custom".
1. Actuators, like sensors, need a command which will be used by OpenRemote to link to the real parameter in lagarto-swap. The only difference is that actuators need the "New value" field to be filled from the command window.
2. Create sensor object and attach it to the command defined in step 1. Set the type of sensor to "switch".
Figure 5 : Binary sensor
3. Create switch object. We have to attach the switch to the sensor defined in the precedent step and set both ON/OFF commands to our single binary command.
Figure 6 : Switch object
OpenRemote users will appreciate how a single command can be used to read and write endpoints with our protocol extension.
Level actuators, dimmers, DAC's (digital to analog converters) or PWM (pulse width modulation) outputs can be controlled using sliders from Openremote. The configuration procedure is similar to the binary input:
1. Create a new command for your output:
Figure 7 : Command for level actuator
2. Create sensor object and attach it to the new command:
Figure 8 : Sensor defined to get/set values from the actuator
3. Create a new slider object and attach your new sensor and command to it:
Like switches, sliders need to be attached to a sensor, responsible to read values from the real endpoint, and a "setValue" command which will be used to send new values to lagarto-swap. Again, a single command (cmd_Level0) is used to read and write values.
Once arrived at this point you should see a list of objects similar to the following one:
Figure 10 : Device view from OpenRemote Designer
Now you can design your custom GUI for your Android/iPhone device. Open the Panel view from Designer and create a new panel. We are omitting the cosmetic aspects in this tutorial.
1. Create new screen.
2. Place a grid and define its number or rows and columns
3. Place a label for each analog input. In our example we should create the a label and attach it to the Temperature0 sensor.
4. Place a switch for every binary actuator. In our example we should select Relay0 from the SwitchCommand selector.
5. Place a slider for every level actuator, dimmer, ADC or PWM. We should then enter Level0 (Level0 slider object created from Designer's Device view) in the SliderCommand field for our current example.
6. Save your work.
Upload your Designer project to your OpenRemote controller by opening the following URL from a web browser: http://ip_addr_controller:8080/controller/. You will have to identify yourself and press the "Sync with Online Designer" button. Finally, open your graphic interface and select the OpenRemote Controller from the list.
And that's all. We are currently designing a nice interface for a 7-inch Android tablet for CeBIT. We will try to post some pictures when we get it ready. Thanks for your time.