Automation triggers after entity was unavaible

Hey there Im into HA only for a few weeks and so far I understand the basics.
Im using Shelly i3 for my lightswitches to manually switch my Smart bulbs on and off. I choosed those because I wanted to turn on the bulb or change the color also with Google Home.

So I created an automation that triggers when the i3 changes the state from “power detected” to “no power detected” of the switch to turn on the bulb. No problem so far.
But it happend three times now that the entity becomes unavaible for a moment and as it becomes avaible again the state changes (same state as before it was unavaible) and trigger the automation.

Is there a way i can tell it to not change the state after it was unavaible or maybe remember the state from before ?

I could provide more infos and the Log after work.

In your automation, assuming you use a state trigger, you can restrict the states that trigger it with the from: and to: keywords.

1 Like

Im using the device trigger. But your way seems logical. I will try the state trigger later.
It could be that my whole automation isnt the best way to do this. Because it triggers at a state change either “power detected” and “power not detected” and as the entity gets avaible again its logging a state change.