Aqara Opple 6 Buttons For Zha

The blueprint isn’t picking up my Opple remote - dropdown box just says “No matching devices found”. I’ve got the same model switch that the author was using (lumi.remote.b686opcn01), this has been added and showing up in deconz, i’ve even been able to create an automation to switch a light on with a press of one of the buttons - and this is successful.

Anything i could be doing wrong? Does it need to be named in a certain way for the blueprint to pick it up?

The Blueprint is for ZHA, not Deconz (assuming you meant that).

Hi there, any Ideas whats going wrong?

2021-12-08 12:11:21 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'event' when rendering '{{ trigger.event.data.command }}'
2021-12-08 12:11:21 ERROR (MainThread) [homeassistant.components.automation.wohnzimmer_zha_aqara_opple_wireless_scene_switch_6_button] Wohnzimmer ZHA - Aqara Opple - Wireless Scene Switch 6 Button: Error executing script. Error rendering template for variables at pos 1: UndefinedError: 'dict object' has no attribute 'event'
2021-12-08 12:11:21 ERROR (MainThread) [homeassistant.components.automation.wohnzimmer_zha_aqara_opple_wireless_scene_switch_6_button] Error while executing automation automation.wohnzimmer_zha_aqara_opple_wireless_scene_switch_6_button: UndefinedError: 'dict object' has no attribute 'event'

This device just works like this.
The other issue with Aqara Opple is not sending the release event at all when long pressing:
https://github.com/Koenkk/zigbee2mqtt/issues/3524

I suspect there’s an error later in the automation. My step 2 reads the same as yours, and I have no issue.

Try selecting the next step (3rd icon down in the tree), and see if you can locate the “dict object” it is referring to.

Also use the blueprint and had problems since Christmas but didn’t get around to it, just reloaded the integration and everything worked again.

I fixed it in my local installation, to make the hold in function work (again).

Here’s the corrected version:

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_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_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_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_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_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_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: {}
  source_url: https://community.home-assistant.io/t/aqara-opple-6-buttons-for-zha/261418/39
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:
  - 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_hold" }}'
    sequence: !input 'button_top_left_hold_in'
  - 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_hold" }}'
    sequence: !input 'button_top_right_hold_in'
  - 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_hold" }}'
    sequence: !input 'button_middle_left_hold_in'
  - 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_hold"  }}'
    sequence: !input 'button_middle_right_hold_in'
  - 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_hold"  }}'
    sequence: !input 'button_bottom_left_hold_in'
  - 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_hold"  }}'
    sequence: !input 'button_bottom_right_hold_in'

Thanks to [gilbert-grape] for pointing out the necessary changes!

How can we update the original blueprint? Or should i post a new one?

Hi there,

The original blueprint triggers systematically an action twice for each event.
I d’ont know if it’s due to my setting or if it’s the same for all users.

If I associate a permute/toggle action to a button it will not work as it will double trigger causing the switch being in its original state.

I found a workaround by modifying the blueprint.
Forcing single mode worked for me
mode: restart to mode: single in the blueprint

Am I the only one impacted by this ?

I’m not seeing double actions and have been testing with the toggle on light and switch entities here.

Very nice little remote for one-shot actions, but I just discovered that none of the buttons support repeating. That means this thing is somewhat useless for use with dimmers or volume control. :frowning: Can anyone recommend any other Zigbee models that have working repeat?

Super newb here… I’m trying to find where one can add a blueprint from a code block? Can anyone point me in the right direction.

I’m not seeing the usual “import automation” button.

Configuration > Blueprints > Add Blueprint (bottom right corner button)

Then paste the URL of this page into the blueprint text box.

I don’t suppose there are any solutions/workarounds for this behaviour? I’ve found this thread after setting up very similar hold-to-dim/brighten functionality via Node-Red. It seems like a bit of a disappointing cop-out (from the manufacturer, not you @visstro) to say that the release event only works as expected for a particularly short hold event. All I’ve come up with so far is using a step of 20% and interval of 1s so that the full brightness range is covered and a timeout can be forced after 5s.

1 Like

Hi hold did not work for me, I had to replace the command in the blueprint:

  - conditions:
      - '{{ event == "**1_hold**" }}'
    sequence: !input "button_top_left_hold_in"
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_hold" }}'
        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_hold" }}'
        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_hold" }}'
        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_hold"  }}'
        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_hold"  }}'
        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_hold"  }}'
        sequence: !input "button_bottom_right_hold_in"

This is mentioned a few times above, starting here: Aqara Opple 6 Buttons For Zha - #39 by gilbert-grape

It’s a shame the original post hasn’t been updated.

1 Like

Hello,

are more people bothered by adding their aqara opple switches? I need several times to add it properly to get the buttons visible as a trigger. if it is added incorrectly it will get the name:

unk_manufacturer unk_model

and if it is added correctly it will be called:

LUMI lumi.remote.b686opcn01

now I had added all switches correctly, but 4 jumped to the bad name, so that the buttons no longer work.

Switches doesn’t work anymore on my system😡

Hey…

My switch was in the wrong mode (dimming/color temp etc); I messed around removing / re-adding etc but couldn’t make it switch.

Eventually I got it to work. The last thing I did before it worked was to do 3 quick presses (ie: not a hold) on the bind button and then reconfigure. No idea if that was the critical piece of the puzzle or not… but thought I’d share.

If anyone else tries, do report back if it worked for you!

I am having a problem, my device is not showing in the blueprint.
lumi.remote.b686opcn01
It is connected via Zigbee2MQTT which is connect to ZHA ZBBridge Tasmota.
The section of “Remote Opple remote to use” is empty.

I removed all blueprints from me because I also had the problem that they didn’t work and made the automation normal and it works without any problems.