@parrel Any luck with your project? I have a chair sensor now and would love to use the same technique for a bed sensor.
Hi! I have one lying around but did not yet connect it to an Aqara sensor. But Iām pretty sure it works! Soon I will have time to connect it.
I tried it with the bed sensor I ordered from Aliexpress. However itās too sensitive for the Aqara sensor. That causes it to open/close very often sometimes which causes the wrong last state being reported.
A better solution would be an ESP8266 or ESP32.
Thank you for checking. ESP32 it is.
Got this working today, nice and easy, and works great so far. Thanks for posting
Has someone tried it with a ESP32 or 8266 instead of the Aqara sensor and can share what the wiring looks like?
Not tested but it should work like this (using ESPHome )
Connect the black wire to a G (Ground) on the board, and the red wire to one of the GPIO pins, I used D2)
Then add this in ESPHome.
binary_sensor:
- platform: gpio
pin:
number: D2 # Change this to the GPIO pin you are going to use
mode: INPUT_PULLUP
inverted: True # You might need to set this to False
name: "Chair"
device_class: occupancy
filters:
- delayed_on: 10ms
Thanks! I will give it a shot.
Great DIY, it works perfect, tnx!
Only by default the contact status is inverted as preferred.
With this addition to configuration.yaml you can create a new sensor which show the correct status in your lovelace dashboard.
binary_sensor:
- platform: template
sensors:
chair:
friendly_name: "chair"
value_template: >-
{% if is_state('binary_sensor.contact1_contact', 'off') %}
on
{% else %}
off
{% endif %}
homeassistant:
customize:
binary_sensor.chair:
icon: mdi:chair-rolling
Dude, I have the same problem!! Motion sensor that turns on the ligths on my officeā¦but have an automation to turn off the lights after 15 min if no motion is detected. Plenty of times going in the dark and move to turn on againā¦
Great solution! Gonna do it!
Iām not sure if I posted this here (or anywhere) but I use an Alexa actionable notification to ask me first if the light should be turned off after no motion. If I say āyesā or donāt respond the light gets turned off. If I say no the light turn off timer gets reset just as it would if the motion detector resets it.
and if itās at night and I donāt want the voice notification I flash the light and if I donāt push a reset button I have on the desk the light turns off.
code upon request
After my first successful chair sensor I created 3 new ones. None of them worksā¦
The resistance is the same as the working one (11 Ohm when you sit on the sensor).
The only difference is the zigbee contact sensor: the working one is model lumi.sensor_magnet.aq2 vs the new lumi.magnet.acn001 (comes in a smaller box)
Anyone the same experience?
UPDATE: it works!
There are problems with this contact sensor. The data was not picked up in zigbee2mqtt.
I had to flash my zigbee stick to a specific version. See for more info Xiaomi MCCGQ14LM control via MQTT | Zigbee2MQTT
Good to know it works with the new version
Just made this today, works perfectly from what testing I have done so far, and it works perfectly fine under our mattress cover.
Thatās nice to hear! Thanks for letting us know.
Sorry to bump an old thread!
I have followed this DIY instruction and it works, thank you very much!
However, it only works perfectly in the beginning, after few weeks of constantly using, it keep status closed like forever.
I practically sit on my chair like whole day (itās my home office chair) and only want to use sensor to turn on/off my fan. After some time, the sensor refuse to bounce back to open state when Iām not sitting.
I think itās problem with low quality sensor, it should be same for any standard car seat sensor but theyāre working just fine no matter how long we sit on it.
Is anyone having same issue? How do you manage it?
bump again, anyone?
Hi, I think that could indeed be the car seat sensor yes, maybe you can hook it up to a multimeter and see if electricity goes through it if you do not sit on it
I donāt know of a better seat sensor at the moment, but there are also some DiY solutions here on the forums, or more advanced onces that use an esp8266 instead of a Aqara sensor
You could try #13 here.
You probably wouldnāt need any new hardware.
I just made one of these and placed it between my mattress and foam topper and it works.