It’s been a while since I last made a smart home device, not because my home is fully automated or because there wasn’t a need for another device, but because I still live in a rented unit and didn’t want to to spend the time making and setting up custom devices that would need to be torn down in the future.
Well the other day I realized that I could build another home automation device without a long-term stationary placement requirement! Not too long ago I built voice integration into my smart home system using the Amazon Echo (check out the articles here). While this worked well for moments without ambient noise, it failed to work well during parties, while watching movies, or while listening to music on my sound system. Obviously I needed another way to interact with these smart home devices and the current method of pulling out a phone or tablet, unlocking it, then switching between apps just didn’t appeal to me. What I really wanted was a universal remote that could also talk to my smart home devices.
So I started designing and planning out the features that I would want in my smart home controller and it had to be wireless charged (because replacing batteries or being tethered to a wall is archaic). Here’s the requirements I came up with:
LED Screen to provide visual input (battery life, device selected, value selected, etc.)
Neopixel Ring (because who doesn’t love feedback through colors?)
As a continuation of my Open Smart Hub project I have been interested in adding Z-Wave and Zigbee devices to my supported devices and recently decided to swing for Z-Wave devices first. I bought a Z-Wave Z-Stick Series 2 USB Dongle from Aeon Labs and a simple Z-Wave Door Sensor in order to create the basic mesh network with just two devices.
Unfortunately, it does not work on Windows, and it seems to be having issues with the latest version of NodeJS… But luckily (or coincidentally) the Open Smart Hub runs on a Raspberry Pi 2 running Raspbian and NodeJS v0.10.28.
After the initial setup of my RPi2 with NodeJS, I got to work getting the node-openzwave module on my RPi2. I was seeing build errors when it was trying to install the module, but found a couple of blogs with information that in order to get it to work I might have to install a couple more tools.
sudo apt-get install build-essential make subversion sudo apt-get install subversion libudev-dev make build-essential git-core python2.7 pkg-config libssl-dev
After that, it worked and I could call “npm install openzwave” and have it install properly.
Note: If you are interested in using it on Mac OSX, you will need to install the drivers for it. Read more about that process in a previous blog post.
Getting NodeJS on a Raspberry Pi running the latest version of Raspbian isn’t as dead simple as it is on PCs, Mac OS X, or Linux. Only special versions of NodeJS were pre-built for Linux on ARM for Pi and a list of those versions doesn’t seem to be listed in an easy format.
In my case, I wanted to download NodeJS version 0.10.29 and the next closest NodeJS version for ARM was v0.10.28 or v0.10.30. You can search through each directory in the NodeJS distribution directory, but here is a small list of available Linux ARM versions when I last looked:
In order to download them onto your Raspberry Pi you will need to type these commands into the shell, replacing the version for whichever you want:
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-arm-pi.tar.gz tar -xvzf node-v0.10.28-linux-arm-pi.tar.gz node-v0.10.28-linux-arm-pi/bin/node --version
Now that you have it downloaded on your machine, you will want to add it to your path in order to allow it to be used from anywhere. So you will want to alter (or create if you don’t have one yet) a .bash_profile file in your root:
sudo nano ~/.bash_profile
then add these lines to the file:
Now after you reboot, you should see that you are able to use NodeJS regularly.