I want to respond to a light turn off event. But my automation doesn’t trigger. I copied the layout from an event listener, but perhaps my formatting is wrong?
Interesting. When I added brackets it stopped working. But I did notice that if I called two lights at once detection stopped. If I specifically added two lights to the event trigger it worked. I guess adding [ ] will allow event detection work even multiple lights are in the service call.
So I must have got the [ ] formatting wrong.
I’m not sure, but isn’t listening to the device state change much safer? I’m thinking this will not fire if e.g. the generic homeassistant.turn_off is called, or the light is turned off by another means (from the device itself). Unless of couse it is your intention to listen to explicit service calls and not the rest.