blueprint:
  name: Aqara single switch
  domain: automation
  input:
    z2m_topic:
    click:
      default: []
    double_click:
      default: []
    hold:
      default: []

trigger:
  platform: mqtt
  topic: !input z2m_topic

action:
  - choose:
    - conditions:
      - condition: template
        value_template: "{{ trigger.payload_json.click == 'single' }}"
      sequence: !input click

    - conditions:
      - condition: template
        value_template: "{{ trigger.payload_json.click == 'double' }}"
      sequence: !input double_click

    - conditions:
      - condition: template
        value_template: "{{ trigger.payload_json.action == 'hold' }}"
      sequence: !input hold
