Live data from Hacker News

Run Your Home on a Raspberry Pi

pragprog.com

61–70 of 276 posts

Re: Run Your Home on a Raspberry Pi

#61

Home Assistant[1] is the best approach I've found for this. It's pretty amazing but has a pretty steep learning curve (although they're getting better and better at this). The real power of HA is the rich integration ecosystem[2], the Community Store[3], and that it runs locally (more reliable and much faster for things like motion sensors, etc). It expresses everything from every integration as an entity in various…

I had a terrible experience with Home Assistant. Slow, buggy, unreasonably difficult to implement non-trivial automations.

My heuristic since then has been to minimize the amount of node.js in my home automation codebase and this has worked wonders for its reliability and usability; currently the only component I still have that's node-based is zigbee2mqtt, which (possibly not) incidentally gives me more issues than any other component.

The best approach I've found has been to have (in isolated jails/containers) zigbee2mqtt dealing with zigbee network stuff (you must use CC2652 based coordinators and routers for any kind of reliability), mosquitto acting as an MQTT broker, and a custom program (write it in whatever you like) talking to mosquitto, with Pushover for push notifications.

Re: Run Your Home on a Raspberry Pi

#62
post #58

Home Assistant[1] is the best approach I've found for this. It's pretty amazing but has a pretty steep learning curve (although they're getting better and better at this). The real power of HA is the rich integration ecosystem[2], the Community Store[3], and that it runs locally (more reliable and much faster for things like motion sensors, etc). It expresses everything from every integration as an entity in various…

If you don't have any need for bleeding edge devices, Openhab still works on a rpi4 as an alternative to HA. I like that I can just install it as an apt package onto an existing rpi with other things and java just does its stuff, rather than dedicating the entire rpi4 to it or running in a container.

> I like that I can just install it as an apt package onto an existing rpi with other things and java just does its stuff, rather than dedicating the entire rpi4 to it or running in a container.

If you try Home Assistant again, you'll probably like Home Assistant Core. No separate OS or container needed, just a Python virtual environment. That's how I have it installed. I have to do the updates and backups manually (rather than it self-updating automatically / through the UI) but I find that preferable to dealing with an extra machine, VM, or container.

Re: Run Your Home on a Raspberry Pi

#63

Home Assistant[1] is the best approach I've found for this. It's pretty amazing but has a pretty steep learning curve (although they're getting better and better at this). The real power of HA is the rich integration ecosystem[2], the Community Store[3], and that it runs locally (more reliable and much faster for things like motion sensors, etc). It expresses everything from every integration as an entity in various…

How do you handle network security? I wouldn't trust an IoT device on the same network as any of my family's computers or phones for example.

Not OP, but I make extensive use of VLANs to isolate off security cameras, IoT devices, etc. etc. into their own mutually isolated network environments.

I also don't use Wifi for any of these devices anymore. It's usually a bad experience. Either use ethernet or a dedicated IoT-oriented wireless protocol. Z-wave seems OK but not very flexible, Zigbee is a pain in the rear (but the only option for many device classes), and I'm hopeful that Thread will actually be good.

Re: Run Your Home on a Raspberry Pi

#64
post #7

I have to ask others, have people had good luck with this? I have tried to do this multiple times, with multiple models of Pi and every time after 6ish months it just seems to completely stop working. I can't get it to boot even off of a new sd card. Am I doing something wrong or does the hardware really not want to be run consistently in this manner? I have since decided to just run some home automation VM's on my m…

Pis are horrendously unreliable. Even if you pull out all the stops to make them work reliably (like disabling SD card writes), they don't.

The broadcom chips they use are complete garbage. I was hopeful I could use the watchdog timer to make a pi more reliable (by restarting it when it inevitably crashed). Guess what? The internal watchdog timer doesn't f*cking work! You'll notice that every project using pi hardware that needs a WDT uses an external one.

Total junk! I don't use them for anything anymore, and I used to have like 6 automating various things.

Re: Run Your Home on a Raspberry Pi

#65
post #42

Better yet, run your home on Dell/HP micro computers that get decommissioned by enterprises/hospitals/big-orgs every 3 years. Find them on Offerup or FB or Craigslist market place for $100-$200. These are built solid with metal enclosures, fan cooled, UL certified PSU, ~7k CPUbenchmark.net. Usually i5 6thGen Intel CPU, 8GB-16GB RAM and have REAL storage(SSD) and M.2 NVMe. If you are lucky you might find vPro version…

WHAT STORE DID YOU BRING THE PI TO? IS IT STILL THERE?

I'll second the recommendation for real PC hardware. Tinkering is fun up until it's not. When it becomes not fun is when something breaks, takes down a system you have come to rely on, and now it becomes work to recreate the functionality you used to take for granted. Seeing people go for the RPi for something they're going to put a lot of hours into makes me cringe a bit, having had several SD card filesystems get corrupt. If that's what it takes to get you started with self hosting, by all means go for it. But there is much nicer hardware for running servers on.

Having said that, I still use RPis for edge devices and the like.

PS I really like that idle power figure on your server. I wish there were a list of power consumption figures for integrated hardware, it seems quite hit or miss.

Re: Run Your Home on a Raspberry Pi

#67
I'm curious about other people's experiences with this stuff, especially if you're someone who likes simple scripting and found Home Assistant to be too clunky.

Basically, I've bought a lot of these little devices, and am much more interested in doing this in a more "Unix Way" way; give me text streams/web APIs and let me figure it out. I think there are things like Huginn and there's a like a Perl one or something?

Frankly, I'd really like to do it in Bash or similar? Anyone gone their own way like this?

(I end up not getting far because the use cases aren't compelling enough for me to put the time in? I don't know.)

Re: Run Your Home on a Raspberry Pi

#68
I've been doing a bunch of home automation work recently. Here are some observations I've made:

1. Most extant home automation software is totally unreliable garbage. Buggy, slow, poorly designed. You want to reduce the amount of code you pull in as much as possible.

2. Raspberry pis are totally unreliable garbage. The hardware is just bad. There's no way to make them reliably operate for long periods of time without crashing, and there's no way to make them automatically recover from a crash (because the watchdog timer, or its driver, in the crappy broadcom chips they use is broken).

3. Most of this home automation software is optimized for users who don't know how to code at all, and is extremely poorly optimized for people who can write basic scripts or whatever.

4. Most of the radio protocols for wireless IoT devices are totally unreliable garbage.

After messing around with this on and off for a few years, the best setup I've found is:

1. Use a normal computer or server, not a raspberry pi. It doesn't need to be expensive or anything; just use a decent machine with an x86 processor. There are tons of great industrial PCs for cheap on ebay.

2. Use some kind of containerization setup for separating components. I strongly recommend using jails on FreeBSD, since you can treat jails as physically separate machines for networking/firewalling purposes (using vnets).

3. Make liberal use of VLANs to isolate IoT things from the internet and from each other.

4. Don't use any IoT devices that operate over WiFi. Ethernet is great, and dedicated wireless protocols (zigbee, z-wave, etc.) can be OK with a bunch of work.

5. If you want non-trivial automations, don't try to use some existing "user-friendly" or "low-code" or whatever home automation software. Just write a normal computer program that does the automations.

The specific stack I have for most of my automations in my current house is zigbee2mqtt running in one jail (this is by far the most problematic component), mosquitto running in another, and then my program which does the automations running in a third. My program can also do things like send me push messages via pushover.

I've managed to get a seemingly stable zigbee network with a not-totally-trivial number of devices (around 25 now) by using CC2652 radios and plenty of zigbee routers, and also turning off all lightbulbs before adding more devices to the network.

It's a shit show, and I can't really recommend getting into it right now unless you want to spend a bunch of time doing sysadmin tasks, or you only want very simple automations (in which case maybe use HomeKit or something).

Re: Run Your Home on a Raspberry Pi

#69

Home Assistant[1] is the best approach I've found for this. It's pretty amazing but has a pretty steep learning curve (although they're getting better and better at this). The real power of HA is the rich integration ecosystem[2], the Community Store[3], and that it runs locally (more reliable and much faster for things like motion sensors, etc). It expresses everything from every integration as an entity in various…

Home Assistant has been nothing short of amazing. I started out just wanting to control my Christmas lights back in early December; tried going the HomeKit with HomeBridge route, only to realize I needed an iHub or some other (i) device on my network to have it work remotely. It was a bad experience even while on my network, luckily stumbled upon Home Assistant looking for better options a week or so into the journey. Now I'm controlling everything, even watching my security cameras, through HA.

The one caveat in my experience has been trying to run Pi-Hole on the same server as HA Supervised or using Adguard Home. Trying to run HA and PiH, even though they were both in docker containers, caused the Pi 3B+ to freeze every few hours. HA makes it clear running anything else is a bad idea, and that proved correct. I deleted PiH and tried the Adguard Home addon for my DNS for awhile, it was really slick and had a lot of features, but I found myself missing the PiH for several reasons. For one, it really sucked to be tinkering with HA while other people on the network were on the web; every time I needed to restart HA (which was often setting up the cameras), I'd get constant groaning and moaning about the internet being out. I also found it harder to control white/black lists; adding individual sites here and there was not as simple as it is in PiH. It also lacked the simple "disable for X minutes/seconds" feature I used so much.

I ended up installing just PiH on the Pi 3B+ and grabbing a cheap Chromebox off ebay to run HA. All the things I was doing on HA really pushed the Pi at times and I read one too many stories about SD cards dying from heavy use. Now everything is zippy and I feel safer with HA installed on the internal M.2 SSD.

Re: Run Your Home on a Raspberry Pi

#70

Home Assistant[1] is the best approach I've found for this. It's pretty amazing but has a pretty steep learning curve (although they're getting better and better at this). The real power of HA is the rich integration ecosystem[2], the Community Store[3], and that it runs locally (more reliable and much faster for things like motion sensors, etc). It expresses everything from every integration as an entity in various…

+1 for Home Assistant. Have it running on RPi4 for almost two years already without single glitch. It has tons of integrations, and besides that you can always build your own Arduino modules to connect with it over MQTT if you have your special use case. Web UI is really nice, you can even access and edit config files with it without going ssh. Android/IOS app also works pretty well.
Post reply on HN