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