By the looks of it only the template number
supports restore_value
and all other number platforms don’t (at this point). Probably that’s the reason why the documentation is found directly in the Template Number docs and not in Number component docs (because it’s not “universal” for that component).
I want to build it today, but I didnt understand how to connect the wires to esp32, I have resistors
I just need pic or something to show me how to wire
thank you
Could anyone help me in setting up a second strip for my partners side of the bed?
We have a superking bed and the bed sensor is working fantastic but what it’s highlighted is that I sleep on the same place and she moves around lol. It’s perfect when she’s on the right spot but not so good when she moves.
My plan is to add a third FSR but ideally I would create 2 ADC sensors and name then XXX1 and XXX2 but I would only want them to change the binary sensor if one or the other is lower than the threshold.
So basically
- platform: template
name: “XXX Bed Occupied”
id: “XXX_bed_occupied”
lambda: |-
if (id(XXX1_bed_sensor).state < id(XXX_trigger_level).state) {
OR XXX2 < Trigger State
return true;
} else {
return false;
}
I know how to setup the 2 sensors but I’m struggling with coding the OR. Ideally I’ll end up with a single binary sensor that can be switched by 2 FSR’s
Thank you all
Does somebody has a link on Aliexpress for buying these resistors ?
Thanks !
No, I mean the resistors (R1)
Buy them locally.
You can probably find a box full of all values fairly cheap.
We don’t have such a store nearby…
Anyway, I already have to order stuff at Aliexpress so.
A box with different values would indeed be great, but I’m a novice so I really don’t know what I should order…and that’s why I asked.
For a start these assorted kits are always useful.
Like some resistors:
https://www.aliexpress.com/item/32505894332.html
Some capacitors:
https://www.aliexpress.com/item/32954751214.html
Some diodes:
Hi r1 Value is described. What about r2? What would it be?
R2 is the FSR, the resistor that varies with weight.
ahahah ! doh!
Thanks
I just added a second sensor and ran into the problem with the FSR out of bed resistance over 20Mohm (as high as my meter goes) and in bed resistance in the 2k range. So I used a 100k resistor for the voltage divider. It works great. I get 3vdc out of bed and around .2vdc in bed.
But it leads to a question…
since a 100k resistor works so well and gives a very distinct in bed vs out of bed signal what is the benefit of calculating the resistor values to give a more precise range of voltage detection? I can’t think of any reason in this situation that just requires a “go/no go” test.
If you are lucky enough to have an out of bed resistance that high and in be that low, then it is less important to do the calculation.
However if for example your mattress is super heavy and partially activates the FSR it is more important to use the calculation to get the widest possible voltage swing.
Yeah, I didn’t think about the other direction.
That makes sense.
Thanks
how can I calibrate the sensor?
the value was 3.30 and go down slowly , not the value its 3.05 , how I can to calibrate it again to 3.30?
There is no calibration. The sensor is either on or off depending on your trigger level.
There is going to be some drift.
Just make sure that there is a big enough difference between in bed and out, and set your trigger level to a reasonable level.
Hi, thanks for this amazing idea! I have implemented this to replace my 4 point weight sensor, as that was unreliable at best. I have used 6 SF15-600 10kg resistors for my king size bed, as they where cheaper in Europe. I secured the sensor on 3 long thin pieces of wood, as this would make moving them to another bed easier. 4 of these pressure sensors are connected toone ESP32, and 2 on another, as the second ADC of the ESP32 was in use by the WIFI module, and could not be used by ESP home. One of the ESP32’s is connected with the micro-USB, and powers the second ESP32. the sensors are all combined with 1MOhm resistors, and in my testing that proved to be the most accurate (the calculation provided in the post was not of use for my sensors). after playing around i found that 2V1 was the best setpoint for my setup. the result is the following: