Remote Control of LightWave RF plugs via MQTT using emonPi with OOK Tx
Hardware
Many home automation products such as RF plugs, relays and heating remotes use a simple OOK (On-Off-Keying) wireless protocol. UK company LightWaveRF produce a variety of RF plugs and relays which can be controlled via OOK RF. The protocol is also compatible with some cheaper OOK learning receiver relays. While maybe not strictly open-source the protocol and been reverse engineered allowing plugs to be easily controlled from Arduino / Raspberry Pi. There is an active LightWaveRF online community. Using off-the shelf hardware like this is a 'safe' way to control lights, heaters and appliances around a home without getting our hands dirty dealing with with high voltages. These plugs and relays can be used to control anything from lights to immersion heaters, most LightWaveRF plugs/relays will switch up to 13A / 3kW.
Note: OOK protocol by it's simplistic nature is not particularly secure, I would not recommend controlling anything you don't mind getting accidently switched.
See emonPi Technical Hardware Wiki for details how to retrofit OOK TX module to existing emonPi's.
Software
We have been working with Lawrie Griffiths from Geek Grandad blog to develop a LightWaveRF MQTT service to run on a Raspberry Pi to allow LightWaveRF plugs to be controlled via MQTT.
E.g "1 1" switches on plug 1 while "1 0" switches off plug 1. Plugs can be paired in the usual LightWaveRF plug.
See emonPi technical Wiki for how to install & setup.
Existing LightWaveRF remotes can be emulated allowing plugs to be controlled from either emonPi MQTT or via the remote.
Now our plugs can be controlled via MQTT there are a many of options open as to how to control either via interface openHAB (blog post coming soon..), nodeRED, android Tasker etc.
I have been using nodeRED with input from android OwnTracks running on my phone to detect when I'm home and turn on a couple of lights:
Demo:
Using NodeRED and OwnTracks to turn on LightWave RF sockets when I arrive home:
Using android Tasker with AutoVoice and MQTT plugins to control LightWaveRF sockets:
Next Steps
Now we can control appliances remotely via MQTT the next logical step is to add a mobile user interface. In my next blog post I plan to explore setting up openHab to control appliances. Here's a early preview:
We plan to include out-of-the-box support for OOK LightWave RF, nodeRED and openHab pre-configured on our next emonPi pre-built SD card. Due for release in December 2015.
To engage in discussion regarding this post, please post on our Community Forum.