Connecting LIFX Bulbs with Vera (Z-Wave)


A quick guide on how I got my bulbs (sort of!) connected to my Vera network. No real trickery here. And the bulbs themselves aren’t yet added, instead, I focused on creating common scenes and made scenes in Vera.

What’s needed:

  1. A Raspberry Pi (or other *nix computer that you’re happy with keeping on all the time)

  2. Ensure it has a static IP on your local network - otherwise if the IP keeps changing, this won’t work too well. For mine, the IP is

  3. Ruby v2.0 (Raspbian has an older version, so I had to follow these instructions to get 2.0 installed: ( (this took forever to finsih!!)

  4. sudo aptitude update

  5. sudo aptitude install git-core

  6. curl -L | bash -s stable –ruby

  7. pi@raspberrypi ~ $ source /home/pi/.rvm/scripts/rvm

  8. Make sure root can see the new file by changing the /bin/ruby binary to point to the new ruby that is placed somewhere obscure in your own folder. For me, it: /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby

  9. sudo ln -s ruby /home/cdrum/.rvm/rubies/ruby-2.1.3/bin/ruby

  10. The (unofficial) Ruby HTTP API for controlling LIFX bulbs: (and follow those instructions on getting it installed), but the long and the short of it is:

  11. rvmsudo gem install lifx-http

  12. Note here i’m using rvmsudo - this was key to ensure that the gems are installed systemwide, and that root, during the installation, gets my new ruby 2.1.x environment (otherwise you’ll get complaints that LIFX requires >= Ruby 2.0.

I wrote a simple php script to help generate the Lua code (the language Vera uses) that you can paste into the Scene configuration.

See this URL to get my code:

Running my script, you will get a result that looks similar to this:

In Vera, go ahead and create a scene and click on the Luup tab:

Paste the Lua code that is generated from the script above, save, reload, and now you should have a working scene that controls LIFX bulb(s)!!