Merge Trigger Selector with other Triggers

I was wondering if anyone has been able to merge the trigger selectors with existing triggers in an automation blueprint?

I have the following code and I am trying to append extra_triggers into the trigger list but have not been successful in doing so.

blueprint:
  name: Flic Button MQTT Blueprint
  description: Configure actions for flic button via MQTT
  domain: automation
  source_url: https://github.com/zpriddy/Home-Assistant-Blueprints/blob/4b107a24de70bf96e66679634ec068aa1460f754/flic_button_mqtt.yaml
  author: Zachary Priddy
  input:
    mqtt_topic:
      name: Flic Button MQTT Topic
      description: Topic for flic button including /action in MQTT
      selector:
        text: {}
    click:
      name: Actions for flic clicked
      default:
      selector:
        action: {}
    double_click:
      name: Actions for flic double clicked
      default:
      selector:
        action: {}
    hold:
      name: Actions for flic held
      default:
      selector:
        action: {}
    extra_triggers:
      name: Extra Triggers
      description: Additional triggers to actions. Trigger IDs must be set to click, double_click, or hold
      default: {}
      selector:
        trigger:

mode: parallel
max: 3

variables:
  mqtt_topic: !input mqtt_topic

trigger_variables:
  mqtt_topic: !input mqtt_topic
  
trigger: 
  - platform: mqtt
    topic: !input mqtt_topic
    payload: click
    id: click
  - platform: mqtt
    topic: !input mqtt_topic
    payload: double_click
    id: double_click
  - platform: mqtt
    topic: !input mqtt_topic
    payload: hold
    id: hold

action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - click
        sequence: !input click
      - conditions:
          - condition: trigger
            id:
              - double_click
        sequence: !input double_click
      - conditions:
          - condition: trigger
            id:
              - hold
        sequence: !input hold

Did you try my answer from this?
Help using the new Trigger Selector (2023.12) in Blueprint - #2 by Sir_Goodenough.

What you have is some hybrid mess. I believe the whole trigger has to be in the input, IDā€™s and all, and you add the !input key in the trigger area as a list item.

What you have in your example should work with a text !input.

If this suggestion solves your problem, please consider clicking the solution button to close the thread.

The example you posted in that thread is closeā€¦ but it should be:

trigger:
  !input my_triggers

From that example does work only if youā€™re using triggers from the input. But I cant even make the default triggers use the variables from the other inputs in that caseā€¦

I also tried making default triggers a trigger variable and then trying to concat that array with the extra triggersā€¦ but that didnt work eitherā€¦

I am hoping to find a way to add the extra triggers to the built in ones in the automationā€¦ That way i can take a blueprint that does some actions, for example reading button clicks, and add another trigger to it so I dont have to create a new automation for the same action just with a different trigger sourceā€¦

Thatā€™s for one. Itā€™s a list, so if you do what I said you should be able to add more triggers.

I tried that, however it threw errors that it was a malformed inputā€¦ it does work that way for conditions without errorā€¦ so I was hopefulā€¦

Iā€™ll play with it tomorrow. Iā€™m curious nowā€¦

1 Like

I havenā€™t had the time to test your suggestion yet - work is a pain before Christmas, but I will follow this thread too, and hopefully I will get the time during the weekends around Christmas - no holiday for me this year :thinking:

I brought this up to some others, and we all think it canā€™t be done, and by that itā€™s broken because it should be a thing that was missed in the original code as a requirement.
Working on an issue as we speak, Iā€™ll post it here so you all can add new info and/or thumb it up.

Conditions work because of the condition structure, the structure is different here so need a structure tweak or something else that people smarter than me will have to figure out.

Here is the issueā€¦
Trigger selector: cannot add one from selector if one already exists in the blueprint Ā· Issue #19050 Ā· home-assistant/frontend Ā· GitHub.

2 Likes

Took a stab at a PR to allow for merging lists of triggers which should fix this. Lets see what the core devs think:

4 Likes

Hope your fix gets approved. :grinning:
Have a blueprint with timer trigger I definitely donā€™t want in a selector (timer entity id is selected, of course) and have no way of adding additional time triggers.
Apart from your fix, what is also missing in trigger selector is an optional trigger type.
Anyway, great work :+1:

I heard rumors of other Blueprint related things happening this Beta.
any chance that this is on the list? @karwosts

I donā€™t have any advance knowledge of whatā€™s coming, beyond the comments on my PR, which are zero. So I wouldnā€™t count on it :sweat_smile:

I dropped an actual comment to try to wake it up. Itā€™s been a couple of months so I donā€™t think itā€™s out of line.
About BPā€™s, I saw leaks from Frenck and Joost about something BP this time.

Discord.