Live data from Hacker News

Run Your Home on a Raspberry Pi

pragprog.com

161–170 of 276 posts

Re: Run Your Home on a Raspberry Pi

#161
Am I the only one who still has yet to understand the value proposition of a smart home [outside wifi + sonos]?

The trade off isn't a clear win to me for me to automate everything else. If it was I would try a raspberry pi set up.

Re: Run Your Home on a Raspberry Pi

#162
post #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?…

You can do both! I run HA for the web gui, but I have a few shell scripts for more automated things. Actually, now that I'm looking at them, they call to an HA api to make changes. So you could run HA to provide a web API for things and script around that?

Re: Run Your Home on a Raspberry Pi

#163
post #94

Earlier quoted context omitted.

In addition to all of the "use Z-Wave/Zigbee as much as possible" comments (which I personally do), for stuff where there's no choice like Roombas, I have a separate SSID on a VLAN that can only talk to the internet, my DNS server running Adguard, and HA (which is on the main network). I also have stateful rules that allow connections to be initiated from the main network to the IOT network, but not vice versa. I als…

How do you setup a separate VLAN and SSID? None of the "pro-sumer" wifi mesh setups under $500 support VLANs

The Ubiquiti Access Point AC Mesh Pro[0] (~$200) appears to support multiple SSIDs and VLANs. Of course you'd need at least two of them to count as a "mesh", which is $400… was your $500 budget per access point or for the whole system (and if so, for how many APs)?

[0] https://store.ui.com/products/unifi-ac-mesh-pro-ap

Re: Run Your Home on a Raspberry Pi

#164
post #76

Earlier quoted context omitted.

I did that too but those PCs are just stupidly massive for the purpose. Raspberry Pi 4s don’t require SD cards any more so the storage issue is moot. My RPi sits next to my router now, you wouldn’t even know it’s there unless you looked closely.

Did you read the part which says "micro", these are about 2-3x the size of Pi with those cheap plastic cases. I had mine beside the router before I moved it inside TV console. Pi will be single purpose device, the "micro" can be full blown server and comes with ALL parts required, no need to hunt for good PSU, case, cooling, storage. Some of them come with 1 Sata and 2x M.2 NVMe, so you can literally pass those NVMe…

May be you mean 2-3x in every linear dimension but that still seem to be smaller than those in my mind. (While Mac mini is not known to be the smallest, it definitely exceeds 2-3x in some linear dimension already.) What kind you have in mind?

Re: Run Your Home on a Raspberry Pi

#165
post #94

Earlier quoted context omitted.

In addition to all of the "use Z-Wave/Zigbee as much as possible" comments (which I personally do), for stuff where there's no choice like Roombas, I have a separate SSID on a VLAN that can only talk to the internet, my DNS server running Adguard, and HA (which is on the main network). I also have stateful rules that allow connections to be initiated from the main network to the IOT network, but not vice versa. I als…

How do you setup a separate VLAN and SSID? None of the "pro-sumer" wifi mesh setups under $500 support VLANs

I use Unifi for wifi gear, which supports it out of the box.

https://www.ui.com/unifi/unifi-ap-ac-pro/ for the wired AP, https://store.ui.com/products/uap-beaconhd for the extension into the back of the house. Pricy, but not completely outrageous IMO.

For an actual router, I run OPNsense in a VM (on the same box as HA, funnily enough). My server has dual 10 gig ports, so I pass through one of them to OPNsense and run it as a "router on a stick", where the basic internal network is the untagged VLAN, and the public side is VLAN 99. My switch then strips the VLAN 99 tag from the packet before sending it to the cable modem, and vice-versa. My switch is https://mikrotik.com/product/crs328_24p_4s_rm, which was $379 in 2018. However, you can get similar functionality from MUCH cheaper microtik or unifi/ubiquity switches if you don't need 10 gig support.

If you're starting from scratch I might get something like https://store.ui.com/collections/unifi-network-unifi-os-cons..., and an el cheapo dumb switch, as long as it'd pass through vlan tagged traffic. You want anything that's crossing a vlan boundary to end up on the router anyway, so you can apply firewall rules to it.

Re: Run Your Home on a Raspberry Pi

#166

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…

Not to mention that, with the help of appdaemon[0], you can write Python code to implement all the logic you can dream of.

I found this much more powerful than the base GUI, and much more expressive (and less clunky) than Nodered or the yaml automations.

[0]: https://appdaemon.readthedocs.io/en/latest/

Re: Run Your Home on a Raspberry Pi

#167
post #138

Earlier quoted context omitted.

I gave up on it solely because of the GUI. It's confusing as heck and very far from Apple's Home app, which is the preferred UX of the CFO (Chief Family Officer), even for fairly complex automations. So I just used homebridge for everything, with a smattering of Node-RED for (very few) device shims (it is _very_ easy to do MQTT handling with it). Also, I now have zero YAML to maintain, which is also a boon. Kudos, th…

For folks here I strongly recommend installing the appdaemon integration and just writing python scripts. The downside is there is a good bit of learning curve and time investment just to get the hello world going (turn on a light at sunset?). Once you are there, you can write shared libraries, abstract away whatever you want, have legit tests, and just do anything you would normally want in your coding environment (…

Fully agree.

Interested about the tests though. I’m not a professional python developer but would love automated tests for my appdaemon code. How did you set it up, and how do you run the tests?

Re: Run Your Home on a Raspberry Pi

#168
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…

I ran 20 pi's at work for years and had one failure. I've run my irrigation system off a pi for 4 years without a problem. I may be the anomaly and I don't live in Death Valley.

When you have an image that you're happy with, back it up. Using a USBSD card reader on a linux machine, run gparted to slim the image down to the minimum, then run something like this

    sudo dd if=/dev/sda of=my-pi-v1.img bs=1M count=7000 status=progress

Where `/dev/sda` is the sd card and `7000 `is the number of MB the pi disk takes after you gparted it down to the minimum size.

Next, flash the image on a new disk and make sure it works with the pi.

Re: Run Your Home on a Raspberry Pi

#169
post #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…

I agree with all of your recommendations. I use Home Assistant running in a VM on a normal machine as a sensor fusion platform and for dashboards. Every non-trivial thing is then an AppDaemon[1] app running in a separate VM on the same machine. I have zwave devices rather than zignee so I use zwavejs2mqtt on raspberry pi's in various locations around the house (soon to be replaced with tiny Atom machines).

Re: Run Your Home on a Raspberry Pi

#170

Am I the only one who still has yet to understand the value proposition of a smart home [outside wifi + sonos]? The trade off isn't a clear win to me for me to automate everything else. If it was I would try a raspberry pi set up.

I concur. I take a Battlestar Galactica inspired approach to appliances in my house. It's fine if they have computers in them, I just don't want them to be able to communicate.
Post reply on HN