Closed juacas closed 5 months ago
That is weird. I know that bug exists because I've felt it but was never able to trace it.
The code that is supposed to prevent what you're saying from happening is https://github.com/jseidl/hass-magic_areas/blob/main/custom_components/magic_areas/binary_sensor.py#L406 which does the "Area is on timeout" message but does not refresh it.
I still can't find the bug but I'm chasing it.
OK I think I've found the bug.
The issue is that the last sensor to go off updates the last_off_time
thus keeping the area indefinitely on cooldown. See https://github.com/jseidl/hass-magic_areas/blob/main/custom_components/magic_areas/base/entities.py#L135-L136
I've added a check to see if is a state transition or a state report https://github.com/jseidl/hass-magic_areas/blob/enhancement/merge-integration-blueprint/custom_components/magic_areas/base/entities.py#L134-L136
You can manually add those lines to your current entities.py
and shall solve this problem while I finish working on this next release.
Fixed by #326
Describe the bug
When a presence sensor sends a sequence of "off" states faster than the "timeout" of the MagisArea the timeout never occurs. Aparently, there is a wrong transition from state "clear" to state "clear" that resets the timeout.
To Reproduce Steps to reproduce the behavior:
Expected behavior
An event that doen't change state should not fire the state change nor timeout reset.
Additional context
Version: MagicAreas 3.0.2, HA2024.2.0
Logs: