Zigbee2MQTT - Aqara Opple switch 2 bands blueprint (WXCJKG12LM)

Blueprint to support Aqara Opple switch 2 bands (WXCJKG12LM).

Simple and clean Blueprint with all possible functions supported by this switch.
The buttons support:

  • Single press
  • Double press
  • Triple press
  • Hold
  • Release

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
Blueprint code:

blueprint:
  name: Z2M - Aqara Opple switch 2 bands
  description: 'Control anything you want with Aqara Opple switch 2 bands (WXCJKG12LM).


    Each band button has single, double, triple, hold & release'
  domain: automation
  input:
    switch:
      name: Aqara Opple switch
      description: Aqara Opple switch to use
      selector:
        entity:
          domain: sensor
          integration: mqtt
    button_1_single:
      name: Top Left button - single click
      description: Action to run on single click of top left button
      default: []
      selector:
        action: {}
    button_1_double:
      name: Top Left button - double click
      description: Action to run on double click of top left button
      default: []
      selector:
        action: {}
    button_1_triple:
      name: Top Left button - triple click
      description: Action to run on triple click of top left button
      default: []
      selector:
        action: {}
    button_1_hold:
      name: Top Left button - hold click
      description: Action to run on hold click of top left button
      default: []
      selector:
        action: {}
    button_1_release:
      name: Top Left button - release
      description: Action to run on release of top left button
      default: []
      selector:
        action: {}
    button_2_single:
      name: Top Right button - single click
      description: Action to run on single click of top right button
      default: []
      selector:
        action: {}
    button_2_double:
      name: Top Right button - double click
      description: Action to run on double click of top right button
      default: []
      selector:
        action: {}
    button_2_triple:
      name: Top Right button - triple click
      description: Action to run on triple click of top right button
      default: []
      selector:
        action: {}
    button_2_hold:
      name: Top Right button - hold click
      description: Action to run on hold click of top right button
      default: []
      selector:
        action: {}
    button_2_release:
      name: Top Right button - release
      description: Action to run on release of top right button
      default: []
      selector:
        action: {}
    button_3_single:
      name: Bottom Left button - single click
      description: Action to run on single click of bottom left button
      default: []
      selector:
        action: {}
    button_3_double:
      name: Bottom Left button - double click
      description: Action to run on double click of bottom left button
      default: []
      selector:
        action: {}
    button_3_triple:
      name: Bottom Left button - triple click
      description: Action to run on triple click of bottom left button
      default: []
      selector:
        action: {}
    button_3_hold:
      name: Bottom Left button - hold click
      description: Action to run on hold click of bottom left button
      default: []
      selector:
        action: {}
    button_3_release:
      name: Bottom Left button - release
      description: Action to run on release of bottom left button
      default: []
      selector:
        action: {}
    button_4_single:
      name: Bottom Right button - single click
      description: Action to run on single click of bottom right button
      default: []
      selector:
        action: {}
    button_4_double:
      name: Bottom Right button - double click
      description: Action to run on double click of bottom right button
      default: []
      selector:
        action: {}
    button_4_triple:
      name: Bottom Right button - triple click
      description: Action to run on triple click of bottom right button
      default: []
      selector:
        action: {}
    button_4_hold:
      name: Bottom Right button - hold click
      description: Action to run on hold click of bottom right button
      default: []
      selector:
        action: {}
    button_4_release:
      name: Bottom Right button - release
      description: Action to run on release of bottom right button
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zigbee2mqtt-aqara-opple-switch-2-bands-blueprint-wxcjkg12lm/353884
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'
2 Likes

This is the first blueprint I use, and although it seem to have imported correct, I can’t get the automation I created to work.

I’m pressing buttons on my switch but nothing happens. in fact, the automation says it has never run.

For entity, I select sensor.button_action … is that correct? (it’s the only option I have)

Hi Daniel-san.
Yes, that’s correct, you should choose sensor.button_action as entity and all should work for you.
I have this blueprint running for myself and no issues since set this up 1 year ago.
Please check once again if everything in automation is correct. Or post screenshot here to see your setup.

Thank you
Den