Trigger on any Light (Attribute) Change

How can i achieve this? Really tried a lot, but cant get it to work.

I need to trigger Automations, whenever anything regarding the Lights in the corresponding Room changes (bri, col, on/off, temp,…).
For each Room i have set up a Lightgroup (e.g. light.roomlight_kuche), where all lights are in.

While i can trigger on that Lightgroup, that Group doesnt change in certain circumstances. For example, when there is a light with just onoff state.
I would love to avoid adding all lights manually in automations for every room each - that makes it maintainance-unfriendly on the long run.

I have all lights named after the room, e.g. light.grp_kuche_table, light.grp_kuche_ceiling, but Wildcard triggers don’t work.
And Template Triggers only work if they change to True.
I can’t expand a Group to its coresponding entities in a state trigger.

But how can i then capture changes as a trigger in automations, that do not lead to an update of the roomlight.group?

Though I would not recommend you do it, the only option that meets all your criteria is to use an Event trigger that listens for state_changed events and then filter them with template conditions.

1 Like

Thanks! I thought about this as well (and forgot to mention it), but didn’t dare to really trigger on all state changes.
But I don’t know enough about events and listening - isnt there a way to narrow it down and limit, if wildcard not possible, maybe at least per domain?

I have the feeling I am just thinking in one direction, and there needs to be an, probably easy, solution Im just overlooking…

For other event types it is easier to limit triggering by using event data, but because of the structure of the state data in state_changed events and the specificity required in the Event trigger’s event_data variable, it’s pretty much impossible to restrict it the way you want.

While you say you want to avoid it, your best bet is using a State trigger that has all the lights in the room.

Especially with light entities, trying to use area-based concepts can be problematic. Many devices will assign components to light that most people wouldn’t consider when they are creating an automation. Things like displays and indicator lights… HA doesn’t currently have device classes for lights that would allow them to be rejected from a template-generated list. So, even if you could template the trigger the way you want, it’s going require some manual maintenance to “opt-out” all those entities when they are inevitably added.

1 Like

Thanks Guys! At least now i know i didnt stupidly overlook something simple :slight_smile:

Looks like. Which i think can be considered as one of the Big Reasons for a Smart Home System. Anyway. I need to go the Route then, and quite unsmart, add all entities per Room manually… :stuck_out_tongue:

Thanks again for your Confirmations and Recommendations, appreciate it! :slight_smile: