Aqara Opple 6 Buttons For Zha

Your blueprint is working great, do you guys use ‘Hold in’ to increase or decrease brightness of for example HUE lamp?

Can somebody explain how to dim with button press and hold?

Nice job! Now am I missing something or does this not recognize grouped devices under zha? (i.e. light.breezeway_lights_zha_group_0x000c created by zha containing 6 light bulbs). I don’t see this entity being listed in the devices selection drop down. (or any of my zha group entites)

@Dixey, this will be your solution:

Action type=Service
Service=Light: Turn on
Pick entity=light.breezeway_lights_zha_group_0x000c

good luck!

1 Like

Can somebody help me with dimming? I tried the following, but it does not work. It does not change the state of the helper “input_boolean.light_switch_stube_ost_dimming”

Thanks for helping
Gilbert

here my blueprint code:

alias: New Automation
description: ''
use_blueprint:
  path: Jarne_Roussard/aqara-opple-6-buttons-for-zha.yaml
  input:
    button_bottom_left_hold_in:
      - service: input_boolean.turn_on
        target:
          entity_id: input_boolean.light_switch_stube_ost_dimming
      - repeat:
          until:
            - condition: state
              entity_id: input_boolean.light_switch_stube_ost_dimming
              state: 'on'
          sequence:
            - service: light.turn_on
              target:
                entity_id: light.stube_zha_group_0x0005
              data:
                brightness_pct: -10
    button_bottom_left_hold_release:
      - service: input_boolean.turn_off
        target:
          entity_id: input_boolean.light_switch_stube_ost_dimming
    remote: 8e9a6107950d4d20b871d40aa2e8d36d

I have found the error. The blueprint is not correct:

In the blueprint you have to change all long-press events:

  - conditions:
    - '{{ event == "3_long press" }}'

to this one:

  - conditions:
    - '{{ event == "3_hold" }}'

And then restart HA.

1 Like

Did you update the blueprint with these changes?

Nope. How can i do that?
Temporaly i changed the blue print in my local Installation

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