Aqara Wireless Switch (Zigbee2MQTT) - single, double and hold action

Yes, just add filter: key and space it out like the docs suggest for the current format. Don’t have to test anything.
This is the same as all entity and device selectors now all blueprints.

Fixed locally and tested, indeed the only change is filter:
image

I use this Aquara button (WXKG11LM) with Zigbee2MQTT, and I created an automation who is triggered by the single action of this device, but seems the single action state is to short for fire the automation. So I’am not able to use this button. Have someone have this kind of problem?

I think this blueprint is broken because ot the latest z2m update. Certain action are replaced by eventf if I understood it right.

See also other topics with remotes where the authors are making adjustments to their blueprint.

1 Like

Indeed, needs updating. Enable legacy actions as a workaround.

Based on work done here I’ve tweaked the blueprint as follows.

blueprint:
  name: Aqara Buttons All-In-One [Zigbee2MQTT]
  description: 'All-In-One package for Aqara Switches.'
  domain: automation
  input:
    mode:
      name: Automation Modes
      description: https://www.home-assistant.io/docs/automation/modes/
      default: parallel
      selector:
        select:
          mode: dropdown
          options:
            - single
            - restart
            - queued
            - parallel
          multiple: false
          custom_value: false
          sort: false
    zigbee_device:
      name: Zigbee Device (Aqara Switch)
      description: Select the correct Zigbee device to use.
      selector:
        device:
          integration: mqtt
          multiple: false
    single_action:
      name: Single Click
      description: Single click for devices with one button
      default: []
      selector:
        action: {}
    double_action:
      name: Double Click
      description: Double click for devices with one button
      default: []
      selector:
        action: {}
    triple_action:
      name: triple Click
      description: triple click for devices with one button
      default: []
      selector:
        action: {}
    quadruple_action:
      name: Quadruple Click
      description: triple click for devices with one button
      default: []
      selector:
        action: {}
    hold_action:
      name: Hold Action
      description: Hold action for devices with one button
      default: []
      selector:
        action: {}
    release_action:
      name: Release Action
      description: Release action for devices with one button
      default: []
      selector:
        action: {}
    shake_action:
      name: Shake Action
      description: Shake action for devices with one button
      default: []
      selector:
        action: {}
    single_left_action:
      name: Single Left Click
      description: Left click for devices with multiple buttons
      default: []
      selector:
        action: {}
    double_left_action:
      name: Double Left Click
      description: Double left click for devices with multiple buttons
      default: []
      selector:
        action: {}
    triple_left_action:
      name: triple Left Click
      description: triple left click for devices with multiple buttons
      default: []
      selector:
        action: {}
    hold_left_action:
      name: Hold Left Action
      description: Hold left action for devices with multiple buttons
      default: []
      selector:
        action: {}
    release_left_action:
      name: Release Left Action
      description: Release left action for devices with multiple buttons
      default: []
      selector:
        action: {}
    single_center_action:
      name: Single Center Click
      description: Center click for devices with three buttons
      default: []
      selector:
        action: {}
    double_center_action:
      name: Double Center Click
      description: Double center click for devices with three buttons
      default: []
      selector:
        action: {}
    triple_center_action:
      name: triple Center Click
      description: triple center click for devices with three buttons
      default: []
      selector:
        action: {}
    hold_center_action:
      name: Hold Center Action
      description: Hold center action for devices with three buttons
      default: []
      selector:
        action: {}
    release_center_action:
      name: Release Center Action
      description: Release center action for devices with three buttons
      default: []
      selector:
        action: {}
    single_right_action:
      name: Single Right Click
      description: Right click for devices with multiple buttons
      default: []
      selector:
        action: {}
    double_right_action:
      name: Double Right Click
      description: Double right click for devices with multiple buttons
      default: []
      selector:
        action: {}
    triple_right_action:
      name: triple Right Click
      description: triple right click for devices with multiple buttons
      default: []
      selector:
        action: {}
    hold_right_action:
      name: Hold Right Action
      description: Hold right action for devices with multiple buttons
      default: []
      selector:
        action: {}
    release_right_action:
      name: Release Right Action
      description: Release right action for devices with multiple buttons
      default: []
      selector:
        action: {}
    single_both_action:
      name: Single Both Click
      description: Both click for devices with multiple buttons
      default: []
      selector:
        action: {}
    double_both_action:
      name: Double Both Click
      description: Double both click for devices with multiple buttons
      default: []
      selector:
        action: {}
    triple_both_action:
      name: triple Both Click
      description: triple both click for devices with multiple buttons
      default: []
      selector:
        action: {}
    hold_both_action:
      name: Hold Both Action
      description: Hold both action for devices with multiple buttons
      default: []
      selector:
        action: {}
    release_both_action:
      name: Release Both Action
      description: Release both action for devices with multiple buttons
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/aqara-buttons-all-in-one-zigbee2mqtt/268717
mode: !input mode
max_exceeded: silent
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/+/action
variables:
  device_name: !input zigbee_device
  expected_topic: zigbee2mqtt/{{ device_attr(device_name, 'name') }}/action
condition:
  - condition: template
    value_template: "{{ trigger.topic == expected_topic }}"
action:
  - variables:
      command: "{{ trigger.payload }}"
  - choose:
    - conditions: '{{ command == ''single'' }}'
      sequence: !input 'single_action'
    - conditions: '{{ command == ''double'' }}'
      sequence: !input 'double_action'
    - conditions: '{{ command == ''triple'' }}'
      sequence: !input 'triple_action'
    - conditions: '{{ command == ''quadruple'' }}'
      sequence: !input 'quadruple_action'
    - conditions: '{{ command == ''hold'' }}'
      sequence: !input 'hold_action'
    - conditions: '{{ command == ''release'' }}'
      sequence: !input 'release_action'
    - conditions: '{{ command == ''shake'' }}'
      sequence: !input 'shake_action'
    - conditions: '{{ command == ''single_left'' }}'
      sequence: !input 'single_left_action'
    - conditions: '{{ command == ''double_left'' }}'
      sequence: !input 'double_left_action'
    - conditions: '{{ command == ''triple_left'' }}'
      sequence: !input 'triple_left_action'
    - conditions: '{{ command == ''hold_left'' }}'
      sequence: !input 'hold_left_action'
    - conditions: '{{ command == ''release_left'' }}'
      sequence: !input 'release_left_action'
    - conditions: '{{ command == ''single_center'' }}'
      sequence: !input 'single_center_action'
    - conditions: '{{ command == ''double_center'' }}'
      sequence: !input 'double_center_action'
    - conditions: '{{ command == ''triple_center'' }}'
      sequence: !input 'triple_center_action'
    - conditions: '{{ command == ''hold_center'' }}'
      sequence: !input 'hold_center_action'
    - conditions: '{{ command == ''release_center'' }}'
      sequence: !input 'release_center_action'
    - conditions: '{{ command == ''single_right'' }}'
      sequence: !input 'single_right_action'
    - conditions: '{{ command == ''double_right'' }}'
      sequence: !input 'double_right_action'
    - conditions: '{{ command == ''triple_right'' }}'
      sequence: !input 'triple_right_action'
    - conditions: '{{ command == ''hold_right'' }}'
      sequence: !input 'hold_right_action'
    - conditions: '{{ command == ''release_right'' }}'
      sequence: !input 'release_right_action'
    - conditions: '{{ command == ''single_both'' }}'
      sequence: !input 'single_both_action'
    - conditions: '{{ command == ''double_both'' }}'
      sequence: !input 'double_both_action'
    - conditions: '{{ command == ''triple_both'' }}'
      sequence: !input 'triple_both_action'
    - conditions: '{{ command == ''hold_both'' }}'
      sequence: !input 'hold_both_action'
    - conditions: '{{ command == ''release_both'' }}'
      sequence: !input 'release_both_action'

Not sure if that helps until an official update come out.

1 Like

Seems good to me:
This should let you directly import @nwootton changes for this Aqara device:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
updated 12/01/2025, it is now using device specific mqtt device triggers instead of triggering for any mqtt device action.

4 Likes

Works for me!! Thanks

Works, thanks.

WXKG11LM seems not working , in zigbee2mqtt i saw the status changing Single Double etc , but nothing in automation based on the new BP :frowning:

Cleaner version of the blueprint (in respect to the previous one I posted), click above to import.

the previous blueprint should have worked, unless maybe you have a different zigbee2mqtt mqtt base topic which isn’t zigbee2mqtt.
Either way this doesn’t directly subscript an mqtt topic but uses the device mqtt trigger, so it might work.

1 Like

hi ! many thanks for this ! it works now like a charm My 10 WXKG11LM are back in the game !