4 buttons for 4 automations in one?

Hi,

I can’t get this to work. I am sure it’s very simple but i get stuck trying to get to get it working.

I have a scene switcher with 4 buttons, which i want to use the upper left to open left garage door and bottom left to close the left garage door and so on.

Am i right that this needs to be done with choose?

I can easily add the 4 triggers, but can not find those triggers in the chose conditions.

description: ""
mode: single
trigger:
  - platform: device
    domain: mqtt
    device_id: 1a7bc0f10179a938b2325fec11a3be7a
    type: action
    subtype: 1_single
    discovery_id: 0x847127fffee7aeb3 action_1_single
  - platform: device
    domain: mqtt
    device_id: 1a7bc0f10179a938b2325fec11a3be7a
    type: action
    subtype: 2_single
    discovery_id: 0x847127fffee7aeb3 action_2_single
  - platform: device
    domain: mqtt
    device_id: 1a7bc0f10179a938b2325fec11a3be7a
    type: action
    subtype: 3_single
    discovery_id: 0x847127fffee7aeb3 action_3_single
  - platform: device
    domain: mqtt
    device_id: 1a7bc0f10179a938b2325fec11a3be7a
    type: action
    subtype: 4_single
    discovery_id: 0x847127fffee7aeb3 action_4_single
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: sensor.garage_doors_switch_front_door_action
            state: ""
        sequence: []

Any help here or a pointer in the right direction would be appreciated!

Thanks!

Try something like this:

trigger:
  - platform: mqtt
    topic: zigbee2mqtt/<friendly_name>/action

condition: '{{ trigger.payload in ["1_single", "2_single", "3_single", "4_single"] }}'

action:
  - choose:
      - conditions: '{{ trigger.payload == "1_single" }}'
        sequence:
          - service: ...
            
      - conditions: '{{ trigger.payload == "2_single" }}'
        sequence:
          - service: ...

Does this look right?

alias: Garage test
description: ""
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/<Garage_doors_switch_front_door>/action
condition:
  - "{{ trigger.payload in [\"1_single\", \"2_single\", \"3_single\", \"4_single\"] }}"
action:
  - choose:
      - conditions: "{{ trigger.payload == \"1_single\" }}"
        sequence:
          - service: cover.open_cover
            data: {}
            target:
              device_id: 49f6a52ca182735e3988a12bf2b21cd6
mode: single

i just added the 1st button for the sake of the test, but nothing happens.

If you are using zigbee2mqtt you should use the device/entities, not use mqtt directly.

Remove both <> at, then it should work.

topic: zigbee2mqtt/<Garage_doors_switch_front_door>/action

Thanks to both! Manage to make it work. Used device for trigger and the payload condition for choose action.

However, is this possible to do through the gui? I dont get why it finds the buttons as triggers, but not in the chose conditions.