[Z2M] Aqara Opple 4 boutons blueprint (WXCJKG12LM)

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: {}
    button_1_double:
      name: Button 1 - double click
      description: Action to run on triple click of button 1
      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_1_hold:
      name: Button 1 - hold click
      description: Action to run on triple click of button 1
      default: []
      selector:
        action: {}
    button_2_single:
      name: Button 2 - single click
      description: Action to run on triple click of button 2
      default: []
      selector:
        action: {}
    button_2_double:
      name: Button 2 - double click
      description: Action to run on triple click of button 2
      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_2_hold:
      name: Button 2 - hold click
      description: Action to run on triple click of button 2
      default: []
      selector:
        action: {}
    button_3_single:
      name: Button 3 - simple click
      description: Action to run on triple click of button 3
      default: []
      selector:
        action: {}
    button_3_double:
      name: Button 3 - double click
      description: Action to run on triple click of button 3
      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_3_hold:
      name: Button 3 - hold click
      description: Action to run on triple click of button 3
      default: []
      selector:
        action: {}
    button_4_single:
      name: Button 4 - single click
      description: Action to run on triple click of button 4
      default: []
      selector:
        action: {}
    button_4_double:
      name: Button 4 - double click
      description: Action to run on triple click of button 4
      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_4_hold:
      name: Button 4 - hold click
      description: Action to run on triple click of button 4
      default: []
      selector:
        action: {}
  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'

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

Could you please also add the bits for release of a button hold? I think those are button_1_release, button_2_release, etc. Thanks!!

Hi @baru .

I’m sorry, I’m in the middle of moving from one region of France to another. All of Home Assistant is right now in a cardboard box in storage waiting for me to find a new house. I wont be able to do this for a while.

Don’t hesitate to take this template and improve it on your own as I can’t maintain it for now.

Cheers

Is there someone that can help me? I’m trying to use Opple with a Sonoff 4ch Pro tasmotized and used on HA as a Cover. I’d like to make the following:

When I press button 1 → I’d open the cover (therefore call the service cover.open)
When I press again button 1 → I’d stop the cover (therefore call the service cover.stop)

Do you have any idea on how to do that? Shall I modify the blueprint or create a specific automation?

Thanks

Anyone have this working in ZHA?