Zigbee2MQTT - Aqara Opple WXCJKG13LM 3 band switch all custom buttons

Edited from Zigbee2mqtt - Aqara Opple switch 3 bands

blueprint:
  name: Z2M - Aqara Opple switch 3 bands
  description: 'Aqara Opple switch 3 bands (WXCJKG13LM).'
  domain: automation
  input:
    switch:
      name: Aqara switch
      description: Aqara switch to use
      selector:
        entity:
          domain: sensor
    button_1_single:
      name: Button 1 - single click
      description: Action to run on single click of button 1
      default: []
      selector:
        action: {}
    button_2_single:
      name: Button 2 - single click
      description: Action to run on single click of button 2
      default: []
      selector:
        action: {}
    button_3_single:
      name: Button 3 - single click
      description: Action to run on single click of button 3
      default: []
      selector:
        action: {}
    button_4_single:
      name: Button 4 - single click
      description: Action to run on single click of button 4
      default: []
      selector:
        action: {}
    button_5_single:
      name: Button 5 - single click
      description: Action to run on single click of button 5
      default: []
      selector:
        action: {}
    button_6_single:
      name: Button 6 - single click
      description: Action to run on single click of button 6
      default: []
      selector:
        action: {}
    button_1_double:
      name: Button 1 - double click
      description: Action to run on double click of button 1
      default: []
      selector:
        action: {}
    button_2_double:
      name: Button 2 - double click
      description: Action to run on double click of button 2
      default: []
      selector:
        action: {}
    button_3_double:
      name: Button 3 - double click
      description: Action to run on double click of button 3
      default: []
      selector:
        action: {}
    button_4_double:
      name: Button 4 - double click
      description: Action to run on double click of button 4
      default: []
      selector:
        action: {}
    button_5_double:
      name: Button 5 - double click
      description: Action to run on double click of button 5
      default: []
      selector:
        action: {}
    button_6_double:
      name: Button 6 - double click
      description: Action to run on double click of button 6
      default: []
      selector:
        action: {}
    button_1_triple:
      name: Button 1 - triple click
      description: Action to run on triple click of button 1
      default: []
      selector:
        action: {}
    button_2_triple:
      name: Button 2 - triple click
      description: Action to run on triple click of button 2
      default: []
      selector:
        action: {}
    button_3_triple:
      name: Button 3 - triple click
      description: Action to run on triple click of button 3
      default: []
      selector:
        action: {}
    button_4_triple:
      name: Button 4 - triple click
      description: Action to run on triple click of button 4
      default: []
      selector:
        action: {}
    button_5_triple:
      name: Button 5 - triple click
      description: Action to run on triple click of button 5
      default: []
      selector:
        action: {}
    button_6_triple:
      name: Button 6 - triple click
      description: Action to run on triple click of button 6
      default: []
      selector:
        action: {}
    button_1_hold:
      name: Button 1 - hold click
      description: Action to run on hold click of button 1
      default: []
      selector:
        action: {}
    button_2_hold:
      name: Button 2 - hold click
      description: Action to run on hold click of button 2
      default: []
      selector:
        action: {}
    button_3_hold:
      name: Button 3 - hold click
      description: Action to run on hold click of button 3
      default: []
      selector:
        action: {}
    button_4_hold:
      name: Button 4 - hold click
      description: Action to run on hold click of button 4
      default: []
      selector:
        action: {}
    button_5_hold:
      name: Button 5 - hold click
      description: Action to run on hold click of button 5
      default: []
      selector:
        action: {}
    button_6_hold:
      name: Button 6 - hold click
      description: Action to run on hold click of button 6
      default: []
      selector:
        action: {}
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_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_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_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'
3 Likes

Hey, can you please help me out, I am trying to use it, but even the simplest config doesn’t work for me reliably :frowning: .

id: '1618748320319'
alias: Z2M - Aqara Opple switch 3 bands - asd
description: test
use_blueprint:
  path: >-
    mozartbanging/zigbee2mqtt-aqara-opple-wxcjkg13lm-3-band-switch-all-custom-buttons.yaml
  input:
    switch: sensor.tripleswitch_action
    button_1_hold:
      - type: brightness_decrease
        device_id: bf172af096d79716d04bb471ef11cfee
        entity_id: light.testzarovka1
        domain: light
    button_1_single:
      - type: turn_off
        device_id: bf172af096d79716d04bb471ef11cfee
        entity_id: light.testzarovka1
        domain: light

this is my blueprint usage. If I create the automation, I can switch off the light (when turned on). But then it doesn’t work at all (no dimming or subsequent switch off). I can see in the mqtt that no more “set” messages are emitted :frowning: .

Thanks for the help!

First of all, thanks for the blueprint, I’ve been using it for a while now and it helped a lot and worked great!

Since the new 2022.11 update, I’ve noticed that sequences that contain more than one action only executed the first one. The trace said the automation was cancelled after executing the first action.
I’m not sure what exactly has changed with the automations, but I had to change the blueprint to mode: parallel and now it works again.

It most likely has to do with the second empty state the button sends directly after the button press event ('button_1_single' → ''). Why this has worked before and doesn’t now, I don’t know, but changing the mode has worked for me.

To make this blueprint work on my HA 2022.12 setup, I had to change some code:

  1. Mode “parallel” instead of “restart”
  2. Delete the leading dash at line “platform:state”
  3. Delete the line “attribute: action”
  4. Additions to line “command:”

My source of inspiration was the blueprint Aqara Buttons All-In-One [Zigbee2MQTT] .

...
mode: parallel
max_exceeded: silent
trigger:
  platform: state
  entity_id: !input 'switch'
action:
- variables:
    command: '{{ trigger.to_state.attributes.action if trigger.to_state.state == ""
      else trigger.to_state.state }}'
...
2 Likes

Hello,
since the core update 2023.8 the most Automations doesnt work any more.
I Have three 3-Band switches, all does the same… → doing nothing by pressing the buttons?
I have deleted the whole auomation and created it new without changing.
In the Log of Z2M i can see it, if I press the button and i can Trigger the light or doors from Homeassistant. Is there anybody with the same Problem?
Only Automation from Zigbee to zigbee are working. All other Automations are going vom Zigbee to Shelly or Zigbee to Scenes…

Ein Hue Dial funktioniert

Same for me, blueprint don’t work since 2023.08

Figured it out
Go to the Blueprints with Studio code server and change mode from restart to single
reboot HA
should be work again

its in line 156

1 Like

It works fine for me, thanks!

Thanks a lot. I had that problem as well and now it’s solved :grinning: