question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Device Support Request] Aqara H1 wireless switch double rocker (model WRS-R02)

See original GitHub issue

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I’m always frustrated when […] The device is not yet supported in ZHA but I saw that it received support in zigbee2mqtt https://www.zigbee2mqtt.io/devices/WRS-R02.html

Describe the solution you’d like A clear and concise description of what you want to happen. Support for single/double/triple/long press of left/right & both buttons.

Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.

{
  "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=<LogicalType.EndDevice: 2>, *user_descriptor_available=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0103",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003"
      ],
      "out_clusters": [
        "0x0003",
        "0x0006"
      ]
    },
    "2": {
      "profile_id": null,
      "device_type": "",
      "in_clusters": [],
      "out_clusters": []
    },
    "3": {
      "profile_id": 260,
      "device_type": "0x0103",
      "in_clusters": [
        "0x0003"
      ],
      "out_clusters": [
        "0x0006"
      ]
    },
    "4": {
      "profile_id": null,
      "device_type": "",
      "in_clusters": [],
      "out_clusters": []
    },
    "5": {
      "profile_id": null,
      "device_type": "",
      "in_clusters": [],
      "out_clusters": []
    },
    "6": {
      "profile_id": null,
      "device_type": "",
      "in_clusters": [],
      "out_clusters": []
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.remote.b28ac1",
  "class": "zigpy.device.Device"
}

Additional context Add any other context or screenshots about the feature request here.

The device was paired in home assistant’s ZHA integration but not working properly. Both buttons behave as the same button. Below is the result of zha_event listening

Right button single press

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "EDITED OUT",
        "unique_id": "EDITED OUT",
        "device_id": "EDITED OUT",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-26T13:43:42.499260+00:00",
    "context": {
        "id": "b9d5f1afde358915f8619d1153832a07",
        "parent_id": null,
        "user_id": null
    }
}

Left button single press

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "EDITED OUT",
        "unique_id": "EDITED OUT",
        "device_id": "EDITED OUT",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-06-26T13:43:32.947572+00:00",
    "context": {
        "id": "d35c686ec88e197fa8f7adad07ad1b72",
        "parent_id": null,
        "user_id": null
    }
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:18
  • Comments:136 (38 by maintainers)

github_iconTop GitHub Comments

12reactions
xuxiaoqiaocommented, Dec 30, 2021

Hey everyone,

I’ve finished my prototype zhaquirk which (hopefully) will work with WRS-R02.

Just in case you don’t have experience with custom zha quirks before, here are the steps:

  1. create a custom_zha_quirks folder under the home assistant config folder
  2. add the configurations below to enable zha quirks in the home assistant configuration.yaml
zha:
  enable_quirks: True
  custom_quirks_path: custom_zha_quirks
  1. put the aqara_h1_remote.py https://gist.github.com/xuxiaoqiao/6ed8dcb950f26337218d0507733970a0#file-aqara_h1_remote-py in the custom_zha_quirks folder

  2. reload the ZHA home assistant integration, or just reboot the whole home assistant

  3. Home Assistant ➡️ Configuration ➡️ Devices & Services ➡️ Find the H1 Wireless Remote Device. You should see Quirk: aqara_h1_remote.RemoteH1DoubleRocker in the Device Info section. If it’s not the case, maybe I’ve made some mistake in the quirk signature.

  4. (Just to be safe) remove the H1 remote device and pair again.

  5. Now in Home Assistant ➡️ Developer Tools ➡️ Events ➡️ Listen to events, fill zha_event and press start listening. When you press the Aqara H1 remote, you should see something.

  6. Then you might want to set the H1 Remote to your desired mode:

    1. Home Assistant ➡️ Configuration ➡️ Devices & Services ➡️ (Find your H1 Remote device) ➡️ Manage Clusters ➡️ Select AqaraRemoteManuSpecificCluster (Endpoint id: 1, Id: 0xfcc0, Type: in) ➡️ See “Cluster Attributes”
    2. For operation_mode (id: 0x0009): Fill your desired value, set “Manufacturer Code Override” to 4447, press “Set Zigbee Attribute”. You may need to press H1 remote five times quickly to wake it up.
      • Value 0 means “command” mode, aka LO (Light and occupancy) mentioned by @MattWestb. In the “command” mode, the remote will send commands like “toggle” or “off”. You can bind the device with a light (it works like ikea tradfri remotes). Pro: when you bind to a specific light, the button works even when home assistant is down. Con: Limited customization. Btw, it seems there’s no way to differentiate the left/right button in this mode.
      • Value 1 means “event” mode. In the “event” mode, the remote will send generic click events to HA, and HA is responsible for the automation. When HA is down, the automation is down. But it allows more customization. I’m using this mode.
    3. For click_mode (id: 0x0125), set it similarly.
      • value 1 means single click mode. This mode has lower delay but only detects single click events. This is the default mode after factory reset.
      • value 2 means multiple click mode. This mode has a slightly higher delay but detects single/double/triple click and long press. I’m using this mode.
    4. FYI here’s the behavior of my aqara h1 single button remote under different settings.
      • click_mode=1 and operation_mode=0
        • single click: sends toggle zha_event
      • click_mode=2 and operation_mode=0
        • single click: toggle zha_event
        • double click: off zha_event
      • click_mode=1 and operation_mode=1
        • single click: 1_single zha_event
      • click_mode=2 and operation_mode=1
        • single click: 1_single zha_event
        • double click: 1_double zha_event
        • triple click: 1_triple zha_event
        • long press: 1_hold zha_event
  7. Done. When you press the button, a zha_event will be triggered, which can be used in automation. The device trigger might help your automation as well demo of device trigger setting

7reactions
thomasfrcommented, Sep 15, 2021

Would love to see support too. I was able to pair it on HomeAssistant via ZHA on A RPi with Raspbee2 but it does not show any entities except a malfunctioning power/battery entity. Events only show toggle commands for both buttons

Read more comments on GitHub >

github_iconTop Results From Across the Web

ZHA - Support for Aqara H1 wireless switch double rocker
Hello, I own an Aqara H1 wireless switch (WRS-R02), double rocker (model WRS-R02), but there is no support for it in ZHA.
Read more >
Wireless Remote Switch H1 - Aqara
The Aqara Wireless Remote Switch H1 (Double Rocker) has two modes. It supports single press in the high-speed click mode, and 7 functions...
Read more >
Aqara H1 Wireless Remote Switch (Double Rocker) WRS-R02 ...
Press and hold the button on the device until the blue light starts blinking, release it and the pairing should begin. If you're...
Read more >
Aqara H1 Double Rocker Wireless Remote Switch User Manual
* An Aqarahub is required. Some functions require specific models of the Aqara hub. Please visit www.aqara.com/support for more details.
Read more >
Aqara wireless H1 double rocker switch - Hubitat Community
This remote looks really interesting! Can you confirm your device is the WRS-R02 model? kkossev ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found