This blueprint works with the 2016 WXKG02LM model. I have not found another blueprint on the forums or elsewhere that works with this specific model, so I created my own.
blueprint:
name: ZHA - Aqara Wireless Double Rocker WXKG02LM
description: Automate your Xiaomi Aqara Wireless Double Rocker WXKG02LM using ZHA events.
domain: automation
input:
aqara_switch:
name: Select the switch
description: Aqara Wireless Double Rocker WXKG02LM
selector:
device:
integration: zha
manufacturer: LUMI
entity:
domain: sensor
device_class: battery
button_single_press_left:
name: Single Press Left
description: Action to run on single press
default: []
selector:
action:
button_single_press_right:
name: Single Press Right
description: Action to run on single press
default: []
selector:
action:
button_single_press_both:
name: Single Press Both Buttons
description: Action to run on single presses
default: []
selector:
action:
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input aqara_switch
action:
- variables:
command: "{{ trigger.event.data.endpoint_id }}"
command2: "{{ trigger.event.data.args.value }}"
- choose:
- conditions:
- "{{ command == 1 }}"
- '{{ command2 == "Bool.true" }}'
sequence: !input button_single_press_left
- conditions:
- "{{ command == 2 }}"
- '{{ command2 == "Bool.true" }}'
sequence: !input button_single_press_right
- conditions:
- "{{ command == 3 }}"
- '{{ command2 == "Bool.true" }}'
sequence: !input button_single_press_both
This blueprint does not work for me despite the fact that I have the mentioned switch. When creating automation, when selecting a device at first, it does not offer any and displays the message: No matching devices were found.
What I noticed, I don’t have it as a “sensor”, but as a “remote”. Specifically: “remote.b286acn01”
Apparently there will be a problem. But I don’t know how to solve it.
Hi, I have never gotten the device to register as a remote. Have you tried repairing the device? And just to confirm, you are using ZHA, right?
I’ve used deconz previously and this device seems to work better with deconz, not sure why. But with ZHA you get duplicate events etc. So toggling a light (which was my plan), doesn’t work with this blueprint very well.
The switch WXKG02LM is integrated via the Xiaomi gateway DGNWG02LM and he made it as a “remote”. Probably. Because I don’t remember that I would configure it as a “remote”.
Hello,
I suspected that the integration via the Xiaomi gateway was to blame. You, and even my own experience, confirmed it to me. Yesterday I received the ordered Skyconnect, where I integrated the switch and everything works beautifully for the first time. AWESOME. Thanks for your time, responses, sorry for spamming because of my inexperience. Thank you again.
btw. I was originally thinking of deleting my comments from this thread, but maybe this experience will help someone. Or?
I’ve had some issues with the blueprint not working properly the last four months. The weirdest thing was that the switch would trigger my devices, but not always update the states in home assistant. This totally fixed that! Updated the gist on GitHub for everyone now. Thanks, this helped me out a lot:))