Aqara Opple 6 Buttons For Zha

I also have the 4 button version for zha [Aqara Opple Wireless Scene Switch - 4 Button ] (Aqara Opple 4 Buttons For Zha)

Blueprint to support the Aqara Opple Wireless Scene Switch - 6 Button . Combine actions for all buttons in a single automation.

All buttons support the following actions:

  • Single press
  • Double press
  • Tripple press
  • Hold in
  • Hold release

Blueprint to import:

blueprint:
  name: ZHA - Aqara Opple - Wireless Scene Switch 6 Button
  description: 'Control anything using Aqara Opple six button remote'
  domain: automation
  input:
    remote:
      name: Remote
      description: Opple remote to use
      selector:
        device:
          integration: zha
          manufacturer: LUMI
          model: lumi.remote.b686opcn01
    
    # ---------------------------- BUTTON TOP LEFT ----------------------------
    button_top_left_single_press:
      name: Top left button - Single press
      description: Action to run on a single press of the top left button
      default: []
      selector:
        action: {}

    button_top_left_double_press:
      name: Top left button - Double press
      description: Action to run on a double press of the top left button
      default: []
      selector:
        action: {}

    button_top_left_triple_press:
      name: Top left button - Triple press
      description: Action to run on a triple press of the top left button
      default: []
      selector:
        action: {}

    button_top_left_hold_release:
      name: Top left button - Hold release
      description: Action to run when top left button was held in and released
      default: []
      selector:
        action: {}

    button_top_left_hold_in:
      name: Top left button - Hold in
      description: Action to run when top left button is held in
      default: []
      selector:
        action: {}

    # ---------------------------- BUTTON TOP RIGHT ----------------------------
    button_top_right_single_press:
      name: Top right button - Single press
      description: Action to run on a single press of the top right button
      default: []
      selector:
        action: {}

    button_top_right_double_press:
      name: Top right button - Double press
      description: Action to run on a double press of the top right button
      default: []
      selector:
        action: {}

    button_top_right_triple_press:
      name: Top right button - Triple press
      description: Action to run on a triple press of the top right button
      default: []
      selector:
        action: {}

    button_top_right_hold_release:
      name: Top right button - Hold release
      description: Action to run when top right button was held in and released
      default: []
      selector:
        action: {}

    button_top_right_hold_in:
      name: Top right button - Hold in
      description: Action to run when top right button is held in
      default: []
      selector:
        action: {}

    # ---------------------------- BUTTON MIDDLE LEFT ----------------------------
    button_middle_left_single_press:
      name: Middle left button - Single press
      description: Action to run on a single press of the middle left button
      default: []
      selector:
        action: {}

    button_middle_left_double_press:
      name: Middle left button - Double press
      description: Action to run on a double press of the middle left button
      default: []
      selector:
        action: {}

    button_middle_left_triple_press:
      name: Middle left button - Triple press
      description: Action to run on a triple press of the middle left button
      default: []
      selector:
        action: {}

    button_middle_left_hold_release:
      name: Middle left button - Hold release
      description: Action to run when middle left button was held in and released
      default: []
      selector:
        action: {}

    button_middle_left_hold_in:
      name: Middle left button - Hold in
      description: Action to run when middle left button is held in
      default: []
      selector:
        action: {}

    # ---------------------------- BUTTON MIDDLE RIGHT ----------------------------
    button_middle_right_single_press:
      name: Middle right button Single press
      description: Action to run on a single press of the middle right button
      default: []
      selector:
        action: {}

    button_middle_right_double_press:
      name: Middle right button Double press
      description: Action to run on a double press of the middle right button
      default: []
      selector:
        action: {}

    button_middle_right_triple_press:
      name: Middle right button triple press
      description: Action to run on a triple press of the middle right button
      default: []
      selector:
        action: {}

    button_middle_right_hold_release:
      name: Middle right button Hold release
      description: Action to run when middle right button was held in and released
      default: []
      selector:
        action: {}

    button_middle_right_hold_in:
      name: Middle right button Hold in
      description: Action to run when middle right button is held in
      default: []
      selector:
        action: {}

    # ---------------------------- BUTTON BOTTOM LEFT ----------------------------
    button_bottom_left_single_press:
      name: Bottom left button - Single press
      description: Action to run on a single press of the bottom left button
      default: []
      selector:
        action: {}

    button_bottom_left_double_press:
      name: Bottom left button - Double press
      description: Action to run on a double press of the bottom left button
      default: []
      selector:
        action: {}

    button_bottom_left_triple_press:
      name: Bottom left button - Triple press
      description: Action to run on a triple press of the bottom left button
      default: []
      selector:
        action: {}

    button_bottom_left_hold_release:
      name: Bottom left button - Hold release
      description: Action to run when bottom left button was held in and released
      default: []
      selector:
        action: {}

    button_bottom_left_hold_in:
      name: Bottom left button - Hold in
      description: Action to run when bottom left button is held in
      default: []
      selector:
        action: {}

    # ---------------------------- BUTTON BOTTOM RIGHT ----------------------------
    button_bottom_right_single_press:
      name: Bottom right button - Single press
      description: Action to run on a single press of the bottom right button
      default: []
      selector:
        action: {}

    button_bottom_right_double_press:
      name: Bottom right button - Double press
      description: Action to run on a double press of the bottom right button
      default: []
      selector:
        action: {}

    button_bottom_right_triple_press:
      name: Bottom right button - Triple press
      description: Action to run on a triple press of the bottom right button
      default: []
      selector:
        action: {}

    button_bottom_right_hold_release:
      name: Bottom right button - Hold release
      description: Action to run when bottom right button was held in and released
      default: []
      selector:
        action: {}

    button_bottom_right_hold_in:
      name: Bottom right button - Hold in
      description: Action to run when bottom right button is held in
      default: []
      selector:
        action: {}

mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'remote'
action:
- variables:
    event: '{{ trigger.event.data.command }}'
- choose:

  # ---------------------------- BUTTON TOP LEFT ----------------------------
  - conditions:
    - '{{ event == "1_single" }}'
    sequence: !input 'button_top_left_single_press'
  - conditions:
    - '{{ event == "1_double" }}'
    sequence: !input 'button_top_left_double_press'
  - conditions:
    - '{{ event == "1_triple" }}'
    sequence: !input 'button_top_left_triple_press'
  - conditions:
    - '{{ event == "1_release" }}'
    sequence: !input 'button_top_left_hold_release'
  - conditions:
    - '{{ event == "1_long press" }}'
    sequence: !input 'button_top_left_hold_in'

  # ---------------------------- BUTTON TOP RIGHT ----------------------------
  - conditions:
    - '{{ event == "2_single" }}'
    sequence: !input 'button_top_right_single_press'
  - conditions:
    - '{{ event == "2_double" }}'
    sequence: !input 'button_top_right_double_press'
  - conditions:
    - '{{ event == "2_triple" }}'
    sequence: !input 'button_top_right_triple_press'
  - conditions:
    - '{{ event == "2_release" }}'
    sequence: !input 'button_top_right_hold_release'
  - conditions:
    - '{{ event == "2_long press" }}'
    sequence: !input 'button_top_right_hold_in'

  # ---------------------------- BUTTON MIDDLE LEFT ----------------------------
  - conditions:
    - '{{ event == "3_single" }}'
    sequence: !input 'button_middle_left_single_press'
  - conditions:
    - '{{ event == "3_double"  }}'
    sequence: !input 'button_middle_left_double_press'
  - conditions:
    - '{{ event == "3_triple" }}'
    sequence: !input 'button_middle_left_triple_press'
  - conditions:
    - '{{ event == "3_release" }}'
    sequence: !input 'button_middle_left_hold_release'
  - conditions:
    - '{{ event == "3_long press" }}'
    sequence: !input 'button_middle_left_hold_in'

  # ---------------------------- BUTTON MIDDLE RIGHT ----------------------------
  - conditions:
    - '{{ event == "4_single" }}'
    sequence: !input 'button_middle_right_single_press'
  - conditions:
    - '{{ event == "4_double"  }}'
    sequence: !input 'button_middle_right_double_press'
  - conditions:
    - '{{ event == "4_triple" }}'
    sequence: !input 'button_middle_right_triple_press'
  - conditions:
    - '{{ event == "4_release" }}'
    sequence: !input 'button_middle_right_hold_release'
  - conditions:
    - '{{ event == "4_long press"  }}'
    sequence: !input 'button_middle_right_hold_in'

  # ---------------------------- BUTTON BOTTOM LEFT ----------------------------
  - conditions:
    - '{{ event == "5_single" }}'
    sequence: !input 'button_bottom_left_single_press'
  - conditions:
    - '{{ event == "5_double"  }}'
    sequence: !input 'button_bottom_left_double_press'
  - conditions:
    - '{{ event == "5_triple" }}'
    sequence: !input 'button_bottom_left_triple_press'
  - conditions:
    - '{{ event == "5_release" }}'
    sequence: !input 'button_bottom_left_hold_release'
  - conditions:
    - '{{ event == "5_long press"  }}'
    sequence: !input 'button_bottom_left_hold_in'

  # ---------------------------- BUTTON BOTTOM RIGHT ----------------------------
  - conditions:
    - '{{ event == "6_single" }}'
    sequence: !input 'button_bottom_right_single_press'
  - conditions:
    - '{{ event == "6_double"  }}'
    sequence: !input 'button_bottom_right_double_press'
  - conditions:
    - '{{ event == "6_triple" }}'
    sequence: !input 'button_bottom_right_triple_press'
  - conditions:
    - '{{ event == "6_release" }}'
    sequence: !input 'button_bottom_right_hold_release'
  - conditions:
    - '{{ event == "6_long press"  }}'
    sequence: !input 'button_bottom_right_hold_in'

Credits for @Savjee. I used his deCONZ version as template for this blueprint.

6 Likes

Thanks man this i need!

1 Like

Thanks so much, working great, have 3 automation in one now and now have great oppurtinity to use more presses now knowing I won’t fill up millions of automations

1 Like

Thank you!!
I have the same buttons (4 and 6 version). I have noticed that the “release” event is sent after 5 seconds of “hold” even if I am still holding it. Have you noticed this 5 seconds situation?

1 Like

First thanks for creating this blueprint!

Short question, are you getting the events like “1_single” automatically or did you have to change / set anything for this remote? When I listen to the zha_events for it (WXCJKG13LM) at my end I’m getting different commands like “off”, “on”, “step”, “move” and others which is probably why your blueprint doesn’t work for me. I read that there seems to be an alternate mode for this switch, but not sure how to enable that. Or maybe it’s just my coordinator (zzh stick, CC2652R based) which leads to these different events.

1 Like

Can’t reproduce that behavior.

1 Like

Yeah I had that before this bluerint I was using alternative mode, somereason the blueprint works for me though

1 Like

And how do you activate / use that “alternative mode”?

1 Like

is it possible to adapt it to the 4 button version ?

1 Like

hallo @omolko

I’ll look at that for you tomorrow and it won’t be a problem!

1 Like

hello jarne,
did you have any issue with the 4 button version?

here is the 4 button version in zha I had to wait for the product itself for the correct setting, but now I enjoy working with it @omolko

Aqara Opple 4 Buttons For Zha

Hey! Thanks a lot! Brilliant blueprint!

Is there a way to set the step size of the increase and decrease brightness?

button_middle_right_single_press:
      - type: brightness_increase
        device_id: xyz
        entity_id: light.lamps
        domain: light

Hi,

i have same situation with opple 6 button switches - zha_events with commands on, off, stop, move, etc. instead of 1_single, 1_double…

Has anyone an idea what is the reason for that? @balu79 have you found a solution for it?

Thanks in advance!!!

Found some infos about it here: https://github.com/arendst/Tasmota/issues/9823
Just try to find out how to send the command when using ZHA instead of zigbee2tasmota…

I haven’t found a solution yet. Thought it might have to do with my somewhat beta coordinator stick (plus rather like an isolated problem to me) and hence didn’t want to further trouble / hijack this blueprint thread.

That Tasmota command is interesting, but then we need to see if / how such a command could be done in ZHA plus I’m not fully sure yet whether it actually has to do with the change of the mode.

not fully sure yet whether it actually has to do with the change of the mode.

After sending the opplemode command with tasmota, the switch is sending 1_single, 1_double, 1_triple… until I bind it to ZHA again.
Looks like the opple switch has two modes, one for binding it directly to bulbs and the other one for more advanced usage.
Maybe I should open an issue for that instead of hijacking this thread. :thinking:

Cheers

I found zha quirks has an entry for a V5 switch that isn’t yet in home assistant. An upgrade to 0.58 of the quirks fixed it once reloaded.

I found zha quirks has an entry for a V5 switch that isn’t yet in home assistant. An upgrade to 0.58 of the quirks fixed it once reloaded.

Thanks for the info. Do you have a hint how I can do the upgrade to 0.58? My setup is based on Hass.io and I have no clue how I can upgrade zha quirks only :see_no_evil:

BTW, @balu79 opened a new thread for this. Maybe we should move the discussion to this one -> https://community.home-assistant.io/t/aqara-opple-6-buttons/274276

I’m running core in a docker container. I added a volume mount for zha_quirks and did a pip install.