Bed occupancy sensor, using parts you have

@tom_l’s strain gauge system was for a slatted bed. Bed occupancy sensor, using parts you have - #8 by tom_l

put a piece of thin wood (like mdf) and put the pressure pad on top?

I have a similar setup for the SIDS monitor in our infants cot as its slatted base.

One of our beds is actually also slated, I just put the pressure pad on the slats. Probably wouldn’t recommend it though since the results are far less reliable than the flat-surfaced bed. However, it does still work…

Put a rug over the slats

Is it possible to reduce the polling of the sensor? I think my mosquitto mqtt broker is getting flooded and cant handle all the incoming messages.

Log Details (ERROR)

Logger: homeassistant.components.websocket_api.http.connection.1760921232
Source: components/websocket_api/http.py:141
Integration: Home Asssitant WebSocket API (documentation, issues)
First occurred: 1:02:11 AM (1 occurrences)
Last logged: 1:02:11 AM

Client unable to keep up with pending messages. Stayed over 512 for 5 seconds

I don’t think that’s an MQTT issue.

But yes, you can technically change the polling time by setting a delayed on and delayed off.

1 Like

Don’t forget that the slats provide ventilation to the matress, don’t cover more than you need.

:+1:

I use a couple of these and they work well (for the sids monitor)

1 Like

@N-l1 Thank you for this awesome share, works great, been looking for something like this for a long, long time.

1 Like

Great write-up, thank you.

Is there a way to get the setup values in Home Assistant? I have a sensor that needs to be deployed in a second house where there is no way to change the threshold value. I can write a process to change the thresholds but need a way to see the values first.

Thanks @cyn

No. Unfortunately, I don’t think there is a way to see the values in HA. But if you can access HA, the ingress feature of ESPHome should give you access as well. You can also try setting a threshold (normally between 2-8) and test if the bed triggers.

Actually there is. See:

Correct me if I’m wrong @tom_l , but I just don’t see how that “gets the setup values in HA” :thinking:

There’s an input number in home assistant. You set it to the threshold value you want. The esp reads that value and uses it to compare to the incoming values from the bed sensors.

You don’t need to see the values. You can sit on the bed and adjust the input number until you get a change in output.

Yes, and that’s exactly what I meant here

Very nice way of testing the values though would definitely use it in future sensors :grinning:

I am looking to build this using some laminate flooring underpad i have lying around to see what range i can get. I also considered using a yoga mat between the conductive surfaces. Will see how it goes.

1 Like

Interested to see your results…

@N-l1 & @tom_l thank you for the discussion I tried that yesterday and got message: On the ESP32 pins GPIO32 through GPIO39 can be used. Which is why I reached out.

Unfortunately I have already soldered my board together and waiting on more from China.
My numbers usually run around 90 range when off & 50 when on, because I have a sheet of bubble wrap in between layers.

Going to read up on the ingress feature, that’s something I’m not familiar with.

1 Like

[ How to limit MQTT pings ]

Team

the n-I1 script currently sends a lot of MQTT pings per second , is there a way to change the script to send MQTT only when status change?

Hum, I don’t use MQTT but I am pretty sure it only sends a message when there is a state change. Check also here.