Useful Sensor: Motion Last Seen & Meta Motion Sensor

You know what’s great about motion sensors? They are very, very cheap to build yourself. All it takes is an esp8266 module like the Wemos D1 Mini, some PIR sensors, and the ESP Easy firmware and you can have a bunch up and running in a few minutes. I┬áhaven’t DIYed a battery powered one yet, but there are plenty of great Z-Wave ones available.

Once you have a couple of motion sensors in your smart home, you can have Home Assistant track the last place it saw motion. This is a useful bit of info – useful as a condition for your automations, or as an input for a bayesian binary sensor. See below for YAML to create a meta-motion sensor with a history.

Continue reading →

Presence Detection Part 1: Home Assistant & Bayesian Probability

One of the most useful things to track for home automation is whether anyone is home or not. If you want the lights to turn off when no one is home, the vacuum robot to run when you’re at work, or the heat to come on before you arrive home on a cold night you need to reliably be able to tell if the house is occupied.

How can we track the state of something that is not directly observable? We can’t plug ourselves directly into the internet (…yet). After trying several approaches to monitoring presence, I’ve come up with a method that is very near 100% reliable.

Continue reading →