Blueprint Input: Device Trigger Selector

It would be really nice if we could select a device trigger as an input for blueprints, the same way we can select device triggers in automations. This could help reducing the dependency of a blueprint on specific devices.

I can’t quite figure out how the selectors work but I guess it could be almost the same as an action, except that the action is outgoing while a device trigger is incoming

Example:
I want to create a blueprint with 3 inputs: Light, Toggle Trigger and Brightness Trigger.

Automation 1:
Light: living_room.main
Toggle Trigger: remote_x.button_1_click
Brightness Trigger: remote_x.button_1_double_click

Automation 2:
Light: hallway.main
Toggle Trigger: remote_y.button_short_press
Brightness Trigger: remote_y.button_long_press

Blueprint:

...
  input:
    light:
      selector:
        target:
          entity:
            domain: light
    toggle_trigger:
      selector:
        device_trigger:
    brightness_trigger:
      selector:
        device_trigger:
...

Automation:

alias: Control livingroom light
use_blueprint:
  path: homeassistant/toggle_with_brightness.yaml
  input:
    light: living_room.main
    toggle_trigger:
      device_id: <guid>
      domain: zha
      platform: device
      type: remote_button_short_press
      subtype: button_1
    brightness_trigger:
      device_id: <guid>
      domain: zha
      platform: device
      type: remote_button_double_press
      subtype: button_1
  

I would like to know if other people also see the value in this, or know what it would take to implement this.

Oh, yes, I’m missing this a lot too!

I have exactly the same use case and my work around is to have multiple entity selectors, one for each kind of button. Very ugly

Hey, I have solved this with trigger ids:

Blueprint Code:

blueprint:
  name: Button - [Control] Lights
  description: Button single/double/hold press to control lights
  domain: automation
  input:
    button_device_id:
      name: The button device id to trigger the automation
    target_light:
      name: Light
    
mode: single

trigger:
  - platform: device
    device_id: !input button_device_id
    domain: homekit_controller
    type: button1
    subtype: single_press
    id: single
  - platform: device
    device_id: !input button_device_id
    domain: homekit_controller
    type: button1
    subtype: double_press
    id: double
  - platform: device
    device_id: !input button_device_id
    domain: homekit_controller
    type: button1
    subtype: long_press
    id: long

action:
  - choose:
    - alias: If single press
      conditions: 
        - condition: trigger
          id: single
      sequence:
        - service: light.toggle
          target:
            entity_id: !input target_light

    - alias: If double press
      conditions: 
        - condition: trigger
          id: double
      sequence:
        - service: light.turn_on
          target:
            entity_id: !input target_light
          data:
            brightness_pct: 20
    
    - alias: If long press
      conditions: 
        - condition: trigger
          id: long
      sequence:
        - service: light.turn_on
          target:
            entity_id: !input target_light
          data:
            brightness_pct: 100

Then automations look like this:

- alias: "[Button 3] Trigger on Button"
  use_blueprint:
    path: button_light.yaml
    input:
      button_device_id: ****
      target_light: light.***