deCONZ - Xiaomi Aqara WXKG11LM Smart Wireless Mini Switch

Blueprint to support the Aqara Wireless Mini Switch. (Savjee blueprint fork)

Supported actions:

Button events for the 2016 version “lumi.sensor_switch.aq2”

  • Single press
  • Double press
  • Tripple press
  • Quad press

Button events for the 2018 version “lumi.remote.b1acn01”

  • Single press
  • Double press
  • Hold
  • Hold release


blueprint:
  name: deCONZ - Xiaomi Aqara WXKG11LM Wireless Switch
  description: Control anything using Xiaomi Aqara WXKG11LM (single button) remote
  domain: automation
  input:
    remote:
      name: Remote
      description: Button to use
      selector:
        device:
          integration: deconz
          manufacturer: LUMI

    button_press_in:
      name: Single press
      default: []
      selector:
        action: {}

    button_double_press:
      name: Double press
      default: []
      selector:
        action: {}

    button_triple_press:
      name: Triple press
      description: “Only for lumi.sensor_switch.aq2”
      default: []
      selector:
        action: {}

    button_quad_press:
      name: Quad press
      description: “Only for lumi.sensor_switch.aq2”
      default: []
      selector:
        action: {}

    button_hold:
      name: Button hold
      description: "Only for lumi.remote.b1acn01"
      default: []
      selector:
        action: {}

    button_hold_release:
      name: Button hold release
      description: "Only for lumi.remote.b1acn01"
      default: []
      selector:
        action: {}

mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: deconz_event
  event_data:
    device_id: !input 'remote'
action:
- variables:
    event: '{{ trigger.event.data.event }}'
- choose:
  - conditions:
    - '{{ event == 1001 }}'
    sequence: !input 'button_hold'

  - conditions:
    - '{{ event == 1003 }}'
    sequence: !input 'button_hold_release'
  
  - conditions:
    - '{{ event == 1002 }}'
    sequence: !input 'button_press_in'
  - conditions:
    - '{{ event == 1004 }}'
    sequence: !input 'button_double_press'

  - conditions:
    - '{{ event == 1005 }}'
    sequence: !input 'button_triple_press'

  - conditions:
    - '{{ event == 1006 }}'
    sequence: !input 'button_quad_press'

2 Likes

Awesome work :tada:

My buttons seems to be lumi.remote.b1acn01 instead.

It seems the blueprint spec needs to support a list of models in the selector.

I changed it, now you can pick a device from the list! And added support for the 2018 version “lumi.remote.b1acn01”
Let me know if it’s working! Thx

1 Like

Thanks. It now shows my two buttons.

But it also shows my aqara vibration sensor, my “2-gang” aqara twin button, and my aqara temperature/humidity sensor.

Do you happen to know if multiple buttons can be used as inputs? Asking because I have two buttons that I want to perform the same actions.

hi there…dumb question here:
how to use hold release? I can’t figure it out the use scenario.

the hold release will always trigger the hold… this is confusing to me. So it’s pointless in my mind.

Can someone explain me how should I use o think about the ‘hold release’?

Thanks

The only thought I had for the hold release actions was to start incrementing brightness then stopping with a release.
There would likely need to be condsiderations for:

  • At 100% change to dimming
  • How long can you hold - before a timeout
  • How quick HA responds to a release and stops adjusting brightness

Sorry I haven’t have time to think about how it would be done.