Blueprint that can use multiple Ikea Switches as trigger

I would like uniform behavior of light siwtches across the house, and only have to change that behavior in a single place.

To start, I would like to write a simple blueprint that has 2 inputs:

  • a list of switches (IKEA RODRET)
  • a light target

The blueprint should generate an automation, that will react to all switches (their respective on- and off-buttons).
So far i have the following:

blueprint:
  name: Ikea Light Switch
  description: Turn on/off a light with Ikea RODRET switches
  domain: automation
  input:
    switch_id:
      name: Switch
      selector:
        device:
          filter:
            #integration: deconz
            #manufacturer: IKEA of Sweden
            model: RODRET Dimmer
          multiple: false 
          # multiple: true does not work, as there does not
          # appear to be a way to create multiple triggers
          # based on a device list
    target_light:
      name: Lights
      selector:
        target:
          entity:
            domain: light
triggers:
  - device_id: !input switch_id
    domain: deconz
    type: remote_button_short_release
    subtype: turn_on
    trigger: device
    id: licht-an
  - device_id: !input switch_id
    domain: deconz
    type: remote_button_short_release
    subtype: turn_off
    trigger: device
    id: licht-aus
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - licht-an
        sequence:
          - action: light.turn_on
            metadata: {}
            data: {}
            target: !input target_light
      - conditions:
          - condition: trigger
            id:
              - licht-aus
        sequence:
          - action: light.turn_off
            metadata: {}
            data: {}
            target: !input target_light
mode: single

Searching for a solution here, I have seent the guide to avoid Device/ids and use entities instead multiple times.

However, I have noticed that the IKEA RODRET switches are registered as device, but I can not find entities (except for the batteries).
instead they have events like

  • “Turn on” released
  • “Turn on” continuousely pressed
  • “Turn on” released after long press
  • “Turn off” released
    …

If there is a way to react properly using entities, I do not understand how.
Is there any way for me to achieve what I want?

  1. Set the device selector’s multiple option to true.
  2. Set up a variables block so you can use the switch_id input in templates.
  3. Use Event triggers instead of Device triggers
  4. Add a template condition to check that the device ID in the event data is in your list from switch_id.
  5. Set the mode to queued

Or, you could use a trigger selector with multiple enabled so you could add all the triggers you want.

1 Like

Thanks a lot @Didgeridrew - I’ll try to use event triggers (I’d prefer to not use a trigger selector, but restrict the input to the specific devices.)

The only question I now have is:
How do I know, how exactly to set up the event triggers?
I tried this:

trigger: event
event_type: remote_button_short_release
id: licht-aus

But it appears, this does not get triggered.
In the “Ui” visualization there does not seem to be any more autocompletion.
Is there any debugging utility to find out, what event exactly is fired when i press a button?

Ah - I just found this:

Sorry I didnt see is before replying - I think that will be enough for me to proceed, and when it works mark your answer as solution. Thanks again!