Figuring out who is out of bed at night?

This might be a bit out of HA range, as this is a hardware question.
I have set some nightlight when there is movement in the livingroom and in the bathroom.
We have two different night habits my wife and I, one would like a little light, the other would like complete darkness.
So I was contemplating if could detect which side of the bed a person gets out off, as we are habitual and sleep at the same side almost every night.
Then I could set a state for which person is getting out of the bed by sensing which side of the bed the person gets out of, and thus ‘pause’ the nightlight if it’s one side, and then nothing on the other side.
But what kind of sensor should I use for the build, so I can shield / split the detection to each side of the bed? I would of course also like to shield vertically, so that it doesn’t react on our small dog, or if we turn over in bed.

1 Like

There are plenty of projects in this forum and some guys have made a DIY sensor! They all look amazing. Just search for bed occupancy sensor. Have fun! :wink:

1 Like

Well, no, I forgot to mention, I can’t use a bed occupancy sensor as we have a waterbed with a single softside madras, so it will just detect that it weighs a ton :smiley:

In that case, would a mat be the thing to go?
Just use a mat on your feet on each side of the bed. You still need those weight sensors, but that would be for when you get up. That way you will know when you REALLY get off your bed. It might sounds stupid, but thats what I’ve got right now! :smile:

2 Likes

That could be an idea, and with a weight sensor I can make sure it doesn’t trigger on the dog as well.
What component did you use for the weight sensor?

I didnt, I just saw this sometime in the past when browsing on this forum and I had it in my mind when I saw your question. So, I am not the guy to ask for hardware here.
Nevertheless you can still search for bed occupancy sensor and see what others use.

1 Like

Ok :wink: Thanks for the hint!

Have a look here: https://selfhostedhome.com/diy-bed-presence-detection-home-assistant/ I am in the process of doing this… the weight should not be a problem as you can simply use different load cells…

How heavy is a waterbed?

The answer to that question will determine the kind of load-cells you’ll need (if you choose to use load-cells). If you were to put a bathroom scale under one of the average bed’s four legs (then put 1-2 people on the bed), it would probably max out the scale’s range. In other words, the load-cell will have to be rated for far more than the little ones used in a bathroom scale.

Alternatives include pressure-sensitive mats and strain-gauges. I’m partial to the idea of using strain-gauges because they can be glued to bed slats and can detect very small deflections.

1 Like

I think that the dog is a tough variable to solve for, but I would think that you would do this with 3 motion sensors. One on each side of the bed at floor level and one in the hallway outside your bedroom door. One trigger of the floor sensor followed by another trigger in the hallway within 1 min. could either trigger light or no light depending which side of the bed was triggered first.
Worst comes to worst, if the dog triggers both, then you will have some lights on, half the time for a few minutes. If the motion sensor is high enough in the hallway, it may not even see the dog.

Have a look at this project, this is using a FSR and that could in theory be placed under the bottom sheet on each side of the mattress…Bed occupancy sensor = Force sensing resistor (FSR) + Raspberry Pi Zero WH + AnalogZero pHAT

I think I sould go with this


And a wemos d1 mini.
Being new at this, I’m currently trying to figure out if the HX711 AD is giving an analoge or digital output, with the digital can use a single wemos d1 mini.

From banggood’s description:

Use four sensors to form a full-bridge measurement, measuring range for the sum of four sensors: 50kgx4 = 200kg

A quick Google search indicates the average queen-size waterbed weighs 680kg. Without occupants.

But I’m not going to place them under the bed, that would be too dangerous, as the weight needs to be distributed, I’m going to try and figure out a ‘mat’ next to the bed :slight_smile:

If you want a mat for detection then they are already sold under the category of ‘pressure-sensitive mat’. Instead of load-cells they use force-resistive materials. They’re also soft, pliable and detect pressure anywhere over the entire surface of the mat. You can place one under an existing area rug.

That would be very cool, can you give me a link on banggood or something like that?

I spent a good bit of time researching the same things: load cells, force sensitive resistors, and pressure mats. Each would not work for different reasons for my application (6 post bed frame, WAF, etc.). I finally went back to PIR motion sensors. Getting those to work came down to creative placement (under bed/furniture) and masking the sensor (using tape over the sensor to reduce the sensor angle). While a pet certainly creates issues with this solution, I wanted to throw this out as an encouragement to think outside the box.

Seems fairly simple to use a PIR motion sensor positioned on the floor on each bed side. These sensors are standard binary sensors. And available as Zwave or zigbee device. I use neo coolcam Zwave sensors

Well it would be, if it wasn’t for the dog :slight_smile: