Xiaomi Human / Body / Motion Sensor - Timeout

Good effort on the investigation syssi.

So, if my understanding is correct…

  1. The sensor itself updates the gateway every 60 seconds.
  2. Home Assistant by default will check the gateway for changes every 30 seconds.

…these 2 timers are likely not in sync and so Home Assistant will see the state change anywhere between 0 and 30 seconds after the sensor changed to no_motion (which itself may be 0-60 seconds from when there is actually no motion in front of the sensor).

So if you happen to leave the field of view of the sensor just before the sensor updates the gateway…and…if Home Assistant happens to poll the gateway just after the sensor updated it…then…you would see the state of the sensor change straight away. Other than that it could be up to 1m 30s after.

As you say, even if you reduce the SCAN_INTERVAL to 5 seconds it will still take up to 1m 5s for the state to change in Home Assistant.

So we’ve probably got pretty much the best we can get :face_with_raised_eyebrow:

1 Like