Xiaomi Human / Body / Motion Sensor - Timeout

Its always 2min no matter if you are using Zigbee2Mqtt ( or other 3rd party software ) or Xiaomi gateway. To bypass it you must do the hardware modification.

my pir is modified. but it always takes 2 minutes

Isn’t it just depending on the PIR design itself? Not your gateway or HA? When using a Xiaomi Aqara zigbee (2019) sensor it just reports back after 2 minutes. But when i’m using the Xiaomi Mijia zigbee (2018) sensor, it update with 1 minute. No matter what changes in the hardware configuration. Both HA, and a zigbee are using exactly the same technics for both of the sensors.

For me the 2 minutes is always my default. It happens quite a lot that i return to an area within one or two minutes. It’s annoying if its turning on again. I didn’t even notice this before, untill i saw all the forum threats on this.

When you hardwaremod the sensor it detects motion in very short intervals. Right now when you move (i think the original interval is every one minute), you extend the occupancy time, so the sensor stays on.
The main problem is that only when there is no movement for exactly 2 minutes the sensor sends a occupancy off.

To solve this you need a hardware mod to decrease the detection time from a minute to a few seconds.
The second thing that needs to be done is a software override via e.g zigbee2mqtt that after e.g 30 seconds zigbee2mqtt (and NOT the sensor) sends occupancy off so that homeassistant thinks the sensor sent the motion off signal (which originally would come after 2 minutes)

Only this way a homeassistant automation for a shorter timespan than every two minutes for re-triggering a light will work.

This behavior is very annoying and with deconz even with the hardware mod I have no way to send the faster retriggering signal because deconz has its interval hardcoded where it sends updates for the sensor to homeassistant.

Maybe a little offtopic but how stable is zha at the moment, in terms of network stability?
I’m thinking about switching to it if i can override the sensor behavior there

Quick note that I’ve successfully modded these both with pencil and conductive ink, conductive ink my preferred option now and done on 6 or so sensors, applied with a toothpick.

P.s. also had to change the timeout in zigbee2mqtt.

I’d like to mod my sensors, but have them linked with zha component. Does anybody know if it’s possible to change the timeout in zha and how to do it?

Hi,

Did someone try this out already ?


Aqara motion sensor can be easily hacked to report motion every 5s instead of 60s which makes it much more usable…

I have some time today, I will check this out and let you guys know

I followed soldering guide for pins T4 with a transistor, as @syssi mentioned, but nothing happened. I could connect it throughg deconz but when I move around it it not detects anything.

Hi all,

i use hassio version 0.102.3 and want to use “Xiaomi motion sensor hack”:

Currently, if a i connect the 2 points (described in the link), the motion sensor sends always “occupancy=true”, it goes never back to false.

Must i set this state manually or is there any other solutions?
Or what is the best way to achieve it, that the motion sensor detects motion every 10 seconds?

Or works this solution furthermore?

  1. Modded one (two others are not modded, connected to the same gateway) of my aqua sensors (I can see in the Xiaomi Home app that the mod worked)
  2. created a folder ‘custom_components’ in ‘config’ folder
  3. created a folder ‘xiaomi_aqara’ in ‘custom_components’ folder
  4. uploaded binary_sensory.py and init .py from ‘https://github.com/syssi/home-assistant/tree/feature/xiaomi-aqara-modded-motion-sensor/homeassistant/components/xiaomi_aqara ’ to ‘xiaomi_aqara’ folder
  5. restarted home assistant

thank you for your help

luetter

1 Like

Try resetting the sensor state after a certain amount of time based on your needs.
I have some modded Aqara motion sensors and I reset the sensor state after 5 seconds through an automation. It works just fine.

How do you reset the sensor state? Mind sharing your automation please?

- id: '1578279316231'
  alias: Reset Sensor state
  description: ''
  trigger:
  - entity_id: binary_sensor.stairs
    for: 00:00:05
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data_template:
      entity_id: binary_sensor.stairs
      state: 'off'
    service: python_script.set_state

The Set State script can be found here
https://github.com/rodpayne/home-assistant/blob/77293b434ca30acff1b43d6ec81374061950e34b/.homeassistant/python_scripts/set_state.py

8 Likes

So Home Assistant thinks that it was only on for 5 sec.
Thanks!
This fixes half the issues.
But does the sensor trigger again in less than 3min? (or what’s it’s default value?)

1 Like

No, unless you do the hardware mod to the sensors, which you can find here on the forum and requires literally 1 minute per sensor. Then you’re able to trigger the sensor as many times as you wish.

1 Like

Hey critical2104,

I just got my first four Aqara Sensors in the mail and immediately modded one of them (the option of doing so was the main reason i got them), added it to Raspbee/Phoscon in HA and only then realized that the hardware-mod alone dose not make HA recognise the 5sec reset. So i went online and found your Post. I’m very new to HA and still struggle with the coding part of it. Could you maybe take me through the steps on how exactly to make this work? Where and how do i place that automation-script and where the Python-Script ? It seems one has to create an automation for each sensor? Is there any way of having all registered sensors resetting after 5sec? (I plan on adding quite a few more, all of them modded)

Thank you in advance!

Hey, if you’re using deConz you can use the following automation (put this in your automations.yaml file) to make the sensor states reset after 5 seconds. This uses a service deconz exposes to HA so it’s much simpler. You can copy the service part for as many sensors as you have.

- alias: 'Xiaomi Aqara Motion Sensors duration fix'
  trigger:
    - platform: homeassistant
      event: start
  action:
    - service: deconz.configure
      data:
        entity: binary_sensor.motion_sensor_name
        field: "/config"
        data: {"duration": 5}
33 Likes

This. Just. Works. The knowledge of this forum never seizes to amaze me! You are the King, marcelod!

1 Like

there are any update to use the modding with the gateway xiaomi?

actually, i use the mod with the zigbee2mqtt

@Aiace88 do you use the decent.configure with zigbee2mqtt?

i use a old configuration of zigbee2mqtt but it’s work.

i request is possibile use the modding without the zigbee2mqtt, use only the gateway.