Does Your Home Assistant Know When You Are Sleeping?

It always gives us a sense of wonder when we realize that what would be a simple task for a human child is a big deal for a computer. For example, if you asked someone if you or someone else was in bed, that’s a pretty simple thing to check. For you, that is. For a computer, it requires some sort of sensor. [Lewis] used load cells to tell if someone is in a particular bed or not. He uses Home Assistant and has a great post about how he created and interfaced the sensors. Of course, the sensors really only tell you if something heavy is in the bed. It doesn’t know who it is or even that it isn’t an overstuffed suitcase.

Load cells aren’t exactly high tech. There are several different types that use hydraulic pressure or pneumatics to measure force. However, the most common that we encounter use strain gauges. A strain gauge is a resistor that changes value when it deformed and a load cell usually has several strain gauges wired in a bridge configuration so that small forces create larger output changes.

Although a bridge circuit is good for sensitivity, it can be a challenge to measure. [Lewis] used a breakout board with an HX711 amplifier and converter made especially for this purpose. With calibration, the load cells can measure weight accurately, but they are subject to some drift. We suppose if the people usually in your bed have very different weights, you might be able to identify who exactly is in the bed.

The software was simple since the HX711 has an Arduino library available. The hardest part might have been successfully creating a caster for the bed legs to push against the load cells. We saw a bathroom scale built in much the same way a few years ago. Of course, weight isn’t the only force you can measure with a load cell. For example, check out [sbkirby’s] bandsaw.

18 thoughts on “Does Your Home Assistant Know When You Are Sleeping?

      1. Even then, a ‘child’ requires years of growth to make sense of those sensors enough to ‘understand’. I could maybe understand the comparison if we’re talking about learning… but there’s no AI involved here… so it just seems unrelated imo.

        Since the correlation from the sensor to ‘someone is in bed’ is a pretty simple voltage comparison…. I’d say robots do this much much easier, and with far fewer senses… so I just really don’t understand the comparison.

        Circle jerk about humans being soooo amazing, maybe?

  1. I was planning on having Tasker or equivalent hook into my sleep tracker on my phone, and pushing the status to home assistant to turn off lights, and also pause my audio book reader. But alas, no time yet..

    1. I believe my smart watch knows when I’m sleeping based on my heart rate and movement. It has wifi and bluetooth and an SDK to create apps for it. It’d be a little more in-depth but totally feasible and seems like it’d be the most accurate.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.