Here is the Aqara wireless remote switch H1 (double rocker) blueprint, test with WXKG15LM, I think it also can be used with WRS-R02
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: Scene & device control using Aqara two button remote
domain: automation
input:
button_sensor:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
button_left_single_press:
name: Left button - Single press
description: Action to run on a single press of the left button
default: []
selector:
action: {}
button_left_double_press:
name: Left button - Double press
description: Action to run on a double press of the left button
default: []
selector:
action: {}
button_left_triple_press:
name: Left button - Triple press
description: Action to run on a triple press of the left button
default: []
selector:
action: {}
button_left_hold:
name: Left button - Hold
description: Action to run when left button is held
default: []
selector:
action: {}
button_right_single_press:
name: Right button - Single press
description: Action to run on a single press of the right button
default: []
selector:
action: {}
button_right_double_press:
name: Right button - Double press
description: Action to run on a double press of the right button
default: []
selector:
action: {}
button_right_triple_press:
name: Right button - Triple press
description: Action to run on a triple press of the right button
default: []
selector:
action: {}
button_right_hold:
name: Right button - Hold
description: Action to run when right button is held
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'button_sensor'
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''button_1_single'' }}'
sequence: !input 'button_left_single_press'
- conditions:
- '{{ command == ''button_1_double'' }}'
sequence: !input 'button_left_double_press'
- conditions:
- '{{ command == ''button_1_triple'' }}'
sequence: !input 'button_left_triple_press'
- conditions:
- '{{ command == ''button_1_hold'' }}'
sequence: !input 'button_left_hold'
- conditions:
- '{{ command == ''button_2_single'' }}'
sequence: !input 'button_right_single_press'
- conditions:
- '{{ command == ''button_2_double'' }}'
sequence: !input 'button_right_double_press'
- conditions:
- '{{ command == ''button_2_triple'' }}'
sequence: !input 'button_right_triple_press'
- conditions:
- '{{ command == ''button_2_hold'' }}'
sequence: !input 'button_right_hold'
I tried to set it up but I can’t seem to get it to recognizes my Aqara H1 switches? It says not matching devices found? Im using Aqara Wireless Remote Switch H1 dubble switches.
Im using a Aqara Hub M2 however its connected via HomeKit directly to HA.
The model nr I get when I look at HA shows up as AR009. Would I need to connect it to the application to get the exact model nr?
Hopefully it still would work even tho I use it via M2 hub and HomeKit.
Hello! The actions have been updated so I edited this blueprint and added three new functions. Double and triple press both & hold both.
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: Scene & device control using Aqara two button remote
domain: automation
input:
button_sensor:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
button_left_single_press:
name: Left button - Single press
description: Action to run on a single press of the left button
default: []
selector:
action: {}
button_left_double_press:
name: Left button - Double press
description: Action to run on a double press of the left button
default: []
selector:
action: {}
button_left_triple_press:
name: Left button - Triple press
description: Action to run on a triple press of the left button
default: []
selector:
action: {}
button_left_hold:
name: Left button - Hold
description: Action to run when left button is held
default: []
selector:
action: {}
button_right_single_press:
name: Right button - Single press
description: Action to run on a single press of the right button
default: []
selector:
action: {}
button_right_double_press:
name: Right button - Double press
description: Action to run on a double press of the right button
default: []
selector:
action: {}
button_right_triple_press:
name: Right button - Triple press
description: Action to run on a triple press of the right button
default: []
selector:
action: {}
button_right_hold:
name: Right button - Hold
description: Action to run when right button is held
default: []
selector:
action: {}
button_hold_both:
name: Both buttons - Hold
description: Action to run when both, left and right button is held
default: []
selector:
action: {}
button_double_both:
name: Both buttons - Double press
description: Action to run on a double press of the right and left button
default: []
selector:
action: {}
button_triple_both:
name: Both buttons - Triple press
description: Action to run on a triple press of the right and left button
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'button_sensor'
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''single_left'' }}'
sequence: !input 'button_left_single_press'
- conditions:
- '{{ command == ''double_left'' }}'
sequence: !input 'button_left_double_press'
- conditions:
- '{{ command == ''triple_left'' }}'
sequence: !input 'button_left_triple_press'
- conditions:
- '{{ command == ''hold_left'' }}'
sequence: !input 'button_left_hold'
- conditions:
- '{{ command == ''single_right'' }}'
sequence: !input 'button_right_single_press'
- conditions:
- '{{ command == ''double_right'' }}'
sequence: !input 'button_right_double_press'
- conditions:
- '{{ command == ''triple_right'' }}'
sequence: !input 'button_right_triple_press'
- conditions:
- '{{ command == ''hold_right'' }}'
sequence: !input 'button_right_hold'
- conditions:
- '{{ command == ''hold_both'' }}'
sequence: !input 'button_hold_both'
- conditions:
- '{{ command == ''double_both'' }}'
sequence: !input 'button_double_both'
- conditions:
- '{{ command == ''triple_both'' }}'
sequence: !input 'button_triple_both'
Blueprint is not working for me too. The automation just doesn’t fire, so even no trace to look at.
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: Scene & device control using Aqara two button remote
domain: automation
input:
button_sensor:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
button_left_single_press:
name: Left button - Single press
description: Action to run on a single press of the left button
default: []
selector:
action: {}
button_left_double_press:
name: Left button - Double press
description: Action to run on a double press of the left button
default: []
selector:
action: {}
button_left_triple_press:
name: Left button - Triple press
description: Action to run on a triple press of the left button
default: []
selector:
action: {}
button_left_hold:
name: Left button - Hold
description: Action to run when left button is held
default: []
selector:
action: {}
button_right_single_press:
name: Right button - Single press
description: Action to run on a single press of the right button
default: []
selector:
action: {}
button_right_double_press:
name: Right button - Double press
description: Action to run on a double press of the right button
default: []
selector:
action: {}
button_right_triple_press:
name: Right button - Triple press
description: Action to run on a triple press of the right button
default: []
selector:
action: {}
button_right_hold:
name: Right button - Hold
description: Action to run when right button is held
default: []
selector:
action: {}
button_hold_both:
name: Both buttons - Hold
description: Action to run when both, left and right button is held
default: []
selector:
action: {}
button_double_both:
name: Both buttons - Double press
description: Action to run on a double press of the right and left button
default: []
selector:
action: {}
button_triple_both:
name: Both buttons - Triple press
description: Action to run on a triple press of the right and left button
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'button_sensor'
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''single_left'' }}'
sequence: !input 'button_left_single_press'
- conditions:
- '{{ command == ''double_left'' }}'
sequence: !input 'button_left_double_press'
- conditions:
- '{{ command == ''triple_left'' }}'
sequence: !input 'button_left_triple_press'
- conditions:
- '{{ command == ''hold_left'' }}'
sequence: !input 'button_left_hold'
- conditions:
- '{{ command == ''single_right'' }}'
sequence: !input 'button_right_single_press'
- conditions:
- '{{ command == ''double_right'' }}'
sequence: !input 'button_right_double_press'
- conditions:
- '{{ command == ''triple_right'' }}'
sequence: !input 'button_right_triple_press'
- conditions:
- '{{ command == ''hold_right'' }}'
sequence: !input 'button_right_hold'
- conditions:
- '{{ command == ''hold_both'' }}'
sequence: !input 'button_hold_both'
- conditions:
- '{{ command == ''double_both'' }}'
sequence: !input 'button_double_both'
- conditions:
- '{{ command == ''triple_both'' }}'
sequence: !input 'button_triple_both'
editing the blueprints .yaml worked for me ( 2022.6.6 )
you might have to reload automations and create a new automation for it
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: Scene & device control using Aqara two button remote
domain: automation
input:
button_sensor:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
multiple: false
single_left:
name: Left button - Single press
description: Action to run on a single press of the left button
default: []
selector:
action: {}
double_left:
name: Left button - Double press
description: Action to run on a double press of the left button
default: []
selector:
action: {}
triple_left:
name: Left button - Triple press
description: Action to run on a triple press of the left button
default: []
selector:
action: {}
hold_left:
name: Left button - Hold
description: Action to run when left button is held
default: []
selector:
action: {}
single_right:
name: Right button - Single press
description: Action to run on a single press of the right button
default: []
selector:
action: {}
double_right:
name: Right button - Double press
description: Action to run on a double press of the right button
default: []
selector:
action: {}
triple_right:
name: Right button - Triple press
description: Action to run on a triple press of the right button
default: []
selector:
action: {}
hold_right:
name: Right button - Hold
description: Action to run when right button is held
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/z2m-aqara-h1-wrs-r02-wireless-remote-switch-double-rocker/376959/7
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'button_sensor'
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''single_left'' }}'
sequence: !input 'single_left'
- conditions:
- '{{ command == ''double_left'' }}'
sequence: !input 'double_left'
- conditions:
- '{{ command == ''triple_left'' }}'
sequence: !input 'triple_left'
- conditions:
- '{{ command == ''hold_left'' }}'
sequence: !input 'hold_left'
- conditions:
- '{{ command == ''single_right'' }}'
sequence: !input 'single_right'
- conditions:
- '{{ command == ''double_right'' }}'
sequence: !input 'double_right'
- conditions:
- '{{ command == ''triple_right'' }}'
sequence: !input 'triple_right'
- conditions:
- '{{ command == ''hold_right'' }}'
sequence: !input 'hold_right'
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: Scene & device control using Aqara two button remote
domain: automation
input:
button_sensor:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
multiple: false
single_left:
name: Left button - Single press
description: Action to run on a single press of the left button
default: []
selector:
action: {}
double_left:
name: Left button - Double press
description: Action to run on a double press of the left button
default: []
selector:
action: {}
triple_left:
name: Left button - Triple press
description: Action to run on a triple press of the left button
default: []
selector:
action: {}
hold_left:
name: Left button - Hold
description: Action to run when left button is held
default: []
selector:
action: {}
single_right:
name: Right button - Single press
description: Action to run on a single press of the right button
default: []
selector:
action: {}
double_right:
name: Right button - Double press
description: Action to run on a double press of the right button
default: []
selector:
action: {}
triple_right:
name: Right button - Triple press
description: Action to run on a triple press of the right button
default: []
selector:
action: {}
hold_right:
name: Right button - Hold
description: Action to run when right button is held
default: []
selector:
action: {}
single_both:
name: Both buttons - Single press
description: Action to run on a single press of both buttons
default: []
selector:
action: {}
double_both:
name: Both buttons - Double press
description: Action to run on a double press of both buttons
default: []
selector:
action: {}
hold_both:
name: Both buttons - Hold
description: Action to run when both buttons are held
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/z2m-aqara-h1-wrs-r02-wireless-remote-switch-double-rocker/376959/7
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "button_sensor"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'single_left' }}"
sequence: !input "single_left"
- conditions:
- "{{ command == 'double_left' }}"
sequence: !input "double_left"
- conditions:
- "{{ command == 'triple_left' }}"
sequence: !input "triple_left"
- conditions:
- "{{ command == 'hold_left' }}"
sequence: !input "hold_left"
- conditions:
- "{{ command == 'single_right' }}"
sequence: !input "single_right"
- conditions:
- "{{ command == 'double_right' }}"
sequence: !input "double_right"
- conditions:
- "{{ command == 'triple_right' }}"
sequence: !input "triple_right"
- conditions:
- "{{ command == 'hold_right' }}"
sequence: !input "hold_right"
- conditions:
- "{{ command == 'single_both' }}"
sequence: !input "single_both"
- conditions:
- "{{ command == 'double_both' }}"
sequence: !input "double_both"
- conditions:
- "{{ command == 'hold_both' }}"
sequence: !input "hold_both"
@hhalibo maybe you can update your code to the working versions for WRS-R02?
Eine ganz blöde Frage, aber ich bin neu hier: Wo muss ich drn Code einfügen, damit der Schalter funktioniert? Ich benutze die App mit grafischer Oberfläche.
It might be a silly question but I am an noobie here:
Where do I have to copy the code? I am using the homeassistant android app.
Do I have to create and upload a file with the code. Until now I only used the visuell tools to program my task.
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: Scene & device control using Aqara two button remote
domain: automation
input:
button_sensor:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
multiple: false
single_left:
name: Left button - Single press
description: Action to run on a single press of the left button
default: []
selector:
action: {}
double_left:
name: Left button - Double press
description: Action to run on a double press of the left button
default: []
selector:
action: {}
triple_left:
name: Left button - Triple press
description: Action to run on a triple press of the left button
default: []
selector:
action: {}
hold_left:
name: Left button - Hold
description: Action to run when left button is held
default: []
selector:
action: {}
single_right:
name: Right button - Single press
description: Action to run on a single press of the right button
default: []
selector:
action: {}
double_right:
name: Right button - Double press
description: Action to run on a double press of the right button
default: []
selector:
action: {}
triple_right:
name: Right button - Triple press
description: Action to run on a triple press of the right button
default: []
selector:
action: {}
hold_right:
name: Right button - Hold
description: Action to run when right button is held
default: []
selector:
action: {}
single_both:
name: Both buttons - Single press
description: Action to run on a single press of both buttons
default: []
selector:
action: {}
double_both:
name: Both buttons - Double press
description: Action to run on a double press of both buttons
default: []
selector:
action: {}
triple_both:
name: Both buttons - Triple press
description: Action to run on a triple press of both buttons
default: []
selector:
action: {}
hold_both:
name: Both buttons - Hold
description: Action to run when both buttons are held
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/z2m-aqara-h1-wrs-r02-wireless-remote-switch-double-rocker/376959/16
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "button_sensor"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'single_left' }}"
sequence: !input "single_left"
- conditions:
- "{{ command == 'double_left' }}"
sequence: !input "double_left"
- conditions:
- "{{ command == 'triple_left' }}"
sequence: !input "triple_left"
- conditions:
- "{{ command == 'hold_left' }}"
sequence: !input "hold_left"
- conditions:
- "{{ command == 'single_right' }}"
sequence: !input "single_right"
- conditions:
- "{{ command == 'double_right' }}"
sequence: !input "double_right"
- conditions:
- "{{ command == 'triple_right' }}"
sequence: !input "triple_right"
- conditions:
- "{{ command == 'hold_right' }}"
sequence: !input "hold_right"
- conditions:
- "{{ command == 'single_both' }}"
sequence: !input "single_both"
- conditions:
- "{{ command == 'double_both' }}"
sequence: !input "double_both"
- conditions:
- "{{ command == 'triple_both' }}"
sequence: !input "triple_both"
- conditions:
- "{{ command == 'hold_both' }}"
sequence: !input "hold_both"
For me I had to delete the attribute: action line for the blueprint to work, but YMMV
Did you ever figure this out? I’m connecting my wireless remote control through Hub M1S gen 2 through homekit controller to HomeAssistant and it detects as AR009 which means I don’t access to the actual sensors for the buttons pressed on the physical switch itself.
Thank you all for all the contributions. Unfortunately, none of the above blueprints worked for me, however they provided a very good start.
I was able to make it work by having this blueprint:
blueprint:
name: Z2M - Aqara H1(WRS-R02) - Wireless remote switch(double rocker)
description: control using Aqara two button remote
author: pauldcomanici
domain: automation
input:
button_action_topic:
name: zigbee2mqtt topic with action for aqara switch
description: "zigbee2mqtt topic with action for aqara switch (example: zigbee2mqtt/0.LV1 button/action)"
selector:
text:
single_left:
name: left button - single press
description: action to run on a single press of the left button
default: []
selector:
action: {}
double_left:
name: left button - double press
description: action to run on a double press of the left button
default: []
selector:
action: {}
triple_left:
name: left button - triple press
description: action to run on a triple press of the left button
default: []
selector:
action: {}
hold_left:
name: left button - hold
description: action to run when left button is held
default: []
selector:
action: {}
single_right:
name: right button - single press
description: action to run on a single press of the right button
default: []
selector:
action: {}
double_right:
name: right button - double press
description: action to run on a double press of the right button
default: []
selector:
action: {}
triple_right:
name: right button - triple press
description: action to run on a triple press of the right button
default: []
selector:
action: {}
hold_right:
name: right button - hold
description: action to run when right button is held
default: []
selector:
action: {}
single_both:
name: both buttons - single press
description: action to run on a single press of both buttons
default: []
selector:
action: {}
double_both:
name: both buttons - double press
description: action to run on a double press of both buttons
default: []
selector:
action: {}
triple_both:
name: both buttons - triple press
description: action to run on a triple press of both buttons
default: []
selector:
action: {}
hold_both:
name: both buttons - hold
description: action to run when both buttons are held
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: mqtt
topic: !input "button_action_topic"
condition:
- condition: state
entity_id: input_boolean.manual_override_enabled
state: "off"
- condition: or
conditions:
- condition: numeric_state
entity_id: zone.home
above: 0
- condition: state
entity_id: input_boolean.home_guest_presence
state: "on"
action:
- variables:
command: "{{ trigger.payload }}"
- choose:
- conditions:
- condition: template
value_template: "{{ command == 'single_left' }}"
sequence: !input "single_left"
- conditions:
- condition: template
value_template: "{{ command == 'double_left' }}"
sequence: !input "double_left"
- conditions:
- condition: template
value_template: "{{ command == 'triple_left' }}"
sequence: !input "triple_left"
- conditions:
- condition: template
value_template: "{{ command == 'hold_left' }}"
sequence: !input "hold_left"
- conditions:
- condition: template
value_template: "{{ command == 'single_right' }}"
sequence: !input "single_right"
- conditions:
- condition: template
value_template: "{{ command == 'double_right' }}"
sequence: !input "double_right"
- conditions:
- condition: template
value_template: "{{ command == 'triple_right' }}"
sequence: !input "triple_right"
- conditions:
- condition: template
value_template: "{{ command == 'hold_right' }}"
sequence: !input "hold_right"
- conditions:
- condition: template
value_template: "{{ command == 'single_both' }}"
sequence: !input "single_both"
- conditions:
- condition: template
value_template: "{{ command == 'double_both' }}"
sequence: !input "double_both"
- conditions:
- condition: template
value_template: "{{ command == 'triple_both' }}"
sequence: !input "triple_both"
- conditions:
- condition: template
value_template: "{{ command == 'hold_both' }}"
sequence: !input "hold_both"
LE: I updated the blueprint as the way events are sent is inconsistent while the zigbee2mqtt/device-name/action topic works perfect.
Hi,
I try to use the blueprint from darkyndy. Is there anything I have to setup within HA in order to use the zigbee2mqtt topic.
I’d put “zigbee2mqtt/<frendly_name>/action” into the required field. But nothing happens when clicking on the button.
On the other hand when I look into Settings → Devices I see in the logbook something like “<frendly_name> changed to single_right”