ZHA - Aqara Wireless Remote Switch (Double Rocker)

This all looks great! Thank you so much. I’ll dig in this week and come back with more info. I have 2 of these switches, too. So, I’ll also be able to make sure they work the same as each other.

With a slight modification to the blueprint it also works for the Single Rocker version (WXKG03LM). You just need to look for commands “single”, “double” and “long press”. Perhaps you could add this to your blueprint?

Thats totally possible. My only question is if we should do a new blueprint for that because it’s a different device? In my philosophy for blueprints for ZHA-Devices there should be only one blueprint for 1 device so people can easily search for the ZHA device they need for automation.

If you agree, I or you can do a new blueprint for that and create a ne topic in the blueprint exchange. If not, I’m totally open for discussion about that topic. Its just my opinion and no official guideline

I don’t really have a strong opinion, and being new here I don’t know what “standards” there are. :slight_smile:

Personally I would probably do it all in one since the single & dual rocker versions are very similar. And probably map the “single” commands to the left button actions (and rename them button 1 (left) and button 2 (right)…

Yeah I think I will create a new one. We already have 10 Inputs and its kinda messy and for low level Hassio users it could get confusing where to add their stuff. I think for not so advanced users its easier to have a explicit one for the WXKG03LM where they can add their stuff just right away without worrying that you can add actions to the wrong place

Can you send me the model number of the switch so I can add this for the selector (The filter which determines if a entity could be selected in the input). I would send you the blueprint for testing per PN so you can test before we publish it if this is okay for you.

Later you can still merge both blueprints by your own for your personal use at home for your own instance.

I just created a new blueprint for the single rocker version: ZHA - Aqara Wireless Remote Switch (Single Rocker)
It’s based on this blueprint, but since it’s my first blueprint (I made it because I needed it today), I might have not created it correctly. If anyone has any improvements on it, go ahead and let me know :slight_smile:

1 Like

Checked it already. Seems that there arent obvious mistakes like typos. Could’nt check if the commands are right cause I havent the switch. If all the actions works for each kind of press then your blueprint is perfectly fine. I have it refrenced in my original post :+1:t4:

An option is to refrence the model number in the selector. I have mine cause that there are more model numbers out there for the double rocker. If this is the case for the single rocker one too then leave it as it is. If the single rocker one has only one model number, then change it like below and only the aquara single rocker switches are shown.

      selector:
        device:
          integration: zha
          manufacturer: LUMI
          model: xxxxxxx

So far everything works with the it (single, double, long press), so the commands are good too.

I only have one single rocker, and that one has a model number of WXKG03LM (my double rocker switch is model WXKG02LM). I tried to search around if there’s any other, and this site says it’s the EU version, so I guess there are multiple models. But this is not definitive, so maybe others will experience something different. I don’t know honestly.

I meant if your entity is called lumi.remote.b286acn02, then the b286acn02 part. Thought it was called the model number, but can be something else. Its a model specific size an can be put in the selector under “model” and is a way to filter the selector so only your model is shown and not toher stuff from the manuifacturer. This can also be overfilter the selector like in my case where was also a model b286acn01 out there :smile: Just as a information for future blueprints, especially useful for ZHA

Ahhhh, okay, yeah got it. The single rocker for me b186acn01 and the double rocker is b286acn01. So there might actually be more than one models for the single rocker too.

My Single Rocker switch (WXKG03LM) has “model id”:
lumi.remote.b186acn01.

My Double Rocker switch (WXKG02LM) has “model id”:
lumi.remote.b286acn01

(I only have one each so far)

Dunno if they are some EU model or not (bought in Sweden from “netonnet”).

Yeah maybe. Theres a feature request open (Allow using a list in blueprint selectors) so you cann add a list of model numbers to avoid this. But state of the art you can only use a wider selector

Alright, I was able to get it working in an automation, but not in your blueprint. I’m only getting 3 triggers from it, left, right, and both. Luckily, that works for my uses. It doesn’t look like my device integration is passing on the device_id, which is a long string of characters. The buttons are tied to the" endpoint_id" which goes 1=left, 2=right, 3=both. I’m happy having gotten this figured out. Thank you for your help!

Here’s how it turned out.

alias: Double Rocker Left Button
description: 'Automation for Aqara Double Rocker Model WXKG02LM'
mode: single
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: #get your device ID from listening to zha_event in the Developer Tools Event's tab
      endpoint_id: 1
action:
  service: homeassistant.toggle
  entity_id: light.shelly_1_light
1 Like

Okay So I could convert this to a blueprint if you like, then you have one blueprint/automation and not 3 seperate ones for each type of button press

1 Like

Thank you, but I’m okay with my automations. I just wanted to be sure to post it here in case anyone else is looking for the information.

1 Like

yes please same issue here

Sorry for replying late, I’m in the mid of my exams for this semester. I modified my blueprint for the lumi.sensor_86sw2 model one given by the information of @looknsharp . You have to test it by your own though, because I have the lumi.remote.b286acn01 one.

blueprint:
  name: ZHA - Aqara Wireless Remote Switch (Double Rocker)
  description: Automate your Xiaomi Aqara Wireless Remote Switch (Double Rocker) (lumi.sensor_86sw2 Version) using ZHA events.
  domain: automation
  input:
    aqara_mini_switch:
      name: Select the Aqara Wireless Remote Switch (Double Rocker)
      description: Aqara Wireless Remote Switch (Double Rocker)
      selector:
        device:
          integration: zha
          manufacturer: LUMI
          entity:
            domain: sensor
            device_class: battery
    button_press_left:
      name: Single Press Left
      description: Action to run on single press
      default: []
      selector:
        action:
    button_press_right:
      name: Single Press Right
      description: Action to run on single press
      default: []
      selector:
        action:
    button_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_mini_switch

action:
  - variables:
      command: "{{ trigger.event.data.endpoint_id}}"

  - choose:
      - conditions:
          - "{{ command == 1 }}"
        sequence: !input button_press_left
      - conditions:
          - "{{ command == 2 }}"
        sequence: !input button_press_right
      - conditions:
          - "{{ command == 3 }}"
        sequence: !input button_press_both
1 Like

Hi and a big thank you for this blueprint.

Do you know of any (easy) way to make the long press on each button to increase and decrease the brightness of a light?

Can this be done using your blueprint and a script, automation, input boolean? Or must we go via the custom yaml path?

I truly believe that increasing and decreasing the brightness via long press is searched and wanted by many users and I also think it would be a great addition to the functionality of switches such as this one.

Because the switch hasnt a event when a button is released, theres no clean and good way for that. One workaround could be to execute a script with a repeat loop which checks if a button is pressed. eg if you hold the left button long, you can repeat the increase brightness until the left button is short pressed (you have to work with a event).

Dont know if this works, but its the only solution i can imagine. As said, there is no clean solution i know of for that switch

Thank you very much sir, you saved my day hehe