Creating a Z-Wave Smart Home hub using a Raspberry Pi
raspberrypihq.com
raspberrypihq.com
tldr; Home-Assistant, the system mentioned in the parent article, now maintains their own OS variant for the RPi that they recommend you install directly.
You don't have to, of course. You can still install Home-Assistant yourself on whatever distribution you choose.
We've got a Raspberry Pi based hub which sits in customer's homes communicating with z-wave devices, the software on there is currently proprietary but if you do buy a policy drop me a line saying you're from Hacker News and I'll turn on access to the MQTT broker running on the hub so you can play with integrating other things ;)
The Vera doesn't have wifi (well, it does, but it can't join a network!!!), but a regular old raspi can act like a wireless bridge, offering wireless access to the vera, and a sound card, and also a linux environment to run my custom rails frontend. Add in some location reporting via Tasker, and I have an announcement sound whenever an outside door is opened, and I have motion and light sensors that record video and upload it to my personal website, and it's all controlled intelligently based on when my wife or I are at home. I'm pretty proud of it.
It's how I have it setup right now, and it was a great way to slowly move away from the Vera (at least as the UI).
It's by far one of the most well-managed community-driven open source projects i've ever used.
All of the "components" are just small-ish python programs that contain mostly "glue" code, and they are required to use 3rd party libraries to actually implement the real work. This spreads the workload out across many repos in terms of breaking changes and help, and makes it much easier to contribute back to (you aren't contributing to a massive monolithic repo, you are contributing to a small 200 line python library with 20 stars on github, much less pressure!).
Because of this architecture layout, anything that has a python library that can be consitered part of "home automation" most likely has it implemented already. In my setup alone I have:
* chromecasts
* 2 different smart TV brands
* many zwave switches (run through a vera, not using zwave directly)
* many zwave door/window sensors
* multiple ip cameras
* a wifi thermostat
* a few IR controllers for "dumb" IR devices
* phone/device tracking (which keeps all the data stored locally)
* usps/ups/fedex package tracking and delivery notifications
* network speed monitoring
* have-i-been-pwned monitoring and notifications
* weather
* a 3d printer's completion percentage
* a google home
* an amazon echo
* ups runtime monitoring
* multiple esp8266 based sensors and switches for various hacked together things
* and more that i'm probably forgetting
And all of it is processed locally (when possible), stored locally (in a postgresql database), secured via TLS, available on any browser anywhere, and on a server I maintain and manage (with the help of some automations I created in hass itself). And speaking of automations, it's python, so they are basically unlimited. I have an automation that will notify me on my phone if it will start raining at my phone's current location before I can get home, and only while on my motorcycle.
It's not perfect (it's pre-1.0 software, so there are still semi-frequent breaking changes, and configuration is mostly manual still via yaml files), but it's been a such an amazing experience.
Home Assistant is the reason why I love IoT.
I know python...I don't know all of the config variables for the yaml language they encourage you to write
Additionally there are multiple apis you can use to interface other than the front end at https://home-assistant.io/developers/api/
Also the HA front end just calls those backend apis, so if you "emulated" those you could use it as a drop in for some other backend (in theory)
One of them is hooked up to a button on a humidifier in my house. I pulled it apart, and just solidered it to one of the buttons and just have the esp8266 respond to some lan rest commands. Using Hass I hook that up to the nest's indoor humidity sensor and it auto turns on when needed. Then I grabbed a small load sensor and hooked it up to the ESP8266 to every hour or so send the load value back to Hass for the water tank in the humidifier.
So now I also get notifications when I need to fill the water reservoir!
Most of them are little things though. One is solidered to the light in my oven that shows if it's on or not, and it can notify us if we leave the oven on, another uses a very hacky (literally 2 paperclips!) Short sensor to say when I open a drawer next to my desk. If I haven't opened it by 9:30 and work is on my calendar, it will notify my phone reminding me to take my medicine!
Once you have the major components setup in something like Hass, and you've worked through the headache of setting up the esp8266s, it becomes really quick, and there are so many uses for them.
My next idea is to put a load sensor in the center post of my chair and notify me if I've been sitting for too long (and maybe of the sensor is accurate enough, maybe weigh me every day? I'm like 90% sire it won't be though...)
It's amazing how awful the state of home automation is on the commercial side right now
Z-wave has a much smaller threat surface area and requires no internet. In fact, it requires no central controller at all, as you can have controllers in every room for scene automation. The internet connected hubs bring a lot of shiny features to the table, but they're completely unnecessary for local automation. Even better, communication forwarding is part of the design so you can have a controller hundreds of meters away from the thing you want controlled and as long as there are a couple of devices on the mesh between them it will work. We've seen how great WiFi repeaters are... plus WiFi on battery is basically a deal breaker, whereas you can have z-wave devices last two years on some AA batteries.
Z-Wave and Zigbee are both so much better than WiFi at automation that I can't even fathom why someone would suggest the opposite.
Z-wave is a proprietary protocol. Only 1 company has the IP & monopoly on manufacturing Z-wave chips... By contrast, any of these other techs are open and have multiple implementations available from multiple manufacturers.
I refine my comment to capture BTLE as one of the protocols going forward, in addition to wifi.
That being said, some combination of BT/LE/Mesh + WiFi and/or some other networking protocol would probably win very quickly if it wasn't encumbered with large licensing costs.
I'm cautiously optimistic for Bluetooth Mesh giving z-wave a run for its money but its still very early days.
Z-wave's biggest short coming in my opinion is how easy it is to overload the network. Turning off 40 lights at once has half of the operations drop off due to the network getting overloaded and just dropping commands. If you have a few devices reporting their power usage, the network becomes quickly overloaded and you get the same command dropping crap in even simple operations like 'turn on light 2 when light 1 turns on and vice versa'.
I have a condo with z-wave everything right now, but after seeing how much of a mess all IoT home automation crap is, I'm going to sit and wait until we have something that works properly that doesn't cost $60-$100 per light switch or require maintaining something complicated.
----
IMO we should have a dual network solution. Something like wifi for plug in devices which also act as repeater networks for the battery powered BLE sensors and such.
But it's dated (from the 1990s), there is zero encryption/authentication, and devices are kinda expensive.
I used to use insteon in a small test build out, but got frustrated with their bad software support. You have to use a ~$300 hub with a $80 PLM modem before you can get something half decent. And Insteon devices having a reputation of breaking after a couple of years due to using cheap capacitors and such put me off from using it any further.
A remotely controlled plug should be running tens of kB of firmware, at most, and that includes crypto libraries. It shouldn't be running the megabytes of code that an embedded Linux OS represents.
Yuck.