This can be simplified a bit…
- platform: template
name: "Bed Occupied"
id: mb_o
lambda: return id(bed_sensor).state < id(trigger_level).state;
This can be simplified a bit…
- platform: template
name: "Bed Occupied"
id: mb_o
lambda: return id(bed_sensor).state < id(trigger_level).state;
Thank you, yes that’s the info I was after. The connection setup, not the yaml
I’ll be getting these to play around with.
Here’s the wiring that gpt spat out. Please confirm if it’s accurate?
Connections Overview:
I don’t know what these are would I need anything additional to the potentiometer?
to manage two sensors with ESP32 you would need two 3v3 pins as well as two ADC pins.
I tested one sensor affects the other. The connection made is as in the photo
That is not true unless you have a cheap Chinese ESP board built with under rated components (quite common). Or you wired it incorrectly.
Where is the best position for the FSR sensor?
I currently have it like this:
But it doesn’t constantly detect me during the night:
The resistor is correct, but I have multiple positions to detect (I’m often sitting on the bed so the weight is distributed differently) and have to balance between one being detected and the other one being detected…
If you move around a lot (like to the other side of the bed) you may need more than one sensor.
Show the sensor voltage and trigger level for the night. That may reveal an issue you can solve by changing the trigger level.
You are either in the bed or not. Detecting lying or sitting is not a function this sensor was designed to differentiate. It may be possible with more than one sensor and careful trigger level adjustment, or it may not.
My trigger level is 2.9V, my voltage levels are in this file.
Unfortunately, I placed the sensor wrong this night, so the values are wildly inaccurate.
I will try to get better data this night and then post that…
When you do, just drag and drop a screen-shot into your post. I can’t access google drive from here.
I can see your esp having double 3v3?
If you look back in this topic you will see there are plenty of people who run 2 sensors without issue.
Your two sensors should be wired like this (one resistor per FSR):
Not like this (shared resistor):
Ok, so I wasn’t home last night but at least the sensor did reliably detect non-occupany which also wasn’t the case previously.
I will send the data tomorrow and hope that it will work…
These are the values of the FSR (“Rohwert”), the state of the bed sensor (“Bettbelegung”) and the state of my room light (“Aaron”, I always turn it on when I leave bed and leave it on until I return to bed, so this is my reference.
I did only leave the bed (as seen in the state of the light) once from 2:40 to 2:43, however the sensor didn’t detect occupancy until 3:15, which is over half and hour…
My goal is to use the FSR to supplement the already-installed LD2410C mmWave sensors (for daytime presence detection) as they don’t reliably detect a sleeping person.
For that goal, a continuous (100% accurate) detection is required as each interruption of the detection will turn on the lights thus waking me up (the lights are dimmed to 5%, but I already wake up at 1% for 2 minutes as I tested earlier).
My HA instance has been my main hobby for the past 4 years, and I think I finally found the solution to my biggest challenge, which is a presence-based fully automated lighting system for my room.
Your sensor has too much noise.
What could I do to resolve that?
I have increased the window_size of my sliding_window_moving_average filter from 5 to 25, let’s see if that helps…
That will slow your response time considerably. Try another power supply. See: FSR - the best bed occupancy sensor - #469 by aqwserf
I’m powering the ESP (a M5StickCplus) from the USB port of a RaspberryPi 4, I have a Samsung USB charger I’ll try to use that…
Interesting! I’m actually using a shared resistor with 3 FSR for my kid (only one person, the bed is quite big but not the kid: top, middle, bottom of the bed) and it’s working like a charm.
What is the drawback/caveats/issues with this configuration?
Thanks!
I finally replaced the door sensor-based bed sensor with another fully custom Zigbee model. This one is an older avr Arduino tied to an xbee. The other one was working well, just wanted to add some features. This design has a built-in light controller, DHT22 for temp and humidity as well as a FSR for each one. Instead of using HA for automating presence, that’s controlled using the analog output endpoints to set a threshold voltage. It’s been running for around a week, and I’m pleased with it.
Somehow, I failed to get a pic of the circuit, but it’s a standard self-etched pcb with n channel MOSFETs for the RGBW light control.
Interference between sensors.
THis might be interesting for those not wanting to solder. Looks like Interlink makes a model that has female connectors with a housing (model 34-23845). Has anyone purchased this model?
You can find it on Digikey as well.
Edit: For the record, I haven’t purchased this and cannot 100% guarantee this will work without soldering. It reads like that, but I was hoping to confirm.