This blueprint will let you create automations for the Aqara Wireless Remote Switch (Single Rocker). It uses ZHA, and supports single, double and long presses.
The blueprint is based on ZHA - Aqara Wireless Remote Switch (Double Rocker) (credit to NachtaktiverHalbaffe) and ZHA - Aqara Wireless Mini Switch (credit to SeanM). As both of them point out in their blueprints, there are multiple versions of these switches, and some of them may not work. Please make sure to check out both of their posts to be sure you have all the information you need before you purchase one! I have a compatible switch (luckily), and I am using this blueprint on my current setup with no issues so far.
Blueprint:
blueprint:
name: ZHA - Aqara Wireless Remote Switch (Single Rocker)
description: Automate your Xiaomi Aqara Wireless Remote Switch (Single Rocker) using ZHA events.
domain: automation
input:
aqara_mini_switch:
name: Select the Aqara Wireless Remote Switch (Single Rocker)
description: Aqara Wireless Remote Switch (Single Rocker)
selector:
device:
integration: zha
manufacturer: LUMI
entity:
domain: sensor
device_class: battery
button_single_press:
name: Single Press
description: Action to run on single press
default: []
selector:
action:
button_double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action:
button_long_press:
name: Long Press
description: Action to run when button is long pressed (held down)
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.command }}"
- choose:
- conditions:
- "{{ command == 'single' }}"
sequence: !input button_single_press
- conditions:
- "{{ command == 'double' }}"
sequence: !input button_double_press
- conditions:
- "{{ command == 'long press' }}"
sequence: !input button_long_press
Hi, I have an old Aqara Single Rocker (2016), the model is lumi.sensor_86sw1. Switch doesn’t support double or long press. But that’s ok, skip it
This switch successfully integrates with ZHA, however event data is different and blueprint doesn’t work for a single press.
I’ve modified this blueprint to work with the old version (part of the code with variables and conditions for single press action):
I have also an older version of Aqara Single Rocker, it is pairing with the Sonoff Zigbee 3.0 USB Dongle V2 (ZBDongle-E). I get the battery, temperature and identify, but when i press the button nothing happens.
Also no zha_event is triggered since i have listened for them.
Does some one knows how to solve it?
I’ve been using your modification for a long time for my WXKG03LM. It stopped working as of the newest 2023.8 release. Would you know what needs to be modified for it to work again?
Edit: to make it clear, the blueprint turns on the light(s) but never turn them off again.
I want use only short_single_click for my lumi.sensor_86sw1. Basically it works but only for simple actions like light on/off.
Unfortunately i must use something more complicaated eg: