ZHA - Aqara Wireless Remote Switch (Double Rocker)

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

Ive just moved over to ZHA and apparently I have a mixture of the 2 different types and this topic has been a huge help.
For those that identify as lumi.sensor_86sw2 they support press and release so the blueprint posted above to make these things work is triggered every time the button is pressed. This means a simple light toggle doesnt work.

Ive modified the blueprint for this.

blueprint:
  name: ZHA - Aqara Wireless Remote Switch (Double Rocker 86sw2)
  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 }}"
      pressed: "{{ trigger.event.data.args.value }}"

  - choose:
      - conditions:
          - "{{ command == 1 }}"
          - "{{ pressed == 'Bool.true' }}"
        sequence: !input button_press_left
      - conditions:
          - "{{ command == 2 }}"
          - "{{ pressed == 'Bool.true' }}"
        sequence: !input button_press_right
      - conditions:
          - "{{ command == 3 }}"
          - "{{ pressed == 'Bool.true' }}"
        sequence: !input button_press_both

I have no idea why pressed cannot simply be true or false but it works and im sure theres someone way smarter than me out there that can pointout what the hell is going on.

4 Likes

Hi there, I also have WXKG02LM, and I having trouble to make this work. I would prefer the blueprint. Can you share it?

Hi,
I have a Wireless Remote Switch H1 Double Rocker made in 05/2021 and bought from a web shop in France.
Entity is lumi.remote.b28ac1.

I had great hope from this blueprint but sadly it doesn’t work for me :frowning: like… of course :stuck_out_tongue:
Nothing happens with it.

Event with whatever I do (left/right/single/long/double):
Only two informations change: “time_fired” and “context”: { “id” }

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "54:ef:44:10:00:12:37:94",
        "unique_id": "54:ef:44:10:00:12:37:94:1:0x0006",
        "device_id": "11da6dd18dba7fe06d7c72f2ef7416fd",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-10-15T11:48:55.825210+00:00",
    "context": {
        "id": "07d05d0f5174d45f9600a320e1d3b0ee",
        "parent_id": null,
        "user_id": null
    }
}

FYI, I can create an automation with this trigger:

platform: event
event_type: zha_event
event_data:
  device_id: 11da6dd18dba7fe06d7c72f2ef7416fd
  endpoint_id: 1

Can I do something myself? Like tweaking a little something?
Or is it again a different product? If so would you be so kind to update your blueprint? :slight_smile:

Anyway, thanks for your great work on this!

Hi @NachtaktiverHalbaffe ,
ive been trying to get the Aqara Wireless Remote Switch H1 Double Rocker to work with Odroid N2+ Home Assistant Blue, using a ConBee II USB Zigbee-controller.
as per the info in settings its a Aqara 2019 modell.

i managed to add the device, but when checking the zha_event i get the same event over and over.
doset matter if i double click (left or right), hold (left or right) or just simple click (left or right).

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "54:ef:44:10:00:06:51:5e",
        "unique_id": "54:ef:44:10:00:06:51:5e:1:0x0006",
        "device_id": "064fbd90b296072636c8ec97f2d818b8",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-10-25T16:12:27.091423+00:00",
    "context": {
        "id": "a0cb3a09fe4fa9ae0da921f0cfe1b473",
        "parent_id": null,
        "user_id": null
    }
}
Event 0 fired 18:12:
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "54:ef:44:10:00:06:51:5e",
        "unique_id": "54:ef:44:10:00:06:51:5e:1:0x0006",
        "device_id": "064fbd90b296072636c8ec97f2d818b8",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-10-25T16:12:26.423373+00:00",
    "context": {
        "id": "871236f6fb34baa3e5d658451c9d12cb",
        "parent_id": null,
        "user_id": null
    }
}

So just to be clear.
Will i need both the integration for zigbee and deCONZ?
Tried both tho, when just using the Zigbee integration i get the event logs, while on deCONZ i dont get any event logs.

Im a 100% new to this, so please do state even the obvious.

Best regards, a confused swede

Hi! I am in exactly the same situation as you.
I have the same model and I have the same problem, you can only use the two buttons as if it were a device …

Did you get something else? Do you think there will be any improvement in this?

Sounds like zha needs to add a quirk to fix these devices

ZHA Device Handlers
ZHA deviation handling in Home Assistant relies on the third-party ZHA Device Handlers project. Zigbee devices that deviate from or do not fully conform to the standard specifications set by the Zigbee Alliance may require the development of custom ZHA Device Handlers (ZHA custom quirks handler implementation) to for all their functions to work properly with the ZHA component in Home Assistant. These ZHA Device Handlers for Home Assistant can thus be used to parse custom messages to and from non-compliant Zigbee devices. The custom quirks implementations for zigpy implemented as ZHA Device Handlers for Home Assistant are a similar concept to that of Hub-connected Device Handlers for the SmartThings platform as well as that of zigbee-herdsman converters as used by Zigbee2mqtt, meaning they are each virtual representations of a physical device that expose additional functionality that is not provided out-of-the-box by the existing integration between these platforms.