Multiple Triggers with different actions - blinds

Hi,

I want to migrate 4 automations in one automation. I have 4 Remote Controls for my 4 ZigBEe IKEA blinds in the living rooms. Each button is supposed for open one of the 4 blinds. Right now, with the code I put into the yaml file, all 4 blinds are going to open, never mind the remote control I use:). I tried it with variables but failed too.

Any suggestion or hint how to solve that?

The Code so far:

alias: Rollos -  Öffne 100%
description: ""
trigger:
  - device_id: 92b5e92a76dca710f787fddae9d849b0
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: open
  - device_id: e437a9258a9b4ff68341143aa70437bc
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: open
  - device_id: 19e6ab603509b5f4c3c1b6c424af7bbd
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: open
  - device_id: f6f0d991ccfa2fc85be6982215945d7b
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: open
condition: []
action:
  - device_id: ca14d5656a8ecb1486aaa52ca6cd50b2
    domain: cover
    entity_id: 47b48bfde2ff46d9ad643106223c89a8
    type: open
  - device_id: 8b2c354ba0be7ea60c795b0fb526ed0e
    domain: cover
    entity_id: 13b9c5cc7e4b99647858106731f9fb00
    type: open
  - device_id: 970983de872f4ddb9bd4778b5e30bd28
    domain: cover
    entity_id: 682df9f9a3aad21f4edfc0d081ac34fb
    type: open
  - device_id: c10979414794dfb90af482d7c9f1597c
    domain: cover
    entity_id: e1cf474d1335a9c369b496b256e61c24
    type: open
mode: single

Thanks!

There are a few options:

  1. Have one automation for each remote-blind pair
  2. Use a Choose action to address the desired blind based on the triggering device.
  3. Use Templating to address the desired blind based on the triggering device.

See also Trigger IDs.

Morning,

yeah, thanks, perfect! The Trigger ID did it!
It’s working like charm

alias: Rollos -  Schließe mit Remote
description: ""
trigger:
  - device_id: 92b5e92a76dca710f787fddae9d849b0
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: close
    id: erker-links
  - device_id: e437a9258a9b4ff68341143aa70437bc
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: close
    id: erker-rechts
  - device_id: 19e6ab603509b5f4c3c1b6c424af7bbd
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: close
    id: rollo-links
  - device_id: f6f0d991ccfa2fc85be6982215945d7b
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: close
    id: rollo-rechts
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - erker-links
        sequence:
          - device_id: ca14d5656a8ecb1486aaa52ca6cd50b2
            domain: cover
            entity_id: 47b48bfde2ff46d9ad643106223c89a8
            type: close
      - conditions:
          - condition: trigger
            id:
              - erker-rechts
        sequence:
          - device_id: 8b2c354ba0be7ea60c795b0fb526ed0e
            domain: cover
            entity_id: 13b9c5cc7e4b99647858106731f9fb00
            type: close
      - conditions:
          - condition: trigger
            id:
              - rollo-links
        sequence:
          - device_id: 970983de872f4ddb9bd4778b5e30bd28
            domain: cover
            entity_id: 682df9f9a3aad21f4edfc0d081ac34fb
            type: close
      - conditions:
          - condition: trigger
            id:
              - rollo-rechts
        sequence:
          - device_id: c10979414794dfb90af482d7c9f1597c
            domain: cover
            entity_id: e1cf474d1335a9c369b496b256e61c24
            type: close
mode: single