Fix false manual override detection and brightness threshold guard in Motion Light

- Add configurable grace period (default 10s) to prevent false manual
  override detection from delayed device state reports (e.g., Zigbee)
- Fix any_device_on guard to respect brightness_threshold so lights
  below the threshold don't block the automation from triggering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 21:28:16 +03:00
parent 29b1044d63
commit e98df855d9
3 changed files with 48 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ This blueprint creates a smart motion-activated light control system. It handles
- Day/Night mode (different light settings based on time)
- Scene support (activate scenes instead of light parameters)
- Dim before off (visual warning before turning off)
- Manual override detection (stops automation if user changes light)
- Manual override detection (stops automation if user changes light) with configurable grace period
- Brightness threshold (only trigger if light is dim)
- Custom light parameters (brightness, color, etc.)
- Callback actions for enable/disable/manual events
@@ -37,7 +37,8 @@ The automation tracks these states via persistent storage:
## Behavior Notes
- Will NOT turn on light if it's already ON (prevents hijacking user control)
- If user changes light while automation is active, enters MANUAL mode
- If user changes light while automation is active, enters MANUAL mode (after grace period)
- Grace period prevents false manual overrides from delayed device state reports (e.g., Zigbee)
- MANUAL mode exits when light is turned OFF (by any means)
- Timeout delay only applies when turning OFF (motion cleared)
- Time conditions support overnight windows (e.g., 22:00 to 06:00)