News for hackers. Stuff that matters.
Re:Home Assistant: Open-source home automation platform runn... by alias_neo on Thursday August 23, 2018 @12:06PM (#17828393)
I've been using Home Assistant for a couple of years now. I won't go too much into what I use it for, there's a bunch of info about that, and the guys on the Discord have entire public repos full of all their cool automations (on Github).

What I would share is that in the couple of years I've been running it, I've been through a dozen Sandisk and Samsung MicroSDs on my Pis _even though_ I was running my time-series database, and my MQTT server on a separate server.

Running on Raspberry Pi it's a nice toy, but when you get serious, install it on a proper box with an SSD/spinning rust.

I bought a NUC-like device which is what most people will recommend to run it on, installed Arch (you can use whatever you like, Debian is probably best supported) and get going.

Briefly though, I log all of the temperatures and light levels in each room of my home using Z-Wave sensors, store them in Influx and graph them in Grafana.

I have my desk lamp turn on when motion is detect at or around my desk, I have my cameras start recording when nobody is home (based on location reporting from our mobiles using Owntracks back to my self-hosted MQTT server).

I have hue lights in every light socket in the home so I can switch them to various moods based on motion, time of day, lux, whether the TV is on, the weather, the temperature, etc etc.

The Home Assistant dashboard shows my server load in my rack , temperature in my rack (via a temperature sensor connected to an ESP8266 talking MQTT back to the server), all info on my UPS, load on various power meter wall plugs (Z-Wave) which can also be controlled on/off via HA, it shows the current temperature and light level and motion in each room via Z-Wave motion sensors.

Most importantly, the community that sit on Discord are a friendly and helpful bunch so it's nice and easy to get started.

Re:Home Assistant: Open-source home automation platform runn... by hathawsh on Thursday August 23, 2018 @05:02PM (#17830689)
By contrast, I've been running Octoprint (a 3D print server) full time for over 2 years on a RPi with a 64 GB SD card and I've seen no issues with the SD card or RPi. I've been capturing camera snapshots every 15 seconds. I've only used half of the capacity of the SD card.

It's possible that my use of an extra large SD card has allowed the card to write to previously-unused memory cells rather than erase and overwrite memory cells, helping the card last longer. I wonder if anyone has studied that.

Re:Home Assistant: Open-source home automation platform runn... by rovr138 on Saturday August 25, 2018 @11:05AM (#17841053)
There might be some wear leveling logic. When writing, it would use an area that’s written to less.

SSDs have something like this. Not sure if SD cards or if it could be done on the Linux side.

Re:Home Assistant: Open-source home automation platform runn... by snapetom on Thursday August 23, 2018 @03:51PM (#17830184)
Man, so glad it isn't just me. I've had so many problems with my SD card corruption on my Pi/HA setup, it's ridiculous.
Re:Home Assistant: Open-source home automation platform runn... by ce4 on Thursday August 23, 2018 @04:24PM (#17830402)
The Pi3 can boot directly off usb, alternatively just have the boot partition config (fat filesystem) on microSD point to the real rootfs on ssd/spinning hdd.

I have a raspbian cups fileserver thats ignoring all this and keeps running for 3 years on the same cheap sd: have it set up to offload almost all writes to tmpfs to reduce wear: /tmp, /var/run, /var/tmp, /var/log, the cups spool folder and more (/var/spool/*). Noatime mount option.

Re:Home Assistant: Open-source home automation platform runn... by CBLT on Thursday August 23, 2018 @06:27PM (#17831150)
> /var/log mounted on tmpfs

I would never do this at my job, even if I ship logs. I might do this on cheap hardware at home though.

> Noatime

What makes noatime better than relatime?

Re:Home Assistant: Open-source home automation platform runn... by ce4 on Friday August 24, 2018 @12:55AM (#17832881)
It's at home, an old raspberry was used as a wifi bridge for a laser printer. I basically used only spare/scrap parts. Also: s/fileserver/printserver/ though, my bad.

> relatime

Sits somewhere between atime and noatime, where "somewhere" is tunable. I wanted the least writes, so i went with noatime.

Re:Home Assistant: Open-source home automation platform runn... by jabberlope on Thursday August 23, 2018 @07:34PM (#17831497)
I had this issue and it turned out to be fluctuations in the power source. Purchased an official RPi brick, and put the root filesystem into read-only mode and the Pi became much more resilient. (https://www.raspberrypi.org/forums/viewtopic.php?t=161416)
Re:Home Assistant: Open-source home automation platform runn... by monocasa on Thursday August 23, 2018 @04:00PM (#17830259)
Get "industrial" cards if you care about them not dying.
Re:Home Assistant: Open-source home automation platform runn... by hyperbovine on Thursday August 23, 2018 @09:31PM (#17832075)
I have almost the identical setup as you - everything is ZWave (plus ecobee, sprinklers, attic fan, and some other sensors) and goes into Influx and grafana via mqtt. All of it is running on a single RPi3. Only difference is I’m using smart things not HA. I have had zero issues whatsoever. I got sidetracked for about 4 months over the winter with other projects and assumed this setup would crash or at least need a reboot when I came back to it. Instead it just hummed right along. So there must be something about the way HA uses storage.
Re:Home Assistant: Open-source home automation platform runn... by rz2k on Thursday August 23, 2018 @01:04PM (#17828857)
Does Home Assistant let you make all IOT devices safer? For example, I imagine the business plan for products like Hue involves selling information to data brokers, but after glancing at the Hue section[1], I couldn't quickly tell whether you are still publishing information about your home environment.

[1] https://www.home-assistant.io/components/hue/

Re:Home Assistant: Open-source home automation platform runn... by flyingcircus3 on Thursday August 23, 2018 @02:32PM (#17829572)
The Hue does not rely on HA for network connectivity. The Hue hub connects to wifi, and you talk to it over the network. I don't believe HA is doing anything other than reading/writing the state of the bulbs.
Re:Home Assistant: Open-source home automation platform runn... by gerdesj on Thursday August 23, 2018 @05:48PM (#17830955)
Hue and company use Zigbee - you can ditch the hub:

https://community.home-assistant.io/t/zigbee2mqtt-getting-ri...

(I can personally vouch for Scott Darby's ability to put together a device for UK users - see comment 162. I've got one of his)

Re:Home Assistant: Open-source home automation platform runn... by OJFord on Friday August 24, 2018 @07:45AM (#17834291)
> see comment 162

Well, I learned something about HN today!

Re:Home Assistant: Open-source home automation platform runn... by ce4 on Thursday August 23, 2018 @04:32PM (#17830463)
Probably not, if they use wifi these devices can phone home or even worse - act as an insecure bridge into your network [0] or accept commands from the cloud that anyone can inject.

[0]: https://mjg59.dreamwidth.org/43486.html

Re:Home Assistant: Open-source home automation platform runn... by rovr138 on Saturday August 25, 2018 @11:14AM (#17841098)
If you’re able to talk to them via LAN they might not require internet. If so, you can block their outgoing connections.
Re:Home Assistant: Open-source home automation platform runn... by gh02t on Saturday August 25, 2018 @11:25PM (#17844064)
Hue has a local API, you can firewall them if you want and HA will still be able to talk to them over the LAN. You can also get a Zigbee dongle and control the bulbs directly if you want, Hue bulbs are Zigbee compliant.
Re:Home Assistant: Open-source home automation platform runn... by gerdesj on Thursday August 23, 2018 @05:43PM (#17830923)
Does Home Assistant let you make all IOT devices safer? Yes, for a given value of yes!

For starters, you need to ditch all those hubs and apps and that means you need to look into Z Wave and Zigbee. Briefly and in my experience and testing, Z Wave devices are more expensive but more compatible with each other. Z Wave has a longer range without any relays. Both are very well supported but I think Z Wave is better supported. Philips Hue is Zigbee as is Tradfri (Ikea). I've got both USB dongles plugged into a VMWare esxi in a VMware cluster at work and both survive vMotion and are very stable. I'm using this for Z Wave: https://www.amazon.co.uk/gp/product/B00YETCNOE/ref=oh_aui_de... (£43) and people on the forums offer to make up Zigbee USB devices with ready flashed firmware for about £20 or you can buy your own bits from Alibaba and DIY for a bit more for one but a lot less for more than say five.

You should also investigate the MQTT protocol and consider say Mosquitto and proper SSL for it for external stuff like Owntracks. Internal only access can be satisfied by using the built in MQTT broker in Home Assistant.

Also, consider ESP8266 (or ESP32) devices. You can get two for £8 on Amazon with pins etc already to slap in a small breadboard. Note that you can power them using PoE and a PoE to USB converter to get them up to 100m away. You can fit these things inside the sort of wall mount box you might have for a light switch or ethernet ports.

When I've finished testing at work (!) I'll be looking to control my underfloor heating, lights (note that you need three wires (live, neutral, switched neutral) for switch box controls or something like this: https://www.amazon.co.uk/Fibaro-FGS-213-Single-Switch-Black/... that can go in the light fitting itself. I'm in the UK BTW. Also I'll be putting in window and door open/shut detectors and a fair few of something like this: https://www.amazon.co.uk/gp/product/B0141FQDJQ/ref=oh_aui_de... to see what is going on in a room. I aim to defang my Sonos speakers eventually. The TVs already go through Squid with quite a lot of monitoring and a lot of pfSense keeping an eye on things.

ZoneMinder is well supported for cameras.

Proper home automation is not cheap but is very cool if done right. Do your research very carefully. If you have a SO, then be very, very careful and test, test, test otherwise you will be kicked into touch very quickly. I'm aiming to have manual overrides (switches etc) for nearly everything and will be putting in a lot more wifi and UPS, RAID etc along with proper backups. If you are going to do more than a toy lighting system than do it right.

I don't fear my IoT stuff because they live on VLANs with names like THINGS and SEWER (for the really scary ones) but I'm not your average home owner (IT-wise) and am extremely pissed off at the vendors of these things for the frankly cynical approach taken to security and your privacy.

Re:Home Assistant: Open-source home automation platform runn... by icebraining on Thursday August 23, 2018 @12:44PM (#17828680)
Were you logging to the card? I'm using a flash drive rather than an SD card, but I've mounted /var/log and /var/run on a tmpfs, then re-mounted / as readonly, and it's been running like this for years.
Re:Home Assistant: Open-source home automation platform runn... by monocasa on Thursday August 23, 2018 @03:58PM (#17830242)
I've had cards fail even in RO mode. Consumer cards are shit, get "industrial" cards.
Re:Home Assistant: Open-source home automation platform runn... by AdamJacobMuller on Friday August 24, 2018 @05:03PM (#17837878)
> temperatures and light levels in each room

I'm curious what kind of sensors you're using and what kind of battery life you get out of them. Every z-wave sensor I tried had abysmal battery life at any kind of reasonable update rates.

Re:Home Assistant: Open-source home automation platform runn... by abetlen on Thursday August 23, 2018 @01:58PM (#17829307)
I've heard about the problem with the RPi's constantly corrupting SD cards before. I'm curious though, did you try out any other microcomputers in the RPi's price range before upgrading to the NUCs?
Re:Home Assistant: Open-source home automation platform runn... by mv4 on Thursday August 23, 2018 @01:19PM (#17828976)
Have you tried using special "high endurance" SD cards on your Pi?
Re:Home Assistant: Open-source home automation platform runn... by monocasa on Thursday August 23, 2018 @03:55PM (#17830221)
"Industrial" is the keyword you want for the premo shit.
Re:Home Assistant: Open-source home automation platform runn... by avianlyric on Thursday August 23, 2018 @05:24PM (#17830810)
What hardware did you end up picking?

I’ve been looking to replace my RPi with something a bit beefier. Some of the components I’m running are memory heavy, and my pi is struggling to stay responsive.

Re:Home Assistant: Open-source home automation platform runn... by t0mbstone on Thursday August 23, 2018 @05:56PM (#17830994)
Honestly, raspberry pis are a joke for anything serious. They only make sense if you are extremely limited when it comes to space.

You can easily buy a mid-level desktop computer for $200 (either brand new, or off ebay/craigslist/newegg). I would recommend getting an i7 with at least 8 gigs of RAM and an SSD. As of right now, newegg has no less than i7 30 desktop pcs for sale under $200.

Slap linux on it, plug it into your power and ethernet under your desk and forget about it.

You will have a dedicated server whatever you want. Home automation, gaming servers, docker containers, whatever. Just leave it running 24/7.

If you really want to get fancy, plug it into a backup UPS for in case the power goes out.

Re:Home Assistant: Open-source home automation platform runn... by maxerickson on Friday August 24, 2018 @06:20AM (#17834007)
How many watts is that?

There's kind of a quick progression in the bill for an always on device from irrelevant to noticeable to large.

Re:Home Assistant: Open-source home automation platform runn... by joshu on Thursday August 23, 2018 @09:23PM (#17832052)
Have you looked at high write endurance cards?
Re:Home Assistant: Open-source home automation platform runn... by wjdp on Thursday August 23, 2018 @02:16PM (#17829454)
Had a SD card die in my Pi a few months back, good to know HA was the cause. Now running on a proper box.
Re:Home Assistant: Open-source home automation platform runn... by monocasa on Thursday August 23, 2018 @03:56PM (#17830229)
HA wasn't the cause, just consumer level SD cards are shit. Get an "industrial" card.
Re:Home Assistant: Open-source home automation platform runn... by wjdp on Thursday August 23, 2018 @08:44PM (#17831889)
Couldn't quite find the phrase for it. HA isn't at fault, but does cause shit SD cards — which are the norm — to fail.

I was unsure if it was a random failure or attributable to my use of the card. The parent comment cleared that up for me.

Re:Home Assistant: Open-source home automation platform runn... by monocasa on Thursday August 23, 2018 @08:51PM (#17831919)
I mean, I'm not being pedantic about root cause. Like I've seen name brand cards fail while in read only mode. It has nothing to do with HA, and everything to do with the cards.
Re:Home Assistant: Open-source home automation platform runn... by ce4 on Thursday August 23, 2018 @04:36PM (#17830494)
An (old/spare) 60gb ssd + usb sata adapter may come cheaper. Also very reliable.
Re:Home Assistant: Open-source home automation platform runn... by monocasa on Thursday August 23, 2018 @04:42PM (#17830532)
I've had USB->SATA adapters fail on me from not being powered down cleanly. : \
Re:Home Assistant: Open-source home automation platform runn... by gsich on Thursday August 23, 2018 @04:56PM (#17830646)
Network boot is possible.