OpenRemote

Requirements

OpenRemote consists of three main components:

  • OpenRemote Controller manages runtime integration between your devices, scheduling and autonomous intelligence on your behalf
  • OpenRemote Control Panels allow you to interact with your devices and control them in parallel with the logic deployed on the controller
  • OpenRemote Designer is a set of cloud-based tools that allow you to create configurations for both the controller (controller logic and automated schedules, sensor-based rules and scripts) and create user interface designs for control panels on iOS and Android devices or standard web browsers.

Howto Install OpenRemote

How To Install OpenRemote Controller on Ubuntu or an Raspberry Pi

1. Install java

$ sudo apt-get install icedtea-6-jre-cacao

2. Check Java installation

$ which java
/usr/bin/java
$ java -version
OpenJDK Runtime Environment (IcedTea6 x.x.x)
OpenJDK Zero VM (build XXX, mixed mode)

3. Set JAVA_HOME environment variable

$ export JAVA_HOME=/usr

4. Download Open Remote Controller

Download OpenRemote Controller 2.0.x

5. Run Controller

$ cd ~/Desktop/OpenRemote-Controller-2.0.0/bin

Make file openremote.sh executable, if not already.

$ sudo chmod +x openremote.sh

Run:

$ ./openremote.sh run

6. Check Installation

Open browser and log onto [[http://localhost:8080/controller]].

7. Start OR automatically at startup

Add the following lines to /etc/rc.local (easy way) Just before the exit 0

cd /home/DomotiGa/Desktop/OpenRemote-Controller-2.0.0/bin
./openremote.sh start
$ sudo nano /etc/rc.local

Or:

Put a script file in /etc/init.d For example see Automated start on linux server

Make executable

$ sudo chmod +x /etc/init.d/NameOfYourScript

The following command makes the script run at startup

$ sudo update-rc.d NameOfYourScript defaults

Commands

Let's start with the necessary steps to create devices, commands and sensors to turn On and Off devices configured in DomotiGa

HTTP

The HTTP protocol can be used to execute HTTP get commands to either retrieve information from an URL or if you have a device that can be controlled via HTTP you can use this protocol to talk to your device.

OpenRemote Online Designer

First let us create a device where we will put under all commands and sensor that are talking to DomotiGa.

Create new Device

In "Building Modeler" [[http://composer.openremote.org/preview/Modeler.jsp]], create new device (New>New Device)

For this device (DomotiGa) we are going to create two new commands. one for setting the device on and one for setting off again.

new_device

http://[DomotiGa-Sever-IP/domotiga/index.php?action=On&name=[DeviceName]

http://[DomotiGa-Sever-IP/domotiga/index.php?action=Off&name=[DeviceName]

With these two command you are able to create a GUI wherein there are two separated buttons to turn on/off a device. much better would be a switch that can turn on or off based on the status of the device. to get the status of a device we are going to use the XML feed that DomotiGa build for the service Pachube/Cosm. If you upload your device statistics, there will be a feed available for you wherein we can get the status of the device.

[[http://DomotiGa-Sever-IP/domotiga/?setview=pachube]] wil give you this output:

<eeml xmlns="http://www.eeml.org/xsd/005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eeml.org/xsd/005 http://www.eeml.org/xsd/005/005.xsd">
<environment>
<data id="1">
<tag>Power usage</tag>
<value>0.2</value>
<unit symbol="kWh" type="basicSI"/>
</data>
<data id="16">
<tag>status_bollen</tag>
<value>Off</value>
<unit symbol="" type="basicSI"/>
</data>
<data id="167">
<tag>th_woonkamer</tag>
<value>57</value>
<unit symbol="" type="basicSI"/>
</data>
</environment>
</eeml>

Getting out the data that we need can be done by using Xpath expressions: for example; if we want the status of device "16" we can do this.

[[//data[@id=16]/value]]

new_sensor

Template design

For a generic remote that going to grow with DomotiGa we need a plan / template. Let's use some paper!

first design

Related Resources

    Updated by: daferra, Updated almost 5 years ago
    Access count: 78736 since 2011-08-25

    Attached Files

    Screen_Shot_2012-10-26_at_4.22.46_PM.png (16.1 KB) daferra, 10/26/2012 04:27 PM

    first_design.jpg - first design (371 KB) daferra, 11/06/2012 02:19 PM

    new_device.png - new_device (19 KB) daferra, 11/06/2012 02:52 PM

    new_sensor.png - new_sensor (26.1 KB) daferra, 11/06/2012 03:44 PM

    Also available in: PDF HTML TXT