Aqara Wireless Switch WXKG11LM (via Zigbee2MQTT device trigger)

I’ve been using Zigbee2MQTT - Aqara Wireless Switch (single, double, triple, quadruple) for a while now and it’s been good. However, the upcoming Zigbee2MQTT 2.0 release will drop support for the legacy sensors that blueprint uses. Here is a nearly identical blueprint that implements support for the WXKG11LM using device triggers. It will work in the 1.x releases of Zigbee2MQTT too.

Edit: This was reverted in fix(ignore): Add back Home Assistant legacy action sensor by Koenkk · Pull Request #25192 · Koenkk/zigbee2mqtt · GitHub and the sensor entities have been restored. Of course, this blueprint still works, but users upgrading to the 2.0 release when it’s out won’t have any breaking automations to fix up.

As well, it adds support for hold and release actions which are supported on some newer revisions of the button (but can’t be identified from the model number).

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Aqara Wireless Switch WXKG11LM (via Zigbee2MQTT device trigger)
  description: Control anything using Aqara Wireless Switch
  domain: automation
  input:
    device:
      name: Switch
      description: Aqara Wireless Switch to use
      selector:
        device:
          filter:
            - manufacturer: Aqara
              model: Wireless mini switch (WXKG11LM)
          multiple: false
    press_single:
      name: Single button press
      description: Action to run on single button press
      default: []
      selector:
        action: {}
    press_double:
      name: Double button press
      description: Action to run on double button press
      default: []
      selector:
        action: {}
    press_triple:
      name: Triple button press
      description: Action to run on triple press
      default: []
      selector:
        action: {}
    press_quadruple:
      name: Quadruple button press
      description: Action to run on quadruple press
      default: []
      selector:
        action: {}
    press_hold:
      name: Hold button press
      description: Action to run on button hold (not supported on all devices)
      default: []
      selector:
        action: {}
    press_release:
      name: Release button
      description: Action to run when button is released (not supported on all devices)
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/aqara-wireless-switch-wxkg11lm-via-zigbee2mqtt-device-trigger/808126
mode: queued
max_exceeded: silent
trigger:
  - platform: device
    domain: mqtt
    device_id: !input device
    type: action
    subtype: single
  - platform: device
    domain: mqtt
    device_id: !input device
    type: action
    subtype: double
  - platform: device
    domain: mqtt
    device_id: !input device
    type: action
    subtype: triple
  - platform: device
    domain: mqtt
    device_id: !input device
    type: action
    subtype: quadruple
  - platform: device
    domain: mqtt
    device_id: !input device
    type: action
    subtype: hold
  - platform: device
    domain: mqtt
    device_id: !input device
    type: action
    subtype: release
action:
  - choose:
      - conditions: "{{ trigger.payload == 'single' }}"
        sequence: !input press_single
      - conditions: "{{ trigger.payload == 'double' }}"
        sequence: !input press_double
      - conditions: "{{ trigger.payload == 'triple' }}"
        sequence: !input press_triple
      - conditions: "{{ trigger.payload == 'quadruple' }}"
        sequence: !input press_quadruple
      - conditions: "{{ trigger.payload == 'hold' }}"
        sequence: !input press_hold
      - conditions: "{{ trigger.payload == 'release' }}"
        sequence: !input press_release
1 Like