Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The UniFi Protect integration is awesome. Turn on outdoor lights on motion, disable loud doorbell ding when the dog is sleeping, change privacy zones, send critical notifications to bypass silent mode on iOS devices when a person is detected while away… really amazing stuff.

The HomeKit Controller integration is also neat. All kinds of HomeKit compatible devices can just work with Home Assistant. Honeywell Lyric is the best example: PIR sensors with local push for lighting automation or special alerts when gates open to prevent the dog from escaping the backyard.

Edit: More useful things!

I have my washer and dryer in a garage. Can’t hear the machines inside. The Z-Wave light switches around my house have status LEDs, so one LED is dedicated to the washer and dryer status based on power draw from the outlet. Works really well. The same status LEDs are shared for all light switches around the house, so it’s a good ambient notification.

The Mac app can provide webcam or mic status as a sensor, which turns on a key light when I join video calls and turns on an LED on the light switch outside my office to signal when I’m on a call.

I also get a push notification on my computer and a LED light on the light switches when the Roomba is full. It fills up a few times during its typical run while I’m working.

I also have the door status (open/closed/locked) from the Lyric as LEDs on the light switches. Very easy to tell if something is unlocked or open at a glance while walking around the house.



Bolting on to this comment with some other neat things, as a fellow HASS enthusiast:

* Every single light in my house moves from dim/orange -> bright/bluer -> very dim/orange throughout the day (basically like an whole-home f.lux or Night Shift). Sadly still third party, but it's easy to use: Circadian Lighting component will find it

* I have "night" modes in all my rooms. This is usually a single bulb in lowest-brightness full red. You can barely see it during the day, but at night it makes bathroom trips a non-blinding affair

* I have 6+ speaker zones, on Raspberry Pis mostly. Snapcast runs the audio stream, but turning on/off a room mutes the speakers in it (walking into a room turns on the lights via motion detectors and music continues to follow, which is neat)

* I pipe a lot of text-to-speech messages. Some rooms won't play them if the room is off (outer stuff like my garage), but others always do (so I hear them). This is more custom now, and I even duck the playing music stream for the TTS portion. It can take in text, so I do things like have my automation say a bunch of things every morning (my age in days, some web-scraped snippets, etc)

* $10 power sensor is enough to know when your washer is finished. Power for awhile -> running state, no power after awhile in running state -> finished. This goes right into the text to speech system

* Every room has a 10-button remote (the very, very cheap zap remote kind). Most of the layout is the same--room on, room off, start music (or skip track if playing), stop music, full-bright lights, night lights. This still leaves a few for custom-to-the-room buttons, which I use

* Contact sensors on all openings to the house. I let me cats into the backyard during the day. Cat access via any configuration is still open, and sun is below X degrees? Text to speech

* Most of my logic is Node-RED (another comment here about that), which gives me a lot of flexibility. I have a global "house" mode, which I can set to guests or party to suppress most of my assumptions that I'm home alone

* Example of one of those: My setup knows if I'm using one of my two desk computers. If I am, and house is in "home" (alone) mode, I turn off all the other rooms in the house

I could go on--I went pretty deep when I first set up Home Assistant, but that was years ago now. Every now and then I do a major update or add functionality to smooth over something that's been bugging me

Once you hit some tipping point of soooo many things available as sensors or services in HASS, adding completely new functionality is a very incremental change


I'm getting imposter syndrome from reading these two posts. Just how much time did you guys spend on this?


It’s a few hours a month here and there over several years. I started with a few smart bulbs while renting and I have evolved the system as I moved to a new home and installed more things to solve a problem. I didn’t do all of this in a weekend!

What’s nice is the Home Assistant automations tend to stay working without major overhaul far longer than stuff I used in the past, such as SmartThings which I no longer use. Always better to use your own small server and code for things like this. IOT platforms and services change way too much and it’s a lot more work to maintain than local HA.


the Home Assistant automations tend to stay working without major overhaul far longer than stuff I used in the past

This is a major selling point, and also why I haven't bought into any cloud-based home automation system (unlikely I ever could get past the surveillance aspect anyway). These systems are supposed to last as long as your home does, you don't want to replace/overhaul the system every few years because the supplier wants to earn more money from you.


I have the same answer as reid, basically!

I don't even know offhand how old my installation is, but it's been a couple of years for sure. Two things really help with longevity:

* Local-only devices. My only cloud-integrated thing is a Nest thermostat, and only because I already had it before my HASS adventures. Lights/sensors/etc is all offline, so it can't break from some company giving up on a product line

* Home Assistant itself is quite stable as software! I do keep my install up to date here and there, but not religiously. Once every year or so, a minor deprecation thing might finally drop off completely and need a quick configuration update, but very rarely. (I'm pretty deep into a "homelab" style setup too; my HASS install is a linux VM, I have a separate storage layer, etc)

So early on, it was probably a few hours of work a week, but these days I can go several months without even thinking about it or changing anything.

Quick note on audio: I use Spotify out of sheer laziness. I think they've lightened up since I did my initial setup--or just stabilized API maybe, but years ago it was common for libspotify-type client integrations to break and need an update.

So now my audio stream is routed out of the linux VM itself at the system level. Unless Spotify is willing to drop the linux client completely, they can't break my use case. And if I ever switch back to my own local file collection, I just need something that can play audio on linux to do it. I could even have a line-in wire hanging off that hardware to play any audio source broadcast to my Snapcast network too.


It's all pretty impressive until I start to imagine myself renting an apartment or house like this or being a guest in house like this. Then it fills me with dread and starts to send shivers down my spine. Every damn single activity monitored, human being like NPC in Sims game - wth,bed occupancy sensors?


I think that's a fair response! It's worth clarifying a few things. In general, I think people tend to have that reaction because there's a growing assumption that "technology" = "the cloud"--i.e. a Google or Alexa kind of smart speaker that is very clearly vacuuming all kinds of data:

- Home Assistant runs locally, in my house. None of this data is uploaded anywhere outside of my control

- I live alone. And really, the vast majority of my automation really uses/needs that assumption (computer activity turning off other rooms, etc)

- I don't have any interior-facing cameras, because yeah--even with those also purely-local, it's very odd to know they're there. Years ago, when I did leave the house every day for work, I had a living room camera to keep an eye on my cats. I completely de-powered its PoE port based on whether my automation knew I was home or not--it was only on if I was gone. There are a couple of ways to do person tracking, but I just used my phone and Home Assistant's app

- I do have a global override for a "guest" mode, mostly so lights don't inexplicably turn off. That mode turns on automatically when my girlfriend uses her keypad to unlock my door

That said, I do occasionally browse the wider HASS forums and communities. I don't have kids, but I see people use some automation pretty effectively for things like chore management/reminders. People do stuff like put cheap tablets somewhere central with status updates of who is supposed to take out the trash, reminders if any perimeter doors are open, etc


> walking into a room turns on the lights via motion detectors

Do you know if there's anything good in this space yet for detecting presence (not just entry)? There are some spots in my home where I only want the lights on while I'm there, and I haven't found anything yet that can reliably detect that somebody's actually left a space other than Hiome (https://www.hiome.com), and that doesn't work for something not delineated by a doorway.


Room occupancy is something I’ve been playing with for several years, and I’m yet to find a really good solution to it. Having said that Hass has a Bayesian filter component which can give you a probability of occupancy based on a bunch of weighted inputs, for example if a motion sensor triggered in the last minute the room is probably occupied, likewise if the TV in the living room is playing video.

I keep toying with the idea of a bunch of BLE beacons in every room and then using signal strength triangulation in a mobile app to determine which room someone is in but that falls over the moment someone leaves their phone in a room.


There's a project called "room-assistant", however you'd need to have multiple Raspberry Pis running it in various locations...

https://www.room-assistant.io/


I’ve just recently found out about ESPrensense [1], which does this, but running on ESP32 microcontrollers, so it should be much less resource intensive.

[1]: https://espresense.com/


That honestly seems like a nice feature. No more trying to call yourself when you lose your phone, it's in whichever room has the lights on.


It's a good question! I'm super curious about that myself.

I do have a bed occupancy sensor, in the form of a SparkFun OpenScale under the legs. There was a Raspberry Pi in the room for speakers already, so it's just on that.

It needs some fancy calibration to deal with temperature changes, but I just constantly tare it when my desktop computer is active (and I'm home alone I'm certainly not on the bed). That's been super responsive and great. Bed transitioning from empty->occupied when bedroom is in night mode turns off all the other rooms again.

In general, I've found that it's a lot easier to track actions than presence. So computer activity, or a door opening.

I did just flash some ESP32s with this, which is a way to report bluetooth signal for a single device across a network of listeners. They can report direct to HASS via MQTT, but it also has its own persistent python thing to more carefully triangulate. No idea if it'll work reliably or fast enough to really be useful: https://espresense.com/


If you're willing to tinker, a camera that compares the current image with a "baseline" image and says it's occupied if there's enough change. You'd have to have an IR or NIR camera to work at night, and take special care around things like doors/drawers/curtains that move.


Could a CO2 sensor do the trick?


Can you recommend one for USB or ZigBee that works with HA?


> Bolting on

My favourite is the automatic switch on for the espresso machine at 6am each day. It changed everything.


That is a good one. Many years ago, I did this with a dumb timer on the outlet.


"$10 power sensor "

Which sensor do you recommend. I am searching but some are low amps


My washer is pretty low power consumption. I forget what exactly I set the threshold to, but when I did I was watching its output history. It spends a lot of time under 100w, and only irregularly spikes higher.

It is possible to watch much higher-power systems with power clamps--the same magnetic sensor kind you can put on your entire house power feed. I have one on my 220v dryer for completeness, although I never even bothered to rig up automation. There's no real penalty for ignored dry clothes like there is for ignored wet clothes--I guess it'd be useful for people with roommates, though.

Specifics devices will depend on zigbee vs z-wave vs wifi. If I were starting totally fresh, I'd go all zigbee.


If I were starting totally fresh, I'd be paying careful attention to the smart panel setups https://www.leviton.com/en/products/residential/load-centers and what they can do, above and beyond individual outlets.


For whole home power, I use a Rainforest Automation EMU-2.

It’s connected as a USB serial device to integrate into HA. The HA forums have a custom component for it.

This can be useful for monitoring the entire home power. No load center clamps needed, it communicates with my power meter over Zigbee.


I use two TP-Link HS110 outlet plugs for power consumption monitoring for my washer and dryer.

My dryer is gas so I don’t need anything special. Would maybe check out the smart Leviton load center mentioned in this thread for new construction.


Man I'd love to live in your house for a couple of days to see what it's like.


"The Z-Wave light switches around my house have status LEDs, so one LED is dedicated to the washer and dryer status based on power draw from the outlet."

Could you elaborate on how this works? Which Z-Wave light switches measure the power draw?


Typically, there is zwave plug measuring the power draw and sending data to hub. Based on the data, an event is triggered to change an LED on a light switch. HomeSeer has zwave switches with LEDs used for dimmer feedback than can be programmed to show a color. I use the LEDs on one switch to match the state of two exterior door locks. Green/unlocked and Red/locked. I use another LED on the switch to match state of the Litter Robot, automatic cat litter box. Blinks red when full and needs to be emptied.


Yup, exactly this! I send custom documented Z-Wave commands to switch the wall switch dimmers LEDs into “status mode” and can then control each one with a custom color and blink.

I just send the same commands to all the dimmers so they all show the same thing.


Not OP, but I would guess they don't directly.

If it's possible to set those status LEDs arbitrarily, you could use another power-sensing outlet's data, so a different device entirely.

This is the magic of Home Assistant in general--it's really just a big bag of sensors (temperature/power/times/etc) and a bag of services (turn on, set to X, change color). You can have sensors from anything trigger a service on anything else.


Honest question: do you live with other people? I'd ask matthew-wegner as well but I can infer that he doesn't.


Reading between the lines here, I guess the real question is “does this stuff work when not everyone is technically inclined”.

When I first started working in home automation my boss at the time had a saying “if you have to press a button, it’s not home automation”. That single phrase is the core of making automation work with non-technical users. The house should always do the least surprising thing by default, for example turning on lights when you enter a room, but only if it’s dark. Light switches should turn the lights on and off, rather than disable the light automation (looking at you Hue).

If you can configure things to that extent, then yeah, it works beautifully. If everyone has to faff around with a mobile app to be able to see where their aiming on a 4am toilet run it’ll be hated with a passion.


The huge stumbling block I ran into when I proposed looking into home automation with my wife was that we had very different ideas of what the "right" thing to do in any given situation was. The combination of lights she wants to have on when in a room are very different from the ones I want to have on, for example. So unless there was face recognition so the room knew who was there, it would never automatically do the right thing.

Also anything that involved having to use an app to do anything was a very hard No.


Having 1 button to switch an entire room filled with many light sources between your wife's and your preference is also automation, and exactly at the right level. HA is not going to solve disagreements between people ;). In this case the alternative would be changing many lights manually, right? I mean the face recognition sounds like huge overkill and a pita to get perfect.

I have a Hue Tap, which has 4 buttons to program, we set: 1: Normal on, 2: Cosy on, 3: Cooking on (bright in the kitchen) and 4: All off. Near the couch I have an extra Hue switch to dim the couch area even more if desired. That works well for us. Atm this doesn't involve HA but it would if I had any other brands of lights and I would also want other aspects changed (like room temp, i.e. "cosy on" could also raise the thermostat by 1 degree, because it's couch time) with the same Hue Tap buttons. HA is great at having different brands of home automation stuff talk to each other, so you can pick the best of all worlds.

I just got a smart thermostat, so my "All-off" Hue Tap button may just as well set the thermostat to "eco", of course only at night because otherwise it may just mean the sun being bright enough was the reason I turned all lights off. Or, maybe when I set my thermostat to "away", HA can signal the rest of the house that the lights and the coffee machine can now be turned off, if any were still left on, I'd do that with a 10 min delay or so because I may still be running around the house to get stuff. HA is perfect for this type of logic.

Using a phone for anything is a big No for both of us as well. Home automation for us means having single buttons that do many things at once. We set timers for our garden lighting (dawn=off and sunset=on). And we use some motion sensors. In the bathroom for example, the Hue motion sensor switches the light on, and then HA turns on the fan, through a Sonoff flashed with Tasmota. At night the light also switches on but less bright, everybody loves this automation (more than the previous manual solution), and it's completely in line with Home Assistant's vision for Home Automation: [0]. It's easy to over-do Home Automation, the people you live with are good indicators for when you do so ;)

[0]: https://www.home-assistant.io/blog/2016/01/19/perfect-home-a...


I have [GE Z-Wave light switches](https://www.amazon.com/GE-Repeater-Extender-SmartThings-1429...) installed in the wall. They have the expected "press up" and "press down" which go to my "passive" and "off" room modes accordingly.

They also have "press up 2x" "press up 3x" "hold up" "hold up released", and the same for the down direction.

My GF and I use these to switch the room between modes that we want. My main modes are "passive" "gaming" "movie" "meeting" "off" and "party".

The modes are a state machine written in both node-red, using a global state variable that is saved to disk, and homeassistant using a select template variable. They stay in sync through a node-red flow, so changing the mode from either has the exact same result.


My wife prefers bright lights while I prefer them dim. My solution was to have the dim lights switch on when motion is detected and it is dark. My wife would then use the wall switch for the bright lights. This works great for the kitchen and bath.


> Light switches should turn the lights on and off, rather than disable the light automation (looking at you Hue).

Why are you looking at them? The Hue lights wired properly do exactly what you describe. You wire them in so they are constantly fed with electricity and send smart signals with a wall mounted control panel. They sell you this control panel. It looks like a switch.

Heck if you are retrofitting a building you you can use their wall switch module to adapt any traditional wall switch to become a smart switch.

They have the spunk to also work with half-assed installations. You can define in what state the bulb should be after the power is restored to them. Of course if you go this route they can't be turned on when the power to the bulb is off. What would you expect them to do? Should they pack an RTG in their bulbs to have the option to illuminate when the power is off? Should they throw a tantrum and tell you off for installing the lights wrong? Of course they don't do either of those. They just keep on trucking the best they can.


Could they remember if they were off or on? And return to that state? Could they interrogate the switch to see what state they are 'supposed' to be in when power is restored? All of those would be acceptable I think.


> Could they remember if they were off or on?

Yes. That is an option. Not a default option because when most people flick a switch ON they expect light. If by default the light would not come on, they would receive a lot of returns. But you can totally set that if option if that is your preference.

> Could they interrogate the switch to see what state they are 'supposed' to be in when power is restored?

What type of switch? The dumb one they know is on. If you have a smart switch they could. But if you have a smart switch why would you not wire the bulbs to be always powered? (always as in when the circuit breaker is ON, not literally always :) )


I live with my wife. It’s important to do smart home things which work well for everyone in your space!

I don’t do a lot of fixed unchanging automation. I do a lot more ambient status and voice assistant integration.

It actually was really nice when my lady moved in after our wedding because my HomeKit things were able to work right away with her Google Home she was used to. :)

The webcam hall status light was to know when either of us are in a meeting. We are both working from home so it’s like a free/busy signal.


Hue turns on my bathroom lights, HA then switches on the fan via a tasmota flashed Sonoff. Everybody loves that. How does this relate to your remark? I read between the lines that you are making poor automation decisions, you need to rethink those. Not HA.


So you don’t have to read between the lines, I don’t have any home automation. Doesn’t solve any problems for me, at least nothing that doesn’t create new ones.


Well it’s important that automation of any kind solves problems, if it doesn’t for you then indeed, staying away from it is the best thing to do :)


Amazing write up! Can you provide a link to the switches you use?

Also, how does HA know when the dog is asleep?


I use the HomeSeer HS-WD200+ which has programmable LEDs over Z-Wave: https://shop.homeseer.com/products/z-wave-dimmer-switch-arch...

HomeSeer is coming out with a new model soon so that model is discontinued. But the new one looks better since it doesn’t need a neutral wire!

My dog has really consistent daytime nap times. So I can disable the doorbell chime during those times to prevent the barking during a delivery. :)


> Also, how does HA know when the dog is asleep?

I have the same question! Until OP answers, I'm going to guess some accelerometer collar that reports when little motion has occurred in 3 minutes?


Haha, just a time based schedule and nothing that fancy.

But if anyone out there has made an API client for the Fi collar… let me know!


How do you disable the doorbell chime?


I have a UniFi Protect G4 Doorbell, so it’s as easy as calling the service unifiprotect.set_doorbell_chime_duration and setting the duration to 0.

I still get phone and other notifications when the button is pushed! Just no indoor bell.


Whoa! That's awesome. I didn't know that that existed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: