I taught my porch lights to turn themselves off (twice)
My front porch lights run on a timer. An automation turns them off every night - and for the longest time, that mostly worked. Then one night I noticed them on when they shouldn’t have been. At 1 AM I was walking past the window and the porch was still glowing, so I turned the lights off myself and promised to look into it the next day.
Looking back at the logs, the story was clearer than I expected: at the usual cutoff the lights turned off, exactly as programmed. Then, a few seconds later, they all turned back on. And they stayed that way until I turned them off.
The culprit wasn’t the automation. Those porch fixtures sit behind dimmer modules, and my dimmer modules come out of the box with a power-on behavior set to “on.” So when the automation sends the off command, the lights dutifully turn off - and then the modules kick themselves back on. It’s designed behavior for people who flip wall switches; it’s unhelpful when a timer is doing the flipping.
I didn’t change the power-on behavior, because these fixtures are also wired to physical switches that people actually press. Instead, I taught the automation not to trust itself. Now it turns the lights off, waits a minute, and checks the porch light’s state again. If it reports “on,” the automation turns it off a second time - a self-healing loop that outperformed its own command.
It’s been a week and one night stayed dark. Sometimes the fix isn’t better hardware - it’s a second opinion.