Feeds

How to get a Raspberry Pi to take over your Robot House

Mouthwatering nerdy possibilities - use ANY gadget to bring darkness or light

The Power of One Brief: Top reasons to choose HP BladeSystem

At last, the ability to turn stuff on and off no matter what gadget I happen to be holding at the time

That was nice, but not quite what we were after, so we delved into the JSON interface for device control. There's a cut-down version of the Z-Way client which comes with HTML and JavaScript source code and one can stick it in a browser and see how it works. The interface just asks the IP address of the Raspberry Pi concerned and kicks off a JavaScript client which one can muck about with to find the commands being sent - in our limited experience this worked better than using the manual, and established that we could turn on our light by loading the URL:

http://192.168.1.75:8083/ZWaveAPI/Run/devices[2].instances[0].commandclasses[37].Set(255)

... which returns a null but also switches on the light. Replacing the last number with zero switches it off again and we have a mains switch we can control from any app capable of opening a socket and sending a String.

A device

Less successful was the Keyfob. Including it seemed a very hit-and-miss affair, and we never managed to exclude it at all. But once included the fob worked as promised - we were able to link it up to the mains switch for remote controlled lights - however the manual proved fiddly and control over the flexible arrangement of buttons (which can be double or single tapped, and toggle or be absolute) was far from intuitive.

We did eventually get it "wired" to the switch, and it even worked when the Raspberry Pi was powered down. Z-Wave devices can be instructed to work together, but without the Pi to route the communications it did take up to six seconds for the button push to trigger the switch - not what one would want at the top of the basement stairs. When the Pi was running the same instruction took less than a second, which seems worthwhile.

The meshed nature of Z-Wave means each node is also a relay, allowing every corner of the home to be reached, and the Z-Way interface provides a live table of which devices are speaking directly to each other which is fascinating in itself.

What we really wanted, of course, was to tie the keyfob buttons into our Raspberry Pi music system. Buttons one and three would switch the amplifier on and off, while buttons two and four would start and pause payback, reducing the need to boot up a web browser every time one wants to pause the music (worktop touch-controls not withstanding). But sadly it wasn't to be.

The Z-Way application is all written in C, and while Z-Wave Europe can provide APIs there's no easy way to hitch it to a Python app like our music player. Apparently there was a Python version, but it couldn't achieve the performance necessary to maintain Z-Wave compatibility, which indicates that a second Raspberry Pi is probably in order to keep the music playback smooth.

Sadly catching keyfob actions over the JSON interface isn't possible with this version of Z-Way, so the two-Pi solution is also out for the moment at least. A new version of Z-Way is promised within a few weeks, along with better documentation and and an "automation engine" to facilitate triggered actions.

El Reg readers will likely be more interested in the JSON interface and ability to hook a controlling Pi to a home network capable of managing thermostats, heaters, motion detectors and door locks, rather than an automation engine providing drag-and-drop controls of existing devices. For that the next version of Z-Way looks very exciting, but the existing product still provides a fun introduction to Z-Wave and could make some of those Pi's sitting in cupboards and corners a little more productive. ®

Using blade systems to cut costs and sharpen efficiencies

More from The Register

next story
Report: American tech firms charge Britons a thumping nationality tax
Without representation, too. Time for a Boston (Lincs) Macbook Party?
Apple orders huge MOUNTAIN of 80 MILLION 'Air' iPhone 6s
Bigger, harder trouser bulges foretold for fanbois
Child diagnosed as allergic to iPad
Apple's fondleslab is the tablet dermatitis sufferers won't want to take
Microsoft takes on Chromebook with low-cost Windows laptops
Redmond's chief salesman: We're taking 'hard' decisions
For Lenovo US, 8-inch Windows tablets are DEAD – long live 8-inch Windows tablets
Reports it's killing off smaller slabs are greatly exaggerated
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
prev story

Whitepapers

Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.