@tom_l This works spectacularly well, thanks for this. I use it to activate low level lighting if up in the night, to open blinds when both up in the morning and turn on the coffee etc.
In a pinch, you could probably tape the wires to the connectors with some electrical tape.
Not as solid, but the connection should be fine if you don’t bend it.
As for the programming part, this helped me a lot: This is SO Much Better! Getting Started with ESPHome 2021 - YouTube
I was up and running in 30 minutes or so.
It really is not that difficult, albeit the lingo makes is daunting in the beginning.
What do you think about just connecting these force strips to a zigbee xiaomi door sensor, so it will trigger “closed” when someone in bed, just be closing the circuit. I won’t get all the force data, but all I need is on/off sensor eventually
I’m not sure. The zigbee sensor uses a reed sensor with a very low resistance when on (basically a switch). Where as the FSR can measure anywhere between 10s of Ohms to 100s of Ohms when compressed, depending on your weight and the thickness of the mattress.
You’d have to try it to know for sure. Or at least experiment with some resistors and the Zigbee sensor to see what maximum resistance still allows for effective detection.
I tried with something similar, but with a slightly different product, with this sensor:
The zigbee sensor worked well, but the sensor wasn’t so reliable. sometimes it kept showing ‘on’ after I left bed, and sometimes it showed ‘on’ only from the mattress weight, sometimes didn’t show ‘on’ even with me on it. It worked as an idea but didn’t give constant results.
I wonder if the other sensor will behave differently
I suspect it will behave the same way. The resistance will not be high enough to register as “off”.
Just a quick question or two…
Are you still using this?
What resistor did you use from 3.3v to A0? Sorry if you posted it and I just missed it …
I am also using the ‘mat’ but it’s not working correctly. I have to jump on the bed to get a reading now since I purchased a new bed… ugh
Thank you!
Yes. Still working perfectly.
What I used will not help you. Read the 1st post again. It details how to calculate the resistor you require for your situation.
Truly awesome!! Thank you. I’ll be ordering my parts in 3…2…
Thanks again!
i use the fsr strip i found in your post and connected it to the smart implant from fibaro.
I put the sensor between the two matrasses, and it is working very well and quite easy to setup.
But what i found is that the implant only updates the value every 30 sec, is your setup more sensitive to changes, when you get in bed does it directly detect your pressence?
Yep. My ESP based sensor uses this filter on the sensor:
update_interval: 0.5s
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 1
- or:
- throttle: 180s
- delta: 0.02
Essentially it sends an average voltage for the last 5 seconds every 3 minutes unless there is a change larger than the noise level, in which case it sends a value immediately. In practice, because of the time the moving average takes to change above the trigger level, this means my automations respond within a second, or two at the most.
Thanks for the great tutorial ! I’ve managed to build a two sensors module.
Could you please share your automation yaml that you’re using with your sensor ? Thanks !
No. It’s pretty specific to my house.
I totally understand.
What would you suggest to structure the automation ? Trigger with the bed sensor ‘on’ / ‘off’ for a duration ? Trigger at a time ? Conditions with the time ?
The trigger is easy, in bed:
trigger:
platform: state
entity_id: binary_sensor.master_bed_occupied
from: 'off'
to: 'on'
Out of bed:
trigger:
platform: state
entity_id: binary_sensor.master_bed_occupied
from: 'on'
to: 'off'
Thanks. I was also wondering, do you use a duration and time condition if you would like to disarm your alarm when you wake up in the morning for example ?
There’s a whole complex set of choose actions.
I see, thanks ! I chose the same path, with - choose:
and - conditions:
, I’m still scratching my head for some cases
Little off topic, but where did you get that enclosure? I really want something like that and looks really cool!