My entire network consists of Zigbee devices. I have several motion sensors that I use to turn on lights. These sensors also have an integrated light sensor.
I created an initial automation that simply responded to the motion sensor stimulus to turn on the lights. Later, I wanted to improve this automation by including checking the ambient light level. This way, the lights would only turn on if the light level was low. I made this upgrade because at certain times of the day the natural light was sufficient.
However, I noticed that my automation wasn’t working properly. Sometimes the light would turn on and other times it wouldn’t. I monitored it and realized that, at times, the light level recorded by the device was from when the light was still on, even after it had been off for a while.
Looking at the Zigbee message generated by the sensor, it provides all the information at once:
- Movement
- LQI (Location Quotient)
- Last Seem
- Brightness
- Etc.
But it seems that Home Assistant breaks down this information by sensor, and some are updated before others. So the automation triggered by motion detection checks for conditions where the brightness is high (even if it isn’t in the current event) and doesn’t turn on the light.
I tried to solve this by reducing the device’s brightness update time. I reduced the interval to 5 minutes. Even so, it’s possible that we might pass by the location in a shorter interval and the automation won’t work. And if I set the device to notify about the brightness every 1 minute, the battery will be consumed quickly, which wouldn’t be ideal.
Ideally, when the sensor sends all the information to Home Assistant, it should be available for real-time validation. That is, before the motion event is triggered, all sensors related to the device should be updated first.
I don’t know if there’s any way to fix this in the device settings or in Home Assistant. Has anyone seen a similar situation before?