wernerhp / ha.appdaemon.aqara_motion_sensors

An AppDaemon app to reset Xiaomi Aqara motion sensors after a given timeout.
MIT License
40 stars 5 forks source link

Resetting Aquara Motion Sensors integrated through zigbee2mqtt #3

Closed dvbit closed 3 years ago

dvbit commented 3 years ago

As per the title I have dismissed the homeassistant xiaomi platform in favour of zigbee2mqtt. Not really an issue but rather a request for improvment. I read the code and I see it is based on that component. My question / request is : would it be possible to extend the automation also to aquara through 2zmqtt ? TX

htvekov commented 3 years ago

Hi' @dvbit

Using z2m integration for hw hacked Xiaomi pir sensors, you can define occupancy_timeout in share/zigbee2mqtt/devices.yaml This resets HA sensor state after defined time period.

'0x00158d00031b0e12':
  friendly_name: Hallway
  occupancy_timeout: 8

Ciao !

dvbit commented 3 years ago

Great! Thanks

kevincaradant commented 3 years ago

Hi

Just to understand, you talk about to set the value at 8 for example but did you got some issues when you did it?

I ask this, because on the documentation of Z2M I saw this: Screenshot_20201110-024639_Chrome So that would say, if you go again between 9s and 60s after the last trigger, nothing should happens because the device is in 'paused' state?

Thank you

Regards

htvekov commented 3 years ago

Hi'

In order to lower occupancy_timeout to less than 60s, you need to do the HW hack to the sensors. AFAIR the sensor HW hack sets the 'blind' period to 5 sec.

I've done the HW on all my Aqara motion sensors and it works perfectly. After appx. one year, I've not experienced any significant battery drain, even though two of the sensors are heavily activated (100+ times on a daily basis) placed in my utility room and hallway.

Ciao !