Multiple triggers with multiple actions

Hello,

I’ve purchased a universal MOES UFO-R11 IR sender for my airco unit.
Is it possible to create 1 automation with 2 triggers that both trigger a different action.

So for example i have 2 triggers:

  • Trigger A
  • Trigger B

I have 2 actions:

  • Send MQTT topic to turn on
  • Send MQTT topic to turn off

How do i manage to get Trigger A to send MQTT topic to turn on and Trigger B to send topic to turn off.

I managed to get it working with 2 different automations, but that’s making a mess of my overview of automations.

Use trigger.id to determine which one of the two triggers was responsible for triggering the automation.

For example:

alias: example
trigger:
  - id: 'on'
    platform: whatever
    ... etc ...
  - id: 'off'
    platform: whatever
    ... etc ...
condition: []
action:
  - service: mqtt.publish
    data:
      topic: your/topic
      payload_template: '{{ trigger.id }}'

Reference: Available Trigger Data

Thanks. I will try it :slight_smile: