Group Multiple Remotes

I want to group multiple remotes so that i can control one automation with any of the remotes in the group. Neither ZigBee Groups nor HomeAssistant groups seem to work here.

The remotes themselves are zigbee devices (OSRAM ledvance switch mini) and they give out events like “button 1 pressed”.

You should be able to do this with a single event trigger as they support templates. Can you give example events from two of the remotes?

You can record the events in Developer Tools → Events → Listen to events.

This would be an example for the off button:

event_type: zha_event
data:
  device_ieee: 00:0d:6f:00:14:17:b1:a0
  unique_id: 00:0d:6f:00:14:17:b1:a0:2:0x0006
  device_id: 246238ea127707d4d02616a09df36a26
  endpoint_id: 2
  cluster_id: 6
  command: "off"
  args: []
  params: {}
origin: LOCAL
time_fired: "2023-07-04T20:04:33.005935+00:00"
context:
  id: 01H4H83D3D14F2SBFJDQNMAQZ2
  parent_id: null
  user_id: null

Same button, different device:

event_type: zha_event
data:
  device_ieee: 00:0d:6f:00:14:17:d7:1e
  unique_id: 00:0d:6f:00:14:17:d7:1e:2:0x0006
  device_id: 4c8f95df45c9169200bcd160166067a5
  endpoint_id: 2
  cluster_id: 6
  command: "off"
  args: []
  params: {}
origin: LOCAL
time_fired: "2023-07-04T20:08:04.334613+00:00"
context:
  id: 01H4H89VFE2EPQKXD0H2W21R6J
  parent_id: null
  user_id: null

This is what the logbook shows:

emily_sm_1 Remote Button Short Press - Button 3 event was fired
22:04:33 - 2 minutes ago
emily_sm_0 Remote Button Short Press - Button 3 event was fired
22:04:33 - 2 minutes ago

This should trigger for the off button on any of the remotes:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        endpoint_id: 2
        cluster_id: 6
        command: "off"

Thank you, what if i want only specific devices? For example only the two mentioned above. Is there something like:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        endpoint_id: 2
        cluster_id: 6
        command: "off"
      device_id:
        - 246238ea127707d4d02616a09df36a26
        - 4c8f95df45c9169200bcd160166067a5

Yes I think that should work. Though your indentation is a bit off. Should be:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        endpoint_id: 2
        cluster_id: 6
        command: "off"
        device_id:
          - 246238ea127707d4d02616a09df36a26
          - 4c8f95df45c9169200bcd160166067a5

The device id is part of the event data.

I only got it to work with one event id:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        command: "off"
        device_id: 4c8f95df45c9169200bcd160166067a5

In contrast, the following doesn’t work:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        command: "off"
        device_id:
         - 4c8f95df45c9169200bcd160166067a5

And neither does it work when a second id is added. Nor does it work with device_ieee or unique_id

Are you doing this with the automation editor or YAML?

If I recall correctly, the editor has issues with lists.

Try it like this:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        endpoint_id: 2
        cluster_id: 6
        command: "off"
        device_id: 4c8f95df45c9169200bcd160166067a5
    - platform: event
      event_type: zha_event
      event_data:
        endpoint_id: 2
        cluster_id: 6
        command: "off"
        device_id: 4c8f95df45c9169200bcd160166067a5

I’m editing this in YAML, but this seems to be a general limitation. Thanks to this conversation i was able to search more accurately and found that others have also run into this already. The new code you sent does it in multiple triggers which i tried to get away from, but it doesn’t seem to work that easily. Thank you for your time.

1 Like

One more try:

automation:
  trigger:
    - platform: event
      event_type: zha_event
      event_data:
        endpoint_id: 2
        cluster_id: 6
        command: "off"
condition:
  - condition: template
    value_template: >
     {{ trigger.event.data.device_id in [
        '246238ea127707d4d02616a09df36a26', 
        '4c8f95df45c9169200bcd160166067a5'] }}
action:
  - service: etc...
1 Like

It works, thank you!