Aqara h1 button press not triggering automation

The Aqara Wireless Remote Switch H1 Double Rocker has quite a few events you can use for the trigger:

I had been trying to use any of the “Left”/ “Right” button xxx events but none of them worked.

I’ve been playing around with NodeRED lately and I hooked up a debugger to the output of the switch. This way I discovered the only event that is sent when pressing either button is the “button” button pressed (Alternate mode) event. This event is fired for either the left or the right button and makes no distinction between short or long presses or multiple presses (double clicking). In the context it does send unique id’s for the left and right buttons but I can’t figure out how to use that in my trigger.

I’ve used the “button” button pressed (Alternate mode) event as my trigger now, but as you’d expect the automation is now triggered by both left and right buttons being pressed. Not what I was hoping for. But this also means I can’t detect double clicking or long presses or both buttons being pressed simultaneously. Functions I was hoping to use later on.

alias: Switch lights at the bottom of the stairs
description: ''
trigger:
  - device_id: 5ae3031cc21a64f56ac304836170b4d5
    domain: zha
    platform: device
    type: remote_button_alt_short_press
    subtype: button
    id: SwitchLandingTrigger
condition: []
action:
  - type: toggle
    device_id: ceffc466a2d94029f5a2a974ad9aea00
    entity_id: light.lumi_lumi_switch_l1aeu1_44452200_on_off
    domain: light
mode: single

Can someone help me to get the trigger to distinguish what button was pressed?

1 Like

Hi,

I had some problem, and it’s because of the “operation mode” the switch is in. As you’ve found out, your switch will only trigger the “alternate” mode event rather than the individual sides.

Changing this is reasonably easy. Find the device from your devices/integration page.

Click manage clusters in bottom left.

Select the AqaraRemoteManuSpecificCluster option from the drop down.

Select “operation_mode” from the attribute drop down list:
image

Now click a switch button 5 times and as soon as the LED flashes blue click “get Zigbee Attribute”. If Home Assistant can reach your switch the value will populate as “0” as in my last screenshot.

Now, change the value to “1” and the manufacturer override code as “4447”.

Wake the device again by pressing a switch 5 times an as soon as it’s flashing, hit the “set zigbee attribute button”.

If this worked correctly, you should be able to go back to an automation and you’ll find the left/right presses are now working as you’d expect. If not, go back to the cluster and the attribute mentioned below, and make sure when you “get” the attribute, it’s coming back as “1” and not “0”. If it comes back as “0” it means your “set” command didn’t work and you’ll have to keep trying to wake and set until it works :slight_smile:

9 Likes

I’m having the same problem. I navigate to the same page but there’s no option for AqaraRemoteManuSpecificCluster option unfortunately. I’ve checked all the others, to see if there’s an attribute for operation_mode to no avail. Any suggestions anyone please?

Have you find it?

I did, but I needed to change from ZHA to Z2M for it to work.

1 Like

Yes thank you, me too

The battery in my switch died and since I was having trouble using this switch and was only using it to switch one single light, I decided to use a sonoff button I had lying around. I basically gave up on the aqara switch…

Thanks for your advice! I will give this a go and see if I can get it working.

That’s good to know, I will probably have to switch to Z2M as well. Now to google what that means and how to do it :slight_smile:

Hi,

I’m having the same trouble, the switch when pressed doesn’t trigger the automation. I cannot find the cluster option mentioned above.

I use a cronbee ii and deconz if that’s anything to do with it?

I am interested in the Aqara wireless double-rocker switch H1 (WRS-R02).
I have a Conbee II stick with Deconz.
Is it really a pain to use in Home Assistant out of the box with this coordinator/integration ?

I have the previous version (WXKG02LM with no light on the front) and it works fine.

I’ve just received my Aqara H1 (wireless double-rocker) and successfully added it in Deconz (I’m using a Conbee 2 stick)

image

The problem is no action are exposed when trying to add trigger in an automation : only the Battery level shows up :crying_cat_face:

I do catch events if I start listening to deconz_event and push either buttons :

Anyone else got more lucky with this H1 device with Deconz / Conbee 2 ?

NB : I see all available actions (single/double/long left/right buttons) when using my Aqara WXKG02LM model.

I found a different way using the event_type as a trigger like so to toggle the right button for instance :

alias: Aqara H1 Toggle dining room pendant lights
description: ""
trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      id: aqara_switch_dining_room
      unique_id: 54:ef:44:10:00:06:5f:e8
      event: 2002
      device_id: 77d17f9d2a63cc777023d3f5f60aad1a
condition: []
action:
  - service: homeassistant.toggle
    data:
      brightness_pct: |
        {% if is_state('sun.sun', 'above_horizon') %}
          40
        {% else %}
          70
        {% endif %}
      kelvin: |
        {% if is_state('sun.sun', 'above_horizon') %}
          3500
        {% else %}
          2700
        {% endif %}
    target:
      entity_id: light.dining_pendant_lights
mode: single

I wish the actions were directly exposed on the device in the automation though for a much more user-friendly approach.
Or I could look for a blueprint to simplify and not have to create automations for each and every single action.

[Edit] Ok, so apparently, that’s how it’s supposed to work, that is use the deconz_event (or the zha_event depending on your integration) to use in automations.

1 Like

Thank you for sharing this.

I aslo have Deconz/Conbee and do not have this Cluster Attributes menu.
It’s only available with Z2M (Zigbee2MQTT) if I understood correctly.

Amazing.
This workee. But in ZHA i still can use only left click and right click. I cannot use double click or continuosly pressing. Is there another option to set?

Works well! Thanks a million!

Have you found how to use double press or long press on an Aqara switch on ZHA? I use a wired no-neutral H1 EU switch and it only triggers in short press.

If I do a double press, it turns the light on and off, or simply ignores the second press if they’re on very rapid succession.

I might be mistaken but, I believe that unlike the wireless H1 switch, the wired H1 EU switch only supports single press. The long press on the H1 EU wired switches is used to delete pairing (from Aqara hub) and initiate pairing mode.

Smart Wall Switch H1 EU (No Neutral) - User manual - Aqara

EDIT: I found the article linked below, about the wireless switch and had a nose at the “Manage Zigbee Device” dialog for my H1 EU and it didn’t appear to offer a “click_mode” attribute.
Aqara H1 remote switch with Home Assistant - how to enable double/long clicks » The smarthome journey

You’re not. Only the wireless aqara switch supports long press.

I spent way too much time trying to get long press to work on my H1m and reached the same conclusion - long press on wired switches causes them to unpair

1 Like

Just wanted to say thank you this worked perfectly for my switch, both left and right are working!