Skip to content

Instantly share code, notes, and snippets.

@FloppyGit
Last active May 11, 2024 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FloppyGit/b2f5eb6737d40a36aeac512eed1e4caa to your computer and use it in GitHub Desktop.
Save FloppyGit/b2f5eb6737d40a36aeac512eed1e4caa to your computer and use it in GitHub Desktop.
Aqara Opple 6 Button Remote 3 bands (WXCJKG13LM) via Zigbee2MQTT [Z2M]
blueprint:
name: Aqara Opple switch 3 bands via zigbee2mqtt
description: "Control anything you want with Aqara Opple switch 3 bands (WXCJKG13LM)\n Each band button has single, double, triple, hold & release.\n Credits:\n - @bouyssic created with 4-Button https://community.home-assistant.io/t/z2m-aqara-opple-4-boutons-blueprint-wxcjkg12lm/279950\n - @shaxs adapted to 6-Button https://github.com/shaxs/-Z2M-Aqara-Opple-6-button-blueprint-WXCJKG12LM-for-HA/blob/56cb6afa3e631fc6d8a36aa3c871e63b544bbc39/opple6button.yaml\n - @iynaix bugfix mode https://github.com/shaxs/-Z2M-Aqara-Opple-6-button-blueprint-WXCJKG12LM-for-HA/pull/1 \n - @calcubot5000 cleanup https://community.home-assistant.io/t/zigbee2mqtt-z2m-aqara-opple-6-button-remote-3-bands-wxcjkg13lm/391475/7\n\n Switch Button Layout (little dot lower left). Switch could be rotated like you want:\n .---.---.---.\n | 2 | 4 | 6 |\n | | | |\n |.1 | 3 | 5 |\n '*--'---'---'\n "
domain: automation
input:
aqara_switch:
name: Aqara switch
description: Aqara switch to use
selector:
entity:
domain: sensor
integration: mqtt
multiple: false
#--Button 1 Action
button_1_single:
name: Button 1 - Single Click
description: Action to run after single click of button 1
default: []
selector:
action: {}
button_1_double:
name: Button 1 - Double click
description: Action to run after double click of button 1
default: []
selector:
action: {}
button_1_triple:
name: Button 1 - Triple Click
description: Action to run after triple click of button 1
default: []
selector:
action: {}
button_1_hold:
name: Button 1 - Hold Down
description: Action to run on holding down button 1
default: []
selector:
action: {}
button_1_release:
name: Button 1 - Release after Hold
description: Action to run after releasing button 1
default: []
selector:
action: {}
#--Button 2 Action
button_2_single:
name: Button 2 - Single Click
description: Action to run after single click of button 2
default: []
selector:
action: {}
button_2_double:
name: Button 2 - Double click
description: Action to run after double click of button 2
default: []
selector:
action: {}
button_2_triple:
name: Button 2 - Triple Click
description: Action to run after triple click of button 2
default: []
selector:
action: {}
button_2_hold:
name: Button 2 - Hold Down
description: Action to run on holding down button 2
default: []
selector:
action: {}
button_2_release:
name: Button 2 - Release after Hold
description: Action to run after releasing button 2
default: []
selector:
action: {}
#--Button 3 Action
button_3_single:
name: Button 3 - Single Click
description: Action to run after single click of button 3
default: []
selector:
action: {}
button_3_double:
name: Button 3 - Double click
description: Action to run after double click of button 3
default: []
selector:
action: {}
button_3_triple:
name: Button 3 - Triple Click
description: Action to run after triple click of button 3
default: []
selector:
action: {}
button_3_hold:
name: Button 3 - Hold Down
description: Action to run on holding down button 3
default: []
selector:
action: {}
button_3_release:
name: Button 3 - Release after Hold
description: Action to run after releasing button 3
default: []
selector:
action: {}
#--Button 4 Action
button_4_single:
name: Button 4 - Single Click
description: Action to run after single click of button 4
default: []
selector:
action: {}
button_4_double:
name: Button 4 - Double click
description: Action to run after double click of button 4
default: []
selector:
action: {}
button_4_triple:
name: Button 4 - Triple Click
description: Action to run after triple click of button 4
default: []
selector:
action: {}
button_4_hold:
name: Button 4 - Hold Down
description: Action to run on holding down button 4
default: []
selector:
action: {}
button_4_release:
name: Button 4 - Release after Hold
description: Action to run after releasing button 4
default: []
selector:
action: {}
#--Button 5 Action
button_5_single:
name: Button 5 - Single Click
description: Action to run after single click of button 5
default: []
selector:
action: {}
button_5_double:
name: Button 5 - Double click
description: Action to run after double click of button 5
default: []
selector:
action: {}
button_5_triple:
name: Button 5 - Triple Click
description: Action to run after triple click of button 5
default: []
selector:
action: {}
button_5_hold:
name: Button 5 - Hold Down
description: Action to run on holding down button 5
default: []
selector:
action: {}
button_5_release:
name: Button 5 - Release after Hold
description: Action to run after releasing button 5
default: []
selector:
action: {}
#--Button 6 Action
button_6_single:
name: Button 6 - Single Click
description: Action to run after single click of button 6
default: []
selector:
action: {}
button_6_double:
name: Button 6 - Double click
description: Action to run after double click of button 6
default: []
selector:
action: {}
button_6_triple:
name: Button 6 - Triple Click
description: Action to run after triple click of button 6
default: []
selector:
action: {}
button_6_hold:
name: Button 6 - Hold Down
description: Action to run on holding down button 6
default: []
selector:
action: {}
button_6_release:
name: Button 6 - Release after Hold
description: Action to run after releasing button 6
default: []
selector:
action: {}
mode: parallel
max_exceeded: silent
trigger:
- platform: state
entity_id: !input aqara_switch
condition:
condition: template
value_template: "{{ trigger.to_state.state in ( 'button_1_single', 'button_1_double', 'button_1_triple', 'button_1_hold', 'button_1_release', 'button_2_single', 'button_2_double', 'button_2_triple', 'button_2_hold', 'button_2_release', 'button_3_single', 'button_3_double', 'button_3_triple', 'button_3_hold', 'button_3_release', 'button_4_single', 'button_4_double', 'button_4_triple', 'button_4_hold', 'button_4_release', 'button_5_single', 'button_5_double', 'button_5_triple', 'button_5_hold', 'button_5_release', 'button_6_single', 'button_6_double', 'button_6_triple', 'button_6_hold', 'button_6_release' ) }}"
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_5_single' }}"
sequence: !input button_5_single
- conditions:
- "{{ command == 'button_6_single' }}"
sequence: !input button_6_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_5_double' }}"
sequence: !input button_5_double
- conditions:
- "{{ command == 'button_6_double' }}"
sequence: !input button_6_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_5_triple' }}"
sequence: !input button_5_triple
- conditions:
- "{{ command == 'button_6_triple' }}"
sequence: !input button_6_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_5_hold' }}"
sequence: !input button_5_hold
- conditions:
- "{{ command == 'button_6_hold' }}"
sequence: !input button_6_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
- conditions:
- "{{ command == 'button_5_release' }}"
sequence: !input button_5_release
- conditions:
- "{{ command == 'button_6_release' }}"
sequence: !input button_6_release
@svenove
Copy link

svenove commented May 11, 2024

What entity should I select? All I have is “battery” and “power outage count”… or do I need to change operation mode from “event” to “command”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment