ZHA - Aqara Wireless Mini Switch (aq2) with all possible button presses

Tags: #<Tag:0x00007fc41fae38b0> #<Tag:0x00007fc41fae37e8> #<Tag:0x00007fc41fae3680>

Understandably somewhat redundant as the multiple button presses can be set as individual automation triggers, but I like to have a single automation control all options of the button, so for others that share the same OCD, here a simple blueprint for the Aqara (aq2) mini switch.

  name: ZHA - Aqara Wireless Mini Switch (aq2)
  description: Automate your Xiaomi Aqara Wireless Mini Switch using ZHA events.
  domain: automation
      name: Aqara Wireless Mini Switch
      description: Aqara Wireless Mini Switch to use
          integration: zha
          manufacturer: LUMI
          model: lumi.sensor_switch.aq2
      name: Single Press
      description: Action to run on single press
      default: []
        action: {}
      name: Double Press
      description: Action to run on double press
      default: []
        action: {}
      name: Triple Press
      description: Action to run when button is triple pressed
      default: []
        action: {}
      name: Quadruple
      description: Action to run when button is quadruple pressed
      default: []
        action: {}
mode: restart
max_exceeded: silent
  - platform: event
    event_type: zha_event
      device_id: !input "aqara_mini_switch"
  - choose:
      - conditions:
          - "{{ trigger.event.data.args.value == 1 }}"
        sequence: !input "button_single_press"
      - conditions:
          - "{{ trigger.event.data.args.value == 2 }}"
        sequence: !input "button_double_press"
      - conditions:
          - "{{ trigger.event.data.args.value == 3 }}"
        sequence: !input "button_triple_press"
      - conditions:
          - "{{ trigger.event.data.args.value == 4 }}"
        sequence: !input "button_quadruple_press"
1 Like

There’s a similar one, that’s probably duplicate ZHA - Xiaomi Aqara Wireless Mini Switch (WXKG11LM) - lumi.sensor_switch.aq2.

Didn’t exist yet when I published this one :wink:
But sure is a better presentation than mine…

Would good etiquette be for me to delete this post?

Actually you are right, you posted your BP first! At the time I didn’t notice, probably because I was building mine for a few days.
Mine also includes the multiple press action, that’s another difference :slight_smile:

No worries, my recommendation would be for your BP any day!

1 Like

:wave: yeah, it’s hard to track all those variations! Bottom line is that we all benefit from these, so thanks both for your work :rocket:

Note that updating to 2021.4.5 seems to break this blueprint. The lingo on the support forums go somewhat above my head, but I gather that this is part of a larger problem and appears to being addressed. For now, downgrading to 2021.4.4 fixes the problem.