Useful Sensor: Bayesian Sleep Detection in Home Assistant

Sleep is not something I can directly observe in my smart home (at least not until I build that DIY bed sensor). It would be nice to know though – then the alarm could be set, doors locked, thermostat set, music volume slowly dimmed, and internet bandwidth reprioritized automatically when it’s time for bed. We spend a lot of time sleeping in our homes, so it makes sense to be able to detect it.

Using Home Assistant’s Bayesian binary sensor it’s possible to guess pretty accurately when everyone’s tucked away. See below for example YAML and explanation.

Continue reading →