Had a chance to play with the RaZberry yesterday. In reading about it, noticed that you could control devices via either JSON or simple URLs (via a browser). Being a total n00b, it took me an hour or so to figure out what was needed to control the lights with a browser but the first of the following two URLs will turn my floor lamp on, the second will turn it off:
- http://pi1:8083/ZWaveAPI/Run/devices[2].instances[0].SwitchMultilevel.Set(0)
- http://pi1:8083/ZWaveAPI/Run/devices[2].instances[0].SwitchMultilevel.Set(255)
As you can guess, anything between 0 and 255 is a dimmer setting, which the GE Lamp Module is capable of. Note: the "pi1" in "pi1:8083" indicates that I'm running an internal DNS server and have /etc/resolv.conf to first search the local domain before going out into the real world.
In short, I now have a yellow light bulb icon (and a grey one) on my menu bar that controls the floor lamp. The code behind it is nothing more than:
wget -O /dev/null "http://pi1:8083/ZWaveAPI/Run/devices[2].instances[0].SwitchMultilevel.Set(255)"
The "-O /dev null" tells wget to no save what is returned by the URL.
To go with this, I came up with another project for the second RPi. I picked up a couple door bell buttons at Lowes this afternoon and some cheap wire. I plan on mounting them on the side of the cheap desk next to my bed and mounting the RPi to the underside of the desk. The buttons will be connected to the PiFace daughterboard on the RPi. I'll need to write code that will send commands to the RPi with the RaZberry daughterboard. To start, I'm thinking that I'll configure it as a simple toggle for the lamps (one for the desk lamp, one for the floor lamp). I'm also thinking that if I ever add additional lights, I can "chord" the buttons (2 buttons being able to control 3 lamps, 3 buttons being able to control 7 lamps, etc.).
Other thoughts:
- Home automation software: Whenever I get enough time to stand up actual home automation, I will probably repurpose the buttons to send signals to that software, vice directly to the RPi with the RaZberry.
- Voice control: Tieing the two RPis into the Palaver software. Only needs the addition of a powered USB microphone, which I already have.
Anyone else have ideas?