Successful integration of Raspberry Pi and LightwaveRF

Martyn36

Novice Member
Hi All

I am happy to say that I have successfully integrated a Raspberry Pi and LightwaveRF (hurrah!).

This basically means that I have a functioning Pi with GPIO interface accepting digital inputs and triggering LightwaveRF commands on a change of state.

What does this mean? Well, in short, it means that I have created a £35 interface to connect anything that has a volt free output into the LightwaveRF system to allow things like Security Alarms, CCTV Cameras, Magnetic Switches, Sensors, Switches, Pressure Sensors, Light Sensors, Movement Sensors - hell, anything with an output really, to be able to control any devices on the LightwaveRF system (lights, appliances and so forth).

Why did I do this?
Well, for starters, I have electric gates on my drive, and I wanted to connect a reed switch to them when they open and have my LightwaveRF Mood lighting come on on the driveway, light up the hall, turn on my water fountain and maybe even put the kettle on.
Then I decided that I also wanted to allow my CCTV Cameras (the Tenvis IPRobot3 with Alarm Output) to trigger the lights to come on around the house when it detected movement.
Then, when I was looking around for a new Security Alarm, I was disappointed to find few choices for alarms to integrate with LAN, or Lighting systems. Now, my Communicator Interface on my Veritas Excel can fire off a 12V output into a vold-free relay and kick my Raspberri Pi GPIO input and the Pi can then fire off a LightwaveRF command.

The design includes the following;
A Raspberry Pi - (£25 CPC)
A "Slice of P/IO" Daughter board for the Raspberry PI (Ebay - £5 !)
Install a Lighttpd Web Server on the Pi
Install PHP - (How2Setup a web server with php support on your Raspberry Pi - Simon The Pi Man)
Install Python
Write some code in PHP for the LightwaveRF Wifi Link (Networked Solutions Blog » LightWaveRF controlled by PHP - my thanks to Steven's blog)
Write some code in Python for the GPIO Interface on the Pi

Bingo! Now, when any of my 16 inputs are triggered I can turn lights, appliances and whatever takes my fancy on and off.

If anyone is interested in a detailed breakdown and write-up, and my Code to get you going, please let me know.
:hiya:
 

Linx08

Active Member
Very interesting, well done. I keep thinking about getting a raspberry. :)
 

Rick2102

Novice Member
Great work Martyn. I am sure this will make alot of people happy.

For a while and due to money anything we were on going with on the house has come to a stop, but I have been looking at the lighting side for some time now and I wanted Rako, but down to money was drawn towards LightwaveRF. I have 2 switches which came from B and Q, but have not fitted yet due to alot of bad on LWRF, but more recently I have been reading quite alot of good.

Am looking at using I rule for control and wanted my lighting to be included in this, with this I guess I will be able to, or is this purely for relay open/close commands?

I know Box Of Tricks had said some one at LWRF had made Irule work wuth LWRF, but not emphasized much more, but you needed a different wifi box.

Thanks for sharing this :smashin:
 

Martyn36

Novice Member
Hi Rick

I haven't used Rako, or Lutron, or C-Bus or any of those because of the costs and in some cases the infrastructure to install.

I was, for many years an X10 enthusiast, but took the plunge to get rid of it all and replace it about 6 months ago. I found X10 to be too unreliable.

My options were really Z-Wave or LightwaveRF. Personally I think Z-Wave might be slightly better, but it is a bit more expensive. LightwaveRF is still being developed and new products are on their way.

I have a whole bunch of LightwaveRF stuff now, and it is high quality, high reliable. The only trouble I have is the early firmware that limits creativity (limiting timers, macros and the absence of IF/THEN logic). I'm sure these things will come in time. What seems to be true is that this company (JSJS designs) do not seem to be in the business of banging out beta-this and alpha-that - instead the opt to get it right and release it once... you can see evidence of this in the fact that they partnered with Siemens.

My Raspberry Pi project I described here is mainly aimed at improving the connectivity while I wait for more devices and options to come out. I can implement my own IF/THEN logic in Python on my RPi and then just the LWRF to drive the lamps and devices either locally, or over the WAN.

I toyed with iRule, but couldn't get it to work with UDP as required for LWRF WiFi box. In truth I probably ran out of patience on it. They only offer a 14 day free trial and I couldn't get it to work on UDP from Android devices in that time and it expired. Instead I have been using OpenRemote for about 18 months. This means I have control panels for all my AV (Global Cache & Keene boxes to convert WiFi to IR) and for my LWRF, and for my Mediaportal - my control panels are two Android 7" tablets at £50 each, one iPhone 5 (company!), and my 10" Motorola Xoom. OpenRemote is really cool, as long as you're prepared to have an always-on computer somewhere (enter the RPi again) to act as the master controller.

If you haven't taken a look at OpenRemote, I do recommend it.

Martyn
 

Martyn36

Novice Member
Very interesting, well done. I keep thinking about getting a raspberry. :)
Linx08 - DO IT!... you won't regret it. CPC | CPC - Over 100, 000 products from one of the worlds leading distributors of electronic and related products. £35. Don't get fooled with all of the "RPi Accessories" there's nothing special about them - just an old Blackberry charger for the PSU, I'm sure you have an HDMI cable knocking about, and don't buy the Linux Debian SD Card pre-loaded because it's a rip-off. Grab a 2G stick from an old mobile phone, download the image and do it yourself.

Seriously, all I bought was the Pi from CPC for £35, a case from ebay for £4 and the Slice of PI/O daughter board for £4 again from Ebay.

(oh, and now CPC are doing the 512MB version of RPi for the same price).
 

Martyn36

Novice Member

At the risk of sounding like a completely old fart (which I assure you I am NOT), this RPi is the best thing to come out for the education programmes for donkey's. "In My Day" (I hate saying that), we learned programming by bit-bashing and we had a real connection with the hardware. Heavens we only had a few k of RAM, so we had to use a bit for a binary variable - none of this unsigned long malarkey for every single variable. It's no wonder that today's young programmers are contributing to bloatware when they get anywhere near MS development and grinding all our hardware down.
I think the RPi launching for the education market is an absolute god-send and will allow our new programmers to re-gain an understanding of hardware and how to drive it efficiently. I have lost count of the number of programmers I have interviewed over the years who don't even know what Registers are !

I love my Pi and I am proud of it.... £25 or £35 - what a steal!!
 

Rick2102

Novice Member
Hi Rick

I haven't used Rako, or Lutron, or C-Bus or any of those because of the costs and in some cases the infrastructure to install.

I was, for many years an X10 enthusiast, but took the plunge to get rid of it all and replace it about 6 months ago. I found X10 to be too unreliable.

My options were really Z-Wave or LightwaveRF. Personally I think Z-Wave might be slightly better, but it is a bit more expensive. LightwaveRF is still being developed and new products are on their way.

I have a whole bunch of LightwaveRF stuff now, and it is high quality, high reliable. The only trouble I have is the early firmware that limits creativity (limiting timers, macros and the absence of IF/THEN logic). I'm sure these things will come in time. What seems to be true is that this company (JSJS designs) do not seem to be in the business of banging out beta-this and alpha-that - instead the opt to get it right and release it once... you can see evidence of this in the fact that they partnered with Siemens.

My Raspberry Pi project I described here is mainly aimed at improving the connectivity while I wait for more devices and options to come out. I can implement my own IF/THEN logic in Python on my RPi and then just the LWRF to drive the lamps and devices either locally, or over the WAN.

I toyed with iRule, but couldn't get it to work with UDP as required for LWRF WiFi box. In truth I probably ran out of patience on it. They only offer a 14 day free trial and I couldn't get it to work on UDP from Android devices in that time and it expired. Instead I have been using OpenRemote for about 18 months. This means I have control panels for all my AV (Global Cache & Keene boxes to convert WiFi to IR) and for my LWRF, and for my Mediaportal - my control panels are two Android 7" tablets at £50 each, one iPhone 5 (company!), and my 10" Motorola Xoom. OpenRemote is really cool, as long as you're prepared to have an always-on computer somewhere (enter the RPi again) to act as the master controller.

If you haven't taken a look at OpenRemote, I do recommend it.

Martyn
Hi Martyn,

Thank you for a detailed reply.

Yeah Lutron is pricey and Rako is too pricey too for me really, it is the the fact that it will integrate with alot of systems which aoppealed.


Yeah, have looked at Z-Wave too, the LWRF seems fairly simple, but does the job (all been that it doesn't keep falling over) I think people are also a bit hacked off that LWRF make all sorts of promises of new products/new apps etc and never seem to materialize.

Glad you like it and it is reliable as that gives me confidence. The fact of not been able to create macros with other systems eg: one press, lights dim, projector drops, screen drops and it fires up on media player screen is also what was putting me off, but with your set up that is now achievable.

Shame with Irule as it looks very slick and sure it would work very well. Has a look at Openremote and looks pretty good. What I will be doing will be very similar to yourself as will use Itach's for IR control for TV/Amp etc, using Squeeze of Jogglers for multi room audio and putting them in the wall with local amps, will have some ctv, want heating also as am adding underfloor heating and also would liek to control my rads also all by Android/Apple as I have Galaxy S3, Mrs Iphone 4 and we have Galaxy Tab2 10", and a 7" Google Nexus and will use these for control.

No probs with leaving a PC running so would work. How does Squeeze fit in with Openremote, or doesn't it? Obviously can use their app.

I take it your a developer?
 

kaygeebee

Active Member
this is exactly what I am looking to utilise a Pi for, something to kick LightwaveRF product into life..

So, as you so generously offered... can I have "a detailed breakdown and write-up, and my Code to get you going" please :thumbsup:

Looking forward to it Martyn when you get the time.
 

RajP

Distinguished Member
kaygeebee said:
this is exactly what I am looking to utilise a Pi for, something to kick LightwaveRF product into life..

So, as you so generously offered... can I have "a detailed breakdown and write-up, and my Code to get you going" please :thumbsup:

Looking forward to it Martyn when you get the time.
I would like to get my hand on this too if possible.. I am looking to put automation in my house and this would be a great starting component. Thx
 

cunnishaun

Standard Member
Me too if u don't mind!


Was going to order a Pi but didn't really know what I could do with it, never touched on computer programming, just electrics! i'm a electrical maintenance engineer by trade!

If I can use the Pi will some guidance from people on here, which I would really appreciate, for home automation, which has always been an interest to me, that would be fantastic! :)

Thanks S
 

paulypopex

Standard Member
I'm a programmer rather than a sparks so have focussed on that side. I've written a ruby gem which you can use as a command line too just type

gem install lightwaverf

then sync your devices to turn on and off from the command line. Maybe this can be connected in to the clever GPIO stuff above? The source code is all at

https://github.com/pauly/lightwaverf

Got some node code there that polls the energy monitor too and makes a nice graph like on Paul's pi homepage - also free, help yourself!

I am going to get that slice of pi daughter board and give the gpio a try. Until then though I have some more dimmers and sockets to install. Gotta love the b&q sale...

Not tried to post on this forum since 2010, just had to reregister, been a lurking member since 2007 though when I was looking for tv advice... will be back now with lightwaverf stuff.

The one negative point about lightwaverf is that the dimmers are not as sensitive as my old ir remote - if I turn down too low my low energy bulbs can't hack it and flicker... I hope it won't turn out I'm using much more power now.
 

McdonaldNigel

Standard Member
Hi all, I'm not a techy and was wandering if anyone could recommend a automated lighting system that is fairly easily integrated with the existing wiring and would provide gsm and hopefully Internet enabled lighting control. The lights house lighting will include several outdoor security lights, garage lights and room lights over three floors. The lights house lights are predominantly led lights and we do not use dimmer switches. It would be great to integrate in other security and safety devices such as room temp sensor and motion sensor. I've checked out several manufacturers but I can't find the gsm and Internet interface to operate devices across a large area. Does anyone utilise the existing electrical ring circuits as the means of transferring the signal inputs rather that using ir rf or wifi? Many thanks, Nigel
 

pocster

Standard Member
Fantastic post.
So as a minimal requirement I don't need the lightwaveRF wifi box do I?
The bit that confuses me (forgive noob) is how the pi actually sends the radio signal. Is it a hacked lightwaverf transmitter?; or does it 'emulate' the lightwaverf wireless signal???
Please advise! ;-)

Cheers
 

pocster

Standard Member
I should mention I am from an embedded real-time software background and agree with Martyn36. My "test" for a supposed programmer is I ask:

"How would you determine if an integer is odd or even?"

The reply is ALWAYS something like "use mod" or "use %"

NO!

AND %1

:) :) :)
 

Martyn36

Novice Member
Hi pocster

Yes, and no.... You DO need to have the LightwaveRF WiFi Box because it's the thing that takes the UDP broadcast from the Pi and sends out the RF to the appliances or lights.

the gents at JSJS Designs (who make the LightwaveRF stuff) have kindly shared the protocol (you can also find it out there on the forums with some googling, but if you want your own copy, just send them an email and they will send you a form to sign and they will share the protocol with you.

So in summary, it's Pi via UDP to LWRF Wifi then to LWRF lights via RF....

(and of course we are all eagerly awaiting the "soon to be released early in Q1 2013" new products from LWRF that have been promised..... :)
 

Martyn36

Novice Member
Hi to those that are interested....

My design from the original post now got super sexy with an Android Tablet running as the Control Panel for the Security system using OpenRemote.

So I have an RPi taking GPIO from sensors and sending UDP to LWRF to control appliances and lights, and also firing of MP3 Alarm sounds out of it's 3.5mm jack into a solid state amp - but now with a remote GUI over WiFi on a wall-mounted 7" tablet from Tabtonics (~£50).

The OpenRemote app allows me to communicate with the RPi over WiFi TCP and also using a UDP Listener so that I can do the following;

1. The Tablet has a 9 digit keypad for "arming" and "disarming"
2. The Tablet has icons that light up to show Arm and Alarm state
3. The Tablet has icons which light up for each of the 16 input zones
4. The tablet uses a WebView which pulls up an HTML Logfile so I can monitor events and lots against timestamps.....
5. OpenRemote - (together with a Keene IRAnywhere box) also allows me to control my IR devices when an alarm or other condition (like me coming home from work) occurs - so when I enter the drive, the lights come on, the water-feature comes on, the AV Rack comes on, and the CD starts playing. if it's not me coming home, then instead of all the nicities of music and the coffee pot, the intruder is met with my Dogs barking MP3 out of my RPi, all the floodlights on, and CCTV set to Record.

It's looking good now..... :)

I will try to take some photos and screenshots this weekend and put together a more detailed breakdown of the sub-systems and post my code for anyone interested.
 

pocster

Standard Member
Hey Martyn36

Thanks for the swift reply!. I certainly would love too see any photo's and sample code!

Cheers!
 

pocster

Standard Member
Just a thought.
As the pi transmits via wifi to the lightwaverf base unit which in turn transmits to the appliances - are there any range issues?
i.e. I wish my pi to be anywhere in the house and be able to control anything.

Cheers
 

witchdrash

Active Member
pocster said:
Just a thought.
As the pi transmits via wifi to the lightwaverf base unit which in turn transmits to the appliances - are there any range issues?
i.e. I wish my pi to be anywhere in the house and be able to control anything.

Cheers
If your raspberry pi can get on the wifi, no, if it can't see the wifi, then yes. Range is determined by your access point and building structure.
 

paulypopex

Standard Member
Fantastic post.
So as a minimal requirement I don't need the lightwaveRF wifi box do I?
The bit that confuses me (forgive noob) is how the pi actually sends the radio signal. Is it a hacked lightwaverf transmitter?; or does it 'emulate' the lightwaverf wireless signal???
Please advise! ;-)

Cheers
This is the business someone has written code to talk direct to the lightwaverf devices without the lightwaverf wifi link - it is some proper hacking though needs some hardware skills and an arduino and so on.

If you have the wifi link there are lots of ways to do it the protocol is quite simple. I have some code to connect with an arduino and some code doing similar running on a raspberry pi (source code here) or just "gem install lightwaverf". It might be a bit geeky but it's very satisfying working on this stuff.
 

Craig1989

Active Member
Is there going to be a how to guide for this?? I'm just getting started with the lightwave rf products! I currently have 2 dimmers and various on/off plug in switches! But have a plan to buy a lot more and hopefully eventually integrate heating and home security and expand the products to every room in my new home! One thing that bugs me is there terrible app so I'm glad to see there are people out there that are hacking this system to use on other apps and of course the integration with the Raspberry Pi. As I'm not a programmer and have only just done some reading on what a Raspberry Pi actually is its safe to say that I have not got a clue where to start! I'm pretty good with a computer and love tech so I'm willing to start learning! Hopefully a how to will come out soon to get me going! If there is anymore reading material that anyone knows of regarding lightwave rf and raspberry pi controlling there household could you post a link so I could have a look, I have looked at the lightwave rf forum and read a few threads but none of them really go into detail and post pictures of what they have actually achieved!
 

paulypopex

Standard Member
I just added more of a guide on my lightwaverf repo but you're right we could do with more detail and pictures. Everyone is doing this only for their own entertainment so far and not so much thought of passing it on to others. The raspberry pi route might not be for you but if you have a mac or a linux based computer the same things in the guide above will apply. It's not as simple as it could be.

If anyone out there would like to contribute to my guide please fork and send a pull request! I'll try and improve it too. I have a half written guide on how to get the timers working with a google calendar (I've done this and it's great) the difficulty is tring to simplify it.

https://github.com/pauly/lightwaverf

It's worth persevering though, just keep searching and reading as much as you can. If you have an iphone and a raspberry pi several people have hacked it into Siri so they have voice activated lights and devices. There's an android equivalent using Tasker too, not tried either myself though.
 

The latest video from AVForums

Podcast: Best Hi-Fi products of 2020, Plus Best of the Month for TV Shows & Movies

Latest News

Best Projectors of 2020 - Editor's Choice Awards
  • By Phil Hinton
  • Published
What's new on Sky and NOW TV UK for December 2020
  • By Andy Bassett
  • Published
PS5 vs. Xbox Series X: Which Next-Gen Console is Best?
  • By Rik Henderson
  • Published
Black Friday 2020: Best UK deals currently available
  • By Andy Bassett
  • Published
Top Bottom