Hey everyone, I’m trying to set up a smart lighting system in my hallway that turns on when motion is detected and stays on for a configurable amount of time. The goal is to have a visible countdown timer on my Lovelace dashboard that resets with each new motion detection.
I’ve been using Aqara/Xiaomi RTCGQ01LM motion sensors combined with TuYa IH012-RT01 in some areas. The challenge I’m facing is that the timer doesn’t restart properly when motion is detected again while the timer is still running. This leads to the light turning off even if motion is still detected, which isn’t ideal for safety.
I’ve tried a few workarounds, like using a loop to restart the timer, but it feels a bit hacky and doesn’t provide the precise countdown I’m looking for. I’d love to see a solution where the timer accurately reflects the time remaining from the last motion detection and updates the Lovelace dashboard in real-time.
Has anyone successfully implemented a similar setup? Any tips or alternative configurations would be greatly appreciated! ![]()