ZWave

From LinuxMCE
Revision as of 21:00, 8 December 2008 by Hari (Talk | contribs) (Interfaces)

Jump to: navigation, search

Z-Wave™ is a wireless RF-based communications technology designed for residential and light commercial control and status reading applications such as meter reading, lighting and appliance control, HVAC, access control, intruder and fire detection.

Overview

The support from LinuxMCE system is represented by an executable ZWave (it's placed in /usr/pluto/bin) which is the device implementation and a DeviceTemplate (1754) which is used to create LinuxMCE Devices for ZWave.

The source code is available in LinuxMCE's SVN repository at src/ZWave.

Implementation

Open version

The new open Z-Wave driver will be included in the upcoming 0810 release.

A 32bit binary of the new Z-Wave driver for 0710 can be found here: http://vt100.at/files/ZWave-0.0.2-0710-32bit.bz2 Just swap with the existing /usr/pluto/bin/ZWave and quick reload the router.

New Fiire driver

Fire also provides a new Z-Wave driver, it is binary only: Fiire_ZWave_Patch

Old version

This is the version shipped with 0710. The source code for the old version is not available as it depends on proprietary files from Zensys.

ZWave implementation is based on a ZWaveJob-s manager (PlutoZWSerialAPI, a singleton class) which supports asynchronous or synchronous tasks management. We are using the asynchronous model right now because we want to send commands to many ZWave dimmable lighting switches at one moment. We are sending the switch On/Off commands as soon as possible then we are waitting for confirmation. This should make the lights switching almost in the same time and the customer gets a nice feedback. In the synchronous mode, ZWave jobs manager can watch only one job at one moment, that means the lights are switched On/Off successively and it can take some time until all the lights are changed.


The Z-Wave implementation uses two main classes to operate.

ZWave.h/.cpp define the ZWave class, which handles interactions with the DCERouter. PlutoZWSerialAPI.h/.cpp define the low-level Z-Wave implementation. This class handles communication with the Z-Wave adapter. The Zwave class receives (for example) light status change commands from the DCERouter and creates he appropriate 'jobs.' To do this, the ZWave class creates an object of type ZwaveJob. Then it inserts the newly-created job class in the PlutoZWSerialAPI class command queue by passing a pointer to the job class to PlutoZWSerialAPI's insertJob() function. The Zwave class then calls PlutoZWSerialAPI's start() function to command the PlutoZWSerialAPI class to begin executing the commands in its command queue.

PlutoZWSerialAPI is threaded to allow it to execute multiple Z-Wave commands in the command queue without having to wait for each command to be acknowledged by the receiving device before continuing. The current implementation is asynchronous. PlutoZWSerialAPI spawns as a thread its DoAsynch() function, which call's PlutoZWSerialAPI's listenAsynchronous() function. This function processes received replies and matches them with executed commands in PlutoZWSerialAPI's command queue.

Interfaces

Supported

How to install and use ZWave

These instructions are for HomePro ZWave USB interface (ZCU000/ZCU010). The same method might work for other (future?) supported ZWave controllers.

These instructions have been tested working under VMWare 1.0.1-29996 using FC4 (2.6.16.18) as host operating system.


Let's assume that you have LinuxMCE installed with IP: 10.0.2.128 (these instructions are also done by assuming that you have "hybrid" LinuxMCE installation).

Once you have successfully installed the ZWave USB controller and it is seen on LinuxMCE (media:zwave_homepro_interface.png), you can proceed by populating the ZWave network information to LinuxMCE.

  1. Add your ZWave devices to your master ZWave master remote controller (like ZTH200)
    • Once the devices are added to remote and verified they are working (you can control them with your remote controller), you need to copy the ZWave network information to LinuxMCE.
  2. Go to LinuxMCE admin page ("http://10.0.2.128/pluto-admin/"), then choose "Wizard -> Devices -> Interfaces -> [your ZWave controller] -> Advanced".
    1. On the device page select "Send command to device".
    2. Select command "Download Configuration" and choose "Send Message".
      • Leave the data and file fields as blank
  3. Now LinuxMCE is waiting for the ZWave information and you should send a copy of the ZWave network with your master remote controller to LinuxMCE.
    • If you are using HomePro remote controller this is done by selecting: "Setup -> Copy Remote Ctrl. -> Send Information -> Identical Copy". Once you have done that, the remote will show "Sending information..." and after successful sending it will return to clock screen (this shouldn't take more than couple of minutes).
    • You can monitor the process by watching the Zwave log file on LinuxMCE (usually "/var/log/pluto/*ZWave.log"). Unfortunately the admin page doesn't give much information of what is being done and is everything going smoothly. If the process is successfully, you should see the LinuxMCE communicating with the USB controller
    • Make sure the sending remote controller is near enough the USB receiver, otherwise nothing will happen.
  4. Go to device tree (Show devices tree) and you should see (Media:zwave_devices_tree.png) the newly added ZWave modules/devices on the tree under "CORE -> ZWave".

You should do quick reload (Wizard -> Restart -> Quick Reload Router) in order to use the newly added devices with LinuxMCE. Once you have done that you should be able to control (like switching on/off) the devices under the Light (Media:zwave_lights.png).



PIR (Binary Sensor) support

ACT_Homepro_Motion_Detector

Z-Wave API documentation

ZWave_API

Links

[1]