Domotica For All
Because domotics don't need not be expensive or a source of problems



Domotics

May 27, 2013

Rovio control plugin from Z-Wave gateway Vera Lite

Más artículos de »
Escrito por: Laura Lopez
Tags: , , ,

Plugin conexión Rovio y Vera Lite (1092x400)

Let’s start by introducing briefly these two devices that we are going to connect.

Rovio

It’s a wireless video surveillance robot. It has been with us for 4 now years and it’s a robot of 3 Omniwheels (can be rotated 360º on itself) that can be moved independently throughout the home or office. It has a camera that is activated and raises when turned on. With it you can record videos and complements the functions of the traditional fixed cameras can do full scans of the stays.

As it has Wi-Fi technology, we can connect to the network so with different applications we can control it from multiple devices such as a smartphone, a tablet or the computer itself.

The battery lasts quite a long time, and if it detects “point of no return”, if it runs out of power, will return to its base and will disconnected. Also, it’s fully programmable so you can perform various actions depending on the needs of each user.

Vera Lite

It’s a device that acts as a gateway with network capacity to control all the Z-Wave automation at home. In this case it’s important to stress that doesn’t have Wi-Fi. The main advantage is that we can also connect from any device through the Internet and control all our home in a very simple way. In addition to offering this control, is an excellent tool to save energy where we can program various scenes that help us to be more efficient.

More information about Vera Lite.

 

Gateway Vera-Rovio Beta

For the installation and review of this device we will use the gateway VERA-Rovio Beta.

For this will be detailed the process of creation of a device in the commercial Gateway Vera 2, oriented to control and integrate the Rovio service robot in a home automation environment based on Z-wave device and describe the control functionality of Rovio which have been implemented in this gateway.

Creation of a device in Vera

It’s important to know that, when a device is created in Vera, his procedure is generic, therefore it’s valid for the creation and integration of any device in this, therefore not being exclusive to the plugin of Rovio.

For this, we must be provided to Vera, at least, three XML files. The first two correspond to the description of the device uPnP  and to the description of the services of such a device (remind that Vera uses an internal model uPnP for all their devices, are these really devices uPnP or of any other nature).The third file that Vera needs would be the implementation of the services, in language LUUP (Lua uPnP), which it must be equally encapsulated in an XML file, using a specific labeling for the code with which the engine Lua uPnP is able to work. The implementation corresponds to the code that, ultimately, will be executed by the engine LUUP to perform the actions defined and work with the state variables.There is an optional fourth file in JSON format, which develops the graphical interface of the device in Vera, that’s to say, the way in which the user can work graphically with the device, as well as to provide editable fields by the user that affect the value of the variables of the device. This file will be specific tags to create different elements and relate them to variables and actions of the devices, or even referencing code allows Javascript to create a control interface with more capabilities.

Once prepared the XML files, you access to the web interface of Vera (UI5), selecting the Apps menu. Once there, you enter in the submenu “Develop Apps”. First of all, the three commented files are uploaded to “Develop Apps” selecting “Luup Files”. From this submenu you will have a view of the different XML files of the devices previously installed on your system (devices descriptions, service and LUUP implementations, as well as JSON files for graphical user interfaces for the devices).

The files are in two specific folders in the files system of Vera:

  • /etc/cmh-lu: contains the XML and JSON of devices that natively come pre-installed with the distribution of Vera.
  • /etc/cmh-ludl: contains the XML and JSON that the user has installed on the system.

From this menu it is allowed to view and download the installed files. You can also observe the subsection “Upload Files” in the right frame of the interface, which allows us to load up to a maximum of 10 files simultaneously on the system.At this point indicates to Vera which files you want to load in the system. Then mark the checkbox in “Restart Luup after upload” (which will restart the LUUP engine after loading the files, which is a required step to ensure that they are taken into account by the system), and finally click on GO. The files are uploaded to the files system of Vera, after which the engine Luup restarts, showing in the top frame of the web interface a message that indicates that the server is busy due to the reset. After a few minutes, the files are uploaded in the platform, and the system is operational again.

The next step is the creation of new device. For this, click on “Create Device” (also within the section Develop apps, like “Luup Files” ).Vera presents a form where it is necessary to fill in a series of fields, customizing them depending on the device and been some of them optional.The requested parameters are the following:

  • Device Type: this parameter is needed enter the type of device UPnP that is creating, as it appears in the XML file of the description of the device. In the case of our device Rovio will introduce the following: Urn:schemas-upnp-org:device:Rovio:1
  • Internal ID: Is ignored this field, not being relevant to our integration.
  • Description: this is a descriptive name to identify the device in the graphical interface; for example: Rovio.
  • UPnP device filename: refers to the XML file that contains the description of the device, which must be previously uploaded to the platform, using the load step described in the previous section (Upload files)” By convention, the XML files of device description are named as follows D_<name> .xml. Therefore, in the case of our device Rovio, we called D_Rovio.xml.

You enter the name of the XML file without any type of route or path of the file system, since Vera knows the location of the files that the user has loaded, as commented previously.

  • UPnP implementation filename: refers to the XML file that contains the implementation of the services described in the description file services. In the same way, by convention, we’d call the file I_Rovio.xml (this file also was posted to Vera in the previous section).
  • IP Address: IP Address of the device that is being created, in case you have one. In our particular case, we would introduce the IP address you are using Rovio.
  • MAC Address: it’s not strictly necessary, but we introduce the MAC address of the network card of Rovio.
  • Room: The room where we want that Vera locates the device Rovio at logical level for organizational purposes.
  • Parent Device: Ignore this field, so Rovio would not be a son device of a second device which depends on.

The only requested files are the description of the device and the deployment file. This is because the other files are referenced directly in the XML description of the device, in our case D_Rovio.xml, it is not necessary to include them manually for  the creation time of the device. However, these files must have been previously uploaded as indicated in the previous step. As with the other XML files, the file description of the service has a nomenclature by convention: S_<name> .xml .For the integration of our device Rovio we use the name S_Rovio.xml .In the same way, the file is called JSON by convention D_<name> .json, still in the case that we study, therefore, D_Rovio.Json. These nomenclature conventions of the 4 files are only for reasons of readability and simplicity, being entirely optional, but highly recommended.

Once you have completed the fields, finally we proceed to click on Create Device, creating the device from the data provided. The engine LUUP restarts and after that, the device will be available in the graphical interface of Vera, along with the rest of the devices.

 

Description of the plugin Rovio for Vera

The developed gateway will allow to control Rovio from the Vera web interface .Through the JSON file, a graphical control interface has been created and it is presented on the web interface of Vera (in this case in its UI version5). We called  it Rovio UI and looks like this:

Interfaz web de Vera

In the top left area of the interface we have a control panel for the displacement of Rovio in the different directions of space: Forward, Backward, Left, Right (with their respective diagonals) as well as the rotation of the robot senses in daylight and counter clockwise. A speed field has been added, where you can change the speed of the Rovio moves when this is being handled manually. These values can be changed from 1 to 10, giving the desired value and by clicking on SET.

On the other hand, in the upper right area we have access to the Rovio camera, which takes periodic snapshots through its camera. For use in low light environments Rovio incorporates an additional button to switch on and off of the white light. We also incorporate a button to order Rovio to return to its charging base. Another feature which we have implemented is the height selection of the camera with 3 possible selections (positions high, medium and low), each of which has a corresponding button in the interface.

Finally, it has been implemented a compound movement function , through a field when we will introduce series of elements, separated by the “space” character ” Each element will consist of a letter that will indicate the direction of movement, followed by a number which expresses the time in milliseconds in duration movement. An example of valid composed movement would be the following:

Chain: F5000 R2000 B1600 L2000 (and click on GO!

In this case we would be ordering Rovio to move forward for 5 seconds, then it will move to the right for 2 seconds, then back for 1.6 seconds, and finally to the left for 2 seconds.

The possible directions implemented are the following:

F – Forward

B – Backwards

R – Right

L – Left

Z – Anticlockwise rotation.

X – Clockwise rotation.

Integration of the plugin of Rovio with the Z-Wave Vera devices

We have seen only the possibility of manually control the service robot Rovio via a control manual interface that we have created in Vera for that device, but the most interesting aspect of this deployment is the complete integration of the service robot in the Gateway Vera and thus be able to invoke the capabilities of the robot from Vera through scenes, events, and other schedules that depend on the information provided by other ambient devices controlled by Vera, as can be, for example, sensors of different nature that work on Protocol Z-wave. In this way we are integrating the service robot in our home automation environment.

For example, we can schedule a scene that runs an order of composed movement in Rovio as a result of the opening a door, or the activation of a motion sensor. This would allow us, for example, send Rovio to investigate an event that has occurred in the location of a particular sensor, take a snapshot and send it to a specified destination by mail.

Programacion de escenas

 

In the picture you can see that once we have Rovio as device in Vera, we can have their actions in the Advanced section of the programming of the scene and may schedule a complex chain of movements (using in this case the function Perform Complex Move, which is implemented in the plugin). This reasoning applies to any action of any device service. Then we could invoke these actions by setting a Trigger (for example, opening a door or a calendar)

Generation of the interface uPnP device for the device

Other interesting aspect of the creation to Vera device, is that Vera acts as universal UPnP Gateway and creates a uPnP interface for the Rovio device from the same moment of creation of this device in Vera.

In this way, from any external device that talk upnp, we can discover and invoke all Rovio capabilities that are implemented in the plugin, attacking directly to Vera by this interface uPnP.

Aplicación DeviceSpy

In the picture you can see from the DeviceSpy application we have discovered the UPnP Interface of our MIOS device. Inside we can find the uPnP actions both of the Z-Wave device, of the scenes defined in Vera and our Plugin for Rovio. In particular we have deployed the branch of Rovio movements and we select invoke the implemented function, which is designed to execute complex chain movements (Perform Complex Move), to which we would spend as a parameter the chain of moves that we needs to run.

Vera allows these actions are invoked by simples HTTP request, without having to use the UPnP stack

If you are interested to test these files, please send an e-mail to info@domoticadavinci.com and we would send it to you.

Authorship of the Plugin

The author of this interesting plugin is Sergio Reyes Cózar from the University of Sevilla



Sobre el autor

Laura Lopez
I'm Technical Surveying Engineer. When i finished my career, i decided to do a Master's degree in Digital Home and robotics, in which, I'm addicted to home automation .Thanks to the Master's degree, I'm doing practices in the company Domótica Davinci.




 
 

 
 

Showroom and Training Fall 2015

  From November 23rd, 2015 until December 19th, 2015 we decided to establish a temporary center for demonstration and training on Home Automation in  Madrid (Getafe) with the aim of covering the Christmas season. We want ...
by José Miguel Rubio Varas
0

 
 
mitchell-klein-zwave

Z-Wave Alliance may not have brand recognition, but it’s got security going for it

For anyone with a home security system, chances are good that it has Z-Wave technology in there, but that doesn’t mean anyone knows that. That’s a challenge the Z-Wave Alliance is constantly trying to address, and i...
by José Miguel Rubio Varas
0

 
 
popp-hub-1

Z-Wave Plus home automation hub runs Linux on Raspberry Pi

Z-Wave Europe and Popp & Co. have launched a “Popp Hub” home automation gateway that runs Linux on a Raspberry Pi, and supports Z-Wave and IP smart devices. Source: Z-Wave Plus home automation hub runs Linux on Raspberr...
by José Miguel Rubio Varas
0

 

 
650_1000_lberry 2

Lightberry: Ambilight for all

We went to IFA 2014 in Berlin. At Philips booth they knew that in a world full of flat amazing smart TVs, what makes Philips TVs different it is “ambilight” feature, so they demostrate it on every TV in the booth, e...
by José Miguel Rubio Varas
1

 
 
yetu box

“yetu” a Smart Home Platform presented at IFA 2014

We heard of “yetu” because, even though it is a german company, there are spanish developers involved in the project that contacted us because they needed Z-Wave equipment. We took advantage of our visit to IFA 2014...
by José Miguel Rubio Varas
0

 
 
Booth Fibaro CES 2014

New Fibaro devices at CES 2014

You know we have special interest in Z-Wave technology, that’s why we visit with a lot of interest Z-Wave Alliance booth in CES Las Vegas 2014. More than 20 companies from US, Europe and Asia were there to show and presen...
by Alfonso Eguino
0

 

 
Alberto Sagredo - Domotica Z-Wave Asterisk

Asterisk & Z-Wave demo in VoIP2Day 2013

Few weeks ago we shared the news that in VoIP2Day was going to be a demonstration of the potential of Z-Wave technology connected to Asterisk. Alberto Sagredo (@albersag) was commissioned to make the presentation and show every...
by Alfonso Eguino
0

 
 
Robot Aisoy1

Aisoy, a robot with Z-Wave technology

We present Aisoy, AISoy1 more specifically, which is a robot based on Raspberry Pi. First we should noted that this is a 100% Spanish project, developed in Elche. Not all robots have to come from Japan! This is a robot designed...
by Alfonso Eguino
0

 
 
Z-Wave Atlanta training

“Z-Wave Fundamentals and Basic Training” by Z-Wave Alliance in Atlanta

Last week I had the fortune to attend the official Z-Wave Alliance course organized in Atlanta (USA) for a few companies from countries all around the world specialized in home automation. The training lasted three days, from A...
by José Miguel Rubio Varas
0

 

 
Z-Wave home smartphone

What is Z-Wave? Watch this video

Some times a picture worths more than 1.000 words. So, does a video worth 1.000.000? We are not sure about it, but we know that this video explains perfect what Z-Wave home automation technology is. If you want to start to use ...
by Alfonso Eguino
0

 
 
Open door with Z-Wave access control

Home automation access control from anywhere in the world

This summer I have been enjoying a little vacation in the Mediterranean, more specifically in Italy. But I don’t write this post to make you jealous… but to share with all of you how I used the automation to contro...
by José Miguel Rubio Varas
0

 
 
Roowifi - iRobot Roomba

RooWiFi: Roomba wireless control device

Today we will talk about Roowifi device, a small wireless controller for Roomba. First, let’s talk about the cleaning robot. iRobot Roomba It is a vacuum-cleaning robot that is revolutionizing households worldwide. It is ...
by Laura Lopez
0

 




One Comment


  1. Pablo

    Very interesting. Have you done any research to see which z-wave device is more …let say..accurate?



Leave a Reply

Your email address will not be published. Required fields are marked *