Hello everyone,
I’m sharing my blueprint on Aqara Opple 4 boutons (WXCJKG12LM) for zigbee2mqtt.
Inspired from @razvanmdobre blueprint for the 6 boutton version.
This blueprint has no default values compared to his.
blueprint:
name: Z2M - Aqara Opple switch 2 bands
description:
"Control anything you want with Aqara Opple switch 2 bands (WXCJKG12LM).
Inspired by the blueprint of @razvanmdobre (https://community.home-assistant.io/t/zigbee2mqtt-aqara-opple-switch-3-bands/256212)
Each band button has single, double, triple, hold & release"
domain: automation
input:
switch:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
button_1_single:
name: Button 1 - simple click
description: Action to run on triple click of button 1
default: []
selector:
action: null
button_1_double:
name: Button 1 - double click
description: Action to run on triple click of button 1
default: []
selector:
action: null
button_1_triple:
name: Button 1 - triple click
description: Action to run on triple click of button 1
default: []
selector:
action: null
button_1_hold:
name: Button 1 - hold click
description: Action to run on triple click of button 1
default: []
selector:
action: null
button_1_release:
name: Button 1 - on release
description: Action to run after hold then release
default: []
selector:
action: null
button_2_single:
name: Button 2 - single click
description: Action to run on triple click of button 2
default: []
selector:
action: null
button_2_double:
name: Button 2 - double click
description: Action to run on triple click of button 2
default: []
selector:
action: null
button_2_triple:
name: Button 2 - triple click
description: Action to run on triple click of button 2
default: []
selector:
action: null
button_2_hold:
name: Button 2 - hold click
description: Action to run on triple click of button 2
default: []
selector:
action: null
button_2_release:
name: Button 2 - on release
description: Action to run after hold then release
default: []
selector:
action: null
button_3_single:
name: Button 3 - simple click
description: Action to run on triple click of button 3
default: []
selector:
action: null
button_3_double:
name: Button 3 - double click
description: Action to run on triple click of button 3
default: []
selector:
action: null
button_3_triple:
name: Button 3 - triple click
description: Action to run on triple click of button 3
default: []
selector:
action: null
button_3_hold:
name: Button 3 - hold click
description: Action to run on triple click of button 3
default: []
selector:
action: null
button_3_release:
name: Button 3 - on release
description: Action to run after hold then release
default: []
selector:
action: null
button_4_single:
name: Button 4 - single click
description: Action to run on triple click of button 4
default: []
selector:
action: null
button_4_double:
name: Button 4 - double click
description: Action to run on triple click of button 4
default: []
selector:
action: null
button_4_triple:
name: Button 4 - triple click
description: Action to run on triple click of button 4
default: []
selector:
action: null
button_4_hold:
name: Button 4 - hold click
description: Action to run on triple click of button 4
default: []
selector:
action: null
button_4_release:
name: Button 4 - on release
description: Action to run after hold then release
default: []
selector:
action: null
source_url: https://community.home-assistant.io/t/z2m-aqara-opple-4-boutons-blueprint-wxcjkg12lm/279950
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "switch"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'button_1_single' }}"
sequence: !input "button_1_single"
- conditions:
- "{{ command == 'button_2_single' }}"
sequence: !input "button_2_single"
- conditions:
- "{{ command == 'button_3_single' }}"
sequence: !input "button_3_single"
- conditions:
- "{{ command == 'button_4_single' }}"
sequence: !input "button_4_single"
- conditions:
- "{{ command == 'button_1_double' }}"
sequence: !input "button_1_double"
- conditions:
- "{{ command == 'button_2_double' }}"
sequence: !input "button_2_double"
- conditions:
- "{{ command == 'button_3_double' }}"
sequence: !input "button_3_double"
- conditions:
- "{{ command == 'button_4_double' }}"
sequence: !input "button_4_double"
- conditions:
- "{{ command == 'button_1_triple' }}"
sequence: !input "button_1_triple"
- conditions:
- "{{ command == 'button_2_triple' }}"
sequence: !input "button_2_triple"
- conditions:
- "{{ command == 'button_3_triple' }}"
sequence: !input "button_3_triple"
- conditions:
- "{{ command == 'button_4_triple' }}"
sequence: !input "button_4_triple"
- conditions:
- "{{ command == 'button_1_hold' }}"
sequence: !input "button_1_hold"
- conditions:
- "{{ command == 'button_2_hold' }}"
sequence: !input "button_2_hold"
- conditions:
- "{{ command == 'button_3_hold' }}"
sequence: !input "button_3_hold"
- conditions:
- "{{ command == 'button_4_hold' }}"
sequence: !input "button_4_hold"
- conditions:
- "{{ command == 'button_1_release' }}"
sequence: !input "button_1_release"
- conditions:
- "{{ command == 'button_2_release' }}"
sequence: !input "button_2_release"
- conditions:
- "{{ command == 'button_3_release' }}"
sequence: !input "button_3_release"
- conditions:
- "{{ command == 'button_4_release' }}"
sequence: !input "button_4_release"
Changelog:
- Feb 7. 2022: Added Release action to all switches
Don’t hesitate to let me know if there are issues. I’ll try to solve them as soon as possible.
Have a great time & stay safe
Chris