Set Dimmer Group level when ANY Dimmer in the Group changes?

I have 4 dimmers in a Group. I’m trying to create an automation that will set ALL dimmers in that group to the level of whichever Dimmer changes. I’m not seeing a direct way to do this - I’m new so assuming I’m missing something simple?

I also looked for a Blueprint, didnt see one?

I need to do this a lot in my house as I have several multi-way circuits with z-wave dimmers and/or switches them.

thanks for the help!

I don’t think you can do this reliably[*] with a group, unfortunately, because a state-based trigger on the group won’t, as far as I can tell, let you ascertain which entity in the group actually changed. And you need to know that, so that you can figure out what it changed from and to, in order to figure out what to do with the other entities.

What kind of entities are you grouping? Lights or sensors? If sensors, who’s providing the sensor–is it a template sensor you’ve created or is the sensor coming from the integration? Depending on the answers, there is almost certainly a good way to do what you’re trying to do.

[*] I say reliably because you likely COULD write an automation that, once triggered by the group, does some magic to iterate over the group members to figure out which one was changed most recently. But I have a feeling that this wouldn’t work too well for a number of reasons, and would be pretty ugly as far as code goes. A simpler solution is probably better here.

Not being able to trigger on individual Entity status within a group is a big oversight in the design of Groups.

The intent of Groups is to get status and control multiple similar items all at once.

Pull value/status of the individual Entities within that Group is an essential feature to be able to fully utilize the benefit of groups. For comparing values and/or if/when things changed… value is larger than / smaller than, turned on within the last N seconds, and many more.

Groups entities can change as devices are replaced/etc and still the automation is at the group level, so admin is 100x easier… greatly reduce re-work for building/updating Automations.

In Homeseer it is a simple 2 line automation. The THEN statement calls a ‘Global Variable’ set in the WHEN statement…

I think you can set the brightness for the group, but to detect the changed entity you need to itemize each member in the trigger list of an automation.

triggers:
  - trigger: state
    entity_id:
      - light.dimmer_1
      - light.dimmer_2
      - light.dimmer_3
      - light.dimmer_4
    attribute: brightness
actions:
  - action: light.turn_on
    data:
      brightness: "{{ state_attr(trigger.entity_id, 'brightness') }}"
    target:
      entity_id: light.groupname

It’d be cool if you could use templates to auto-expand the group entities, like {{ state_attr(light.groupname, 'entity_id')|list }} but that didn’t work when I tried it; triggers only support “limited templates” and maybe someone more knowledgeable knows how to construct one here.

Lastly, since you have Z-Wave dimmers, you may have other options. Many zwave dimmers support group associations on the multilevel switch, so one dimmer directly commands the others when its level changes. HA is not involved, so works even if your server is offline.

One drawback of that approach, @peterxian, is that it obviates the usefulness of having a group. You’d be better off listing all the entity IDs in the light call than relying on the group, because at least that way if you change the list, you don’t need to go update it in two different subsystems.

But if the group is a group of lights, then it’s probably not possible to implement this and still get the benefit of using a group, which I think is what you’re saying too.

Also, at least for light groups, it’s possible to get a list of the entity_ids in the group using

state_attr(GROUP_ENTITY_ID, 'entity_id')

The approach I alluded to above–which I would not recommend here–is to iterate over that list and figure out the most recently updated light using states[entity_id][‘last_updated’]. But there is no way to do that safely – it will sooner or later spill its guts because the states object isn’t guaranteed to be complete; see the yellow Warning box here.

(Oh, also. Just realized, you were exploring using the entity_id attribute for the trigger. I wish.)

Without even having attempted it I don’t see why not. In a template, simply expand the group to get the individual lights. If you want to get fancy, compare the state context id of the individual lights against the to_state of the group. If you don’t, simply assume that the light that saw the most recent change probably was the one to have its brightness changed to trigger the automation.

If it wasn’t already midnight and really time to get some sleep I’d write up a quick proof of concept. Might do that tomorrow if no-one else does it during my night.