Project Z-Wave (Home Automation)

  • Thread starter Thread starter Imy
  • Start date Start date

Imy

Imy

Soldato
Joined
21 Nov 2005
Posts
2,773
Location
Warwickshire, UK
After seeing the new Honeywell - evohome system (thread here), it piqued my interest in home automation once more.

The Honeywell system, as brilliant as it is, is still limited in many ways yet quite expensive at the same time. So I started (or rather re-started) looking at DIY home automation rather than a purely off-the-shelf system.

I've chosen to base my system on Z-Wave technology. It uses a mesh communication system so each device in the network can also act as a relay for messages, reducing issues concerning range. It's also a two-way communication system so devices can report their current status as well as receive commands. I also considered LightwaveRF which is a lot cheaper to implement but doesn't have these 2 important features. Another advantage of Z-Wave is that it's not limited to one manufacturer's products (there are over 250 companies making Z-Wave products) and all products (in theory) should be compatible with each other.


Project milestones

I've broken this down into 6 steps. Some are small but some are huge and could take a long time to complete.

Step 1 - Choose control centre hardware

Step 2 - Purchase sample devices (1 each of a few different types)

Step 3 - Program the system with advanced timer/event based triggers

Step 4 - Expand the system, install new lighting, switches, sensors and TRVs

Step 5 - Build a more functional and user-friendly GUI (if suitable one not available)

Step 6 - Purchase tablet device to wall-mount and create GUI for it.


I've started this thread to discuss Z-Wave technology and products and also to use it as a project log.
 
Last edited:
Useful Links

Information
How to guides

Purchases

Home Automation Control Centre (Z-Wave + 70+ protocols in 433MHz range) - £190.08
Home Automation Devices - £630.11
Lighting - £426.98
Awaiting purchase
 
Last edited:
So first of all I need to choose a control centre. There are a number of off-the-shelf ones available but they can be quite expensive, especially if you're after a premium offering.

As this is a DIY project, I'm leaning towards a solution involving the Raspberry Pi as it's cheap and doesn't use much power to run 24/7.

I still need to decide on a Z-Wave transceiver controller to attach to it though.
 
I'm going to build it up gradually (to spread cost over time) with the goal of eventually controlling the lighting (table lamps as well as ceiling) and radiators in each room. I may also do water leak/flood detection.

I will be making heavy use of sensors to run much of the automation; motion, temperature, ambient light and possibly GPS (via my phone) too.

To begin with I'm going to use my hallway for testing the concept and then as I expand, concentrate on areas where electricity/gas is currently wasted. As part of the energy efficient drive I'm also going to try to move over to LED lighting where it makes sense. Most of my light fixtures are currently halogen based so there's a lot of energy saving to be made there. Some rooms have no TRVs at all and at the same time are rarely used but nonetheless the heating comes on in them with the rest of the apartment so that's another lot of wasted energy.
 
Last edited:
Is this basically the same as the arduino system? I've looked into it myself installing cat5 wiring to lighting systems but honestly in the grand scheme of things our house isn't big enough to justify a system. We just get off our ass and turn the switch off :D

But I would like a switch by the bed as im always leaving the lights on downstairs and when its -10 you really don't feel like moving!

I have thought about the lightwave RF units just for that one use alone but again it doesn't justify the cost.

Anyway back to the OP

Looking forward to updates.
 
This is something I'm interested in too. I backed the almond+ router on kickstarter, that acts as a controller for both zig bee and z-wave. They have just shipped beta units with the final units due this quarter, might be worth a look at for any kind in the market for a router in a couple of months.
 
Is this basically the same as the arduino system? I've looked into it myself installing cat5 wiring to lighting systems but honestly in the grand scheme of things our house isn't big enough to justify a system. We just get off our ass and turn the switch off :D

But I would like a switch by the bed as im always leaving the lights on downstairs and when its -10 you really don't feel like moving!

I have thought about the lightwave RF units just for that one use alone but again it doesn't justify the cost.

Anyway back to the OP

Looking forward to updates.
If you're looking for a cheap option phrases then I think LightwaveRF is probably as cheap as you're going to get. To just turn lights on/off it's possible to avoid getting a main controller box and just using their bulbs with a remote control. They got a few remote + bulb(s) bundles which are a decent price tbh. I had been following Lightwaverf for a couple years but thought their progress was very slow in releasing new devices and updating their mobile control software so didn't want to get locked into their ecosystem.

I'm not mega familiar with Arduino but that appears to be more a learning and prototyping tool rather than commercial-ready hardware/software. I am looking to do this DIY but only the software portion for the most part (I'm a software engineer). I'm not confident enough to be building my own end-devices and I think it would add too much time to an already potentially large project. From a software point-of-view the path I'm currently taking will allow me to use existing skills but I'm not familiar with any of the programing required for Arduino devices so more time would be needed to learn that also. It does look very interesting though and I may tinker with it one day.

This is something I'm interested in too. I backed the almond+ router on kickstarter, that acts as a controller for both zig bee and z-wave. They have just shipped beta units with the final units due this quarter, might be worth a look at for any kind in the market for a router in a couple of months.
I've only taken a very brief look just now and while some parts are interesting (dual Zig-Bee and Z-Wave support), others I don't quite see the point of such as a separate Wi-Fi network when most of their customers will already have one installed and a small touchscreen no bigger than the smallest smartphone these days. Most other devices of this type simply plug into your existing network via a network cable.

I may be understanding this incorrectly but let's say you've just bought the Almond+ and you already have a Wi-Fi network running off your broadband router. You want to control stuff with your phone but your phone only connects to one network at a time. Your home Wi-Fi will be your preferred network so you would have to manually disconnect from that and join the Almond+ network before being able to use its control app - is that right or do they have a simpler workaround?

Edit: scrap all of that... it appears it's a full replacement for your home router. If the price is right, it may be a good idea for some but as it looks like another closed system it will be competing with lots of other ZigBee/Z-Wave controllers. For my own considerations it's not as good as my current router (business class / quad WAN / built-in ADSL/VDSL modems) and I don't want the hassle of network hopping as mentioned earlier.

I had a similar clash of interests when choosing my hardware controller. I have a Synology NAS and it would be technically possible to add a Z-Wave USB transceiver to it and turn it into the control centre. It is already a 24/7 device so it makes sense from that perspective. But then I thought, what if it breaks or eventually needs replacing for one reason or another; I may not even want to go with Synology next time and they are incredibly expensive devices (mine's a 5-slot one) to replace. I decided in the end though to stick with Raspberry Pi as it will be cheaper in the long run to maintain/support and to replicate what I'm doing elsewhere (friends, family or even people reading this thread). Support is also an issue. Not many people will have tried to do what I'm trying to do on a Synology NAS, whereas there is a (very) small community of randoms doing it the Raspberry Pi route.
 
Last edited:
Yes, that's it, it's a router that also acts as a home automation controller. It's replacing an old Linksys for me so a big upgrade and having a single device to do both made sense. The original (non home automation) Almond router is the highest rated on Amazon US.

Not closed as it's built with OpenWRT and there's SDK but yes, it is essentially just another Z-Wave / Zigbee controller.

Anyway, apologies for the apparent derail, I look forward to following your progress.
 
No, I'm glad you mentioned it. I've always had an interest in OpenWRT but never got the chance to try it out. It's definitely a big plus point if it supports it. I've got a DrayTek personally and it's powerful and very functional but has an awful UI. I haven't got anything right now that can take advantage of 802.11ac so am going to wait for compatible devices/routers to mature some more before jumping on that boat.

Back on topic, as I've decided to go with the Pi, I'm currently deciding whether to go with the Razberry Z-Wave daughter board or a USB plug-in stick.

With the Razberry you get a neater solution as it plugs directly onto the Pi motherboard, however I think the USB stick will have better range and you can easily unplug it and take it over to new devices you want to pair.

Razberry is designed to be accessed via an API called Z-Way. It's not clear whether it belongs to them or they have just used it but it seems to be quite good and is designed to be accessed easily via AJAX so I should feel at home with it.

Here is a sample command:

Code:
http://raspberry_IP:8083/ZWaveAPI/Run/devices[2].instances[0].commandClasses[0x20].Set(255)

In the above API call which you can see is simply done over HTTP (Z-Way has an embedded web server to handle such requests I believe):
  • devices[2] refers to the unique Node ID of the device you're trying to control (e.g. a light switch) on your Z-Wave network
  • instances[0] refers to a sub-device within the device you're trying to access e.g. a particular socket on a power strip. In this case 0 likely means it's a singular device.
  • commandClasses[0x20] is just an unnecessarily jargonised way of saying you want to access basic control commands. 0x9c would be for alarm sensors, 0x62 for door locks and so on.
  • Set(255) is the equivalent of "on", (Set(0) would be off).

If I find that Z-Way can be used with a USB stick, that makes the decision a little harder as it could be just the thing I need later down the line to create a bespoke GUI using HTML5/CSS which of course is multi-platform by nature (desktop browser, iPhone, Android, etc).
 
Just a quick update.

I've ordered lots of bits (see post #2) and hope to be able to test them together soon.

A few changes to the original plan:
  • The project is being combined with another project to upgrade lighting from halogen light fixtures to LED down-lighters
  • I'm splitting the installation part of the project into 3 phases, the first of which will cover the bedroom, hallway and home-office mainly. The remaining rooms will be done in phase 2. For cost reasons mainly, automated heating will be dealt with separately at the end in the 3rd phase.
  • I've expanded the controller's planned capability to cover devices working in the 433MHz range, including LightwaveRF. I hope to be able to get them all working together somehow.
 
Subscribed. I am currently in the early stages of creating my own home automation system. I don't currently have a house to install it in mind.

I've chosen Zigbee for now as I had a couple of XBee modules already. I've also got some nRF24L0+ modules which are much cheaper so intend to try them out.

My approach is also using a Raspberry Pi as the main controller with Arduinos as the end devices. I am writing all the code myself, mainly for the fun of the project and also because I don't really like any existing implementation and don't want to be tied in to any manufacturer who doesn't have a fully open API.

Again like you intend on making my system interoperable with different radio types and devices so hopefully I can just purchase an off the self device, write a quick plugin for my system and away I go.

Looking forward to seeing your progress.
 
That sounds like an interesting project. I'd like to see what your hardware ends up looking like.

I'm not familiar with nRF24L0+ modules but I know you can get very cheap RF receivers + transmitters for the Raspberry Pi which just hang off the GPIO pins. I decided against that though because my z-way hardware uses those pins and it's a lot of work to get a basic setup going as you have to do all the low-level programming yourself.

It sounds like that's what you want to do though with a low-level API? Personally I was thinking of writing an API wrapper for other APIs (such as Z-Way) but haven't investigated APIs for other protocols yet. I may have to do some low-level coding also.

My front-end is going to be HTML5 (mobile device friendly) and backend PHP/MySQL but a lot of the device configuration is done directly on the hardware and stored in EPROM.
 
Last edited:
So I got some of the Z-Wave kit on Friday and I've been having a play around with it. So far so good. The devices are all configurable through a backend interface (some screenshots below) and the hardware/software was all easy to setup.

Map overview screen where you can upload your own floor plan(s) and draw zones for your rooms. You can then position the devices within the zones and access their functionality by clicking on their icon.
razberry_map.png


A typical configuration page for a z-wave device - in this case the Aeon Labels Multisensor. You can do drag-and-drop associations between devices and as you can see below I've associated the motion sensor to the Fibaro inline dimmer (labelled Hallway Downlights Dimmer) to automatically turn it on when motion is detected. There are tons more configuration options off-screenshot.
razberry_multisensor_config.png


A basic devices status overview. Even the battery status of battery operated devices can be reported (if the device supports reporting it I guess). I don't know if this is working correctly though as it's been on 100% since I set it up (coming up to 24hrs). The Multisensor can also be USB powered but I wanted to see what how well it worked off 4 x AAA batteries first.
razberry_device_status.png
 
Last edited:
Oh, almost forgot, there's a Z-Way iOS app too which has some functionality but I think is a little work-in-progress. Still it seems to work very well as a remote control for lighting:

zway_ios_home.png
zway_ios_lights.png


There's also another mobile interface which is just a website running on the Z-Wave controller (like the backend configuration website). It's meant more as a demo for developers though I believe.
 
So I just wanted to have a play around with the Z-Way API and got carried away and ended up making a working mobile interface. I was expecting this to take much longer to do.

razberry_custom_mobile.png


Here's what it does so far:
  • Reads humidity, lux (light levels) and temperature from the Aeon multisensor I've currently positioned in the hallway.
  • The sliders work as dimmers for the Fibaro inline dimmer modules (lightbulb on the screenshot) and for the plug-in wall socket dimmers (table lamps on the screenshot).
  • The lightbulb/lamp icons are clickable and act as on/off switches. Switching on returns the dimmer to the level it was prior to it last being switched off.
  • The dimmer level (percentage) labels are also clickable and set the dimmer to full brightness (99% limited).
  • It polls for updates every 5 seconds so can work alongside manual switches and other controllers without issue.
  • I've spent half the development time getting the javascript just right to make it responsive and reliable.
I've still got 2 more Fibaro inline dimmers to setup and I'll be adding buttons to activate scenes as well as other features as I think of them.
 
Good job on the mobile UI, looks great that.

The Vesternet links are some of the best I've read too, well explained IMHO. I hand't really looked into switches much before but 3-way momentary looks like the way to go.
 
Last edited:
Well, to get values out you just call a URL and it basically returns a huge json object with information on the entire network and it's current state.

For example, to get temperature from a multisensor device:

First do an ajax POST to http://raspberryIP:8083/ZWaveAPI/Data/0

Then drill down the returned data object to:

ZWaveAPIData.devices[device_id].instances[0].commandClasses[49].data[1].val.value

Using console.log to output the returned json object allows to you "browse" the object to find the right path to the value you want.

To issue a command, e.g. set dimmer level you do an ajax POST to e.g:

http://raspberryIP:8083/ZWaveAPI/Run/devices[device_id].instances[0].commandClasses[38].Set(50)

Reasonably straightforward so far. Event handling and integrating with the automation engine looks like it's going to be more complex.

Here's the developer's documentation: http://razberry.z-wave.me/docs/zwayDev.pdf
 
Last edited:
Back
Top Bottom