šŸŖ‘ DIY Zigbee bed/chair occupancy sensor

@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.

1 Like

@ferbulous @NoedelVreter

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.

2 Likes

Thank you for checking. ESP32 it is.

1 Like

Got this working today, nice and easy, and works great so far. Thanks for posting

1 Like

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 :heart:)

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
1 Like

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ā€¦ :smiley:
Great solution! Gonna do it!

1 Like

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

2 Likes

Good to know it works with the new version :slight_smile:

Just made this today, works perfectly from what testing I have done so far, and it works perfectly fine under our mattress cover.

1 Like

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?

1 Like

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.

1 Like