Aqara H1 remote switch with Home Assistant – how to enable double/long clicks
I have used older Aqara switches before with Home Assistant and ZHA. Using the newer H1 I was surprised some things were not working out of the box. Here is how to fix possible issues.
The Aqara H1 remote switch
Aqara is selling a wide range of quite popular smart home related products. Most of their devices work really well, are quite cheap and look (in my opinion) pretty sleek and often better looking than most alternatives. Of course they also sell their own hub and app but as they mostly use Zigbee you can also directly include them into Home Assistant via ZHA or Zigbee2MQTT.
If you want to support the blog consider buying a switch via this affiliate link
Aqara H1 double rocker wireless switch
Aqara H1 single rocker in wall switch
Sonoff Zigbee 3.0 dongle plus as controller
+ a USB extension to avoid interference
I have used a bunch of their devices including in wall switches, a thermostat, a smart plug, a mini button and some more. While their older devices do run on Zigbee they don’t always respect the Zigbee specs 100% which can sometimes lead to problems. While I have never really ran into any issues I was happy to hear that they (hopefully) fixed this in their newer products by fully supporting Zigbee 3.0.
I have already used a lot of their older wireless switches for years but recently I needed another switch and bought their new version: the H1 remote switch. I got the battery powered version using two rockers. The design looks slightly different but still quite stylish. The buttons now look a bit “sharper” and include a small LED in each one. The best part are the new switches themselves though: clicking one of the buttons now feels super satisfying.
Opening up the switch shows a neat layout inside and another important change: the switches are now using the bigger CR2450 coin cells for power. This should increase the battery life (they promise 5 years) but also means I need to buy another size of batteries where (I am pretty sure) older models were using the more common CR2032 coin cells.
Pairing the Aqara H1 switch with Home Assistant
Pairing Aqara devices with ZHA is usually pretty simple. Just activate pairing mode in ZHA and the press the button(s) of the switch for around 10 seconds until the LEDs start blinking. As with most devices I had to move the switch pretty close to my controller for initial pairing. I do have this issue with pretty much all devices though for some reason. Once paired I can move it wherever I want though.
I suggest using the newest version of Home Assistant available for you when using this device. I used 2023.9.2 and that already seems to include the custom quirk needed for the H1. It shows up as a lumi.remote.b28ac1 using the
Once paired you can start using the switch right away and it works quite well. I did run into one strange issue though: while I see click events in
zha_event (go to developer tools – events – start listening) I can’t seem to get any double clicks, long clicks or a click on both buttons at the same time.
Enabling double/long clicks on the Aqara H1 switch
Fortunately I quickly found the reason for the missing double/long/special click. According to this post there are different click and operation modes for the switch. By default the H1 switch uses click mode 1: a single click mode that is fast but does not support more complicated clicks.
You can confirm the used the click mode used by your H1 switch by find the switch in ZHA and clicking the “manage zigbee device” button in the menu.
A new popup will open where you can select the clusters tab. In the tab select the “AqaraRemoteManuSpecificCluster” and click the read attribute button. Then quickly press the left button of the switch five times to make sure it wakes up and is available. After a short time the current value of the cluster should be shown in the value field.
You can read the operation mode by switching to it in the dropdown and following the same flow.
If all you need are single clicks or you look for the quickest reaction time you can keep the switch in click mode 1. If you need support for more click types you can switch to mode 2 by setting writing the value in the “value” field and clicking the write attribute button. Make sure to wake up the switch again via five left clicks.
You should now be able to see double/tripple/long/both button clicks via the zha_event stream. They are called
1_single for the left button and
2_single for the right button. There are similar
1_long for double and long clicks as well as
3_single events for a click on both buttons. These can be used in any automations like this one for example.
alias: Button toggle kitchen bulb
- platform: event
- type: toggle
The automation simply toggles a smart light bulb based on the left button of the H1 switch. I have a similar automation using the right button for another light and a double click for a more advanced automation.
By the way, the operation mode can be used to set the button to command mode (can be directly paired to a device but apparently you can differentiate between left/right click anymore) or event mode (just send events, Home Assistant will handle the rest). I did not change the default settings here.
Overall the H1 switch is still a great device. The new buttons make the “clicky” feeling amazing and the battery should last a bit longer. Compared to the older version the need for a new battery format and the default mode that does not support double/long clicks is a bit annoying though. Fortunately this can be easily fixed via ZHA and works great with my Zigbee network.