I have a Tasmota relay (Sonoff Basic) that is controlled using Home Assistant / MQTT. Whenever it receives a POWER OFF command, I want it to first publish a command (to power down another device), then wait for x seconds, and then actually power off.
I tried using rules for this (see rule below), but using ‘Power1#State’ is not working, the relay is already switched off before the rules are executed.
rule1 ON Power1#state=0 do backlog publish x; delay y; power off ENDON
I’ve been trying and searching for two days now. Maybe I’m not using the correct keywords. Anyone?
Last Will and Testament is for ungraceful disconnects. I don’t think this is the solution to my problem. I want my relay to switch off AFTER it publishes a command and wait for x seconds.