Aqara Opple 4 Buttons For Zha

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

Blueprint to support the Aqara Opple Wireless Scene Switch - 4 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

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

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

Or import this Blueprint by using the forum topic URL:

blueprint:
  name: ZHA - Aqara Opple - Wireless Scene Switch 4 Button
  description: 'Control anything using Aqara Opple four button remote'
  domain: automation
  input:
    remote:
      name: Remote
      description: Opple remote to use
      selector:
        device:
          integration: zha
          manufacturer: LUMI
          model: lumi.remote.b486opcn01
    
    # ---------------------------- 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 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 BOTTOM LEFT ----------------------------
  - conditions:
    - '{{ event == "3_single" }}'
    sequence: !input 'button_bottom_left_single_press'
  - conditions:
    - '{{ event == "3_double"  }}'
    sequence: !input 'button_bottom_left_double_press'
  - conditions:
    - '{{ event == "3_triple" }}'
    sequence: !input 'button_bottom_left_triple_press'
  - conditions:
    - '{{ event == "3_release" }}'
    sequence: !input 'button_bottom_left_hold_release'
  - conditions:
    - '{{ event == "3_long press"  }}'
    sequence: !input 'button_bottom_left_hold_in'

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

Credits for @dferrandizmont also have the 6 button version for zha

5 Likes

thanks for this

you’re welcome

hello great automation! you could make one on Zigbee2mqtt

thank you, I don’t have a zigbee2mqtt myself so the comandos don’t know about anything else right away.

Dear Tinkers,
i issue problems with this blueprint. When i add the function as an automation it works, when i try it with this blueprint it doesn´t work. Attached you can find the resulting code or both in the automation.yaml. Thanks for support.

- id: '1614498420000'
  alias: Neue Automatisierung
  description: ''
  trigger:
  - device_id: f6ba38e3d5a3fea75c5394766bd6d000
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_1
  condition: []
  action:
  - type: toggle
    device_id: bce7b6d03f40734cb9faafd84fb92000
    entity_id: light.box_level_light_color_on_off
    domain: light
  mode: single
- id: '1614498657000'
  alias: ZHA - Aqara Opple - Wireless Scene Switch 4 Button
  description: ''
  use_blueprint:
    path: Jarne_Roussard/aqara-opple-4-buttons-for-zha.yaml
    input:
      remote: f6ba38e3d5a3fea75c5394766bd6d000
      button_top_left_single_press:
      - type: toggle
        device_id: bce7b6d03f40734cb9faafd84fb92000
        entity_id: light.box_level_light_color_on_off
        domain: light

and thats the remote:
lumi.remote.b486opcn01
von LUMI

@Jarne_Roussard I can’t get this blueprint work either, when I add everything it just doesn’t do anything.

There might be different versions of these switches? Because when I listen to ZHA events I get different commands than in the blueprint.

Here I have events for each button, only one click:

#Button 1
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "44:cf:8c:d7:3c:7b:3d:b8",
        "unique_id": "04:cf:6c:ff:3c:7d:ec:bf:1:0x0006",
        "device_id": "860d0c2839bfb8cd8cf97021868f20e9",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "off",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-03-27T04:39:48.029417+00:00",
    "context": {
        "id": "471cc35cc8ead9081e5232b15aba81a1",
        "parent_id": null,
        "user_id": null
    }
}

#Button 2
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "44:cf:8c:d7:3c:7b:3d:b8",
        "unique_id": "04:cf:6c:ff:3c:7d:ec:bf:1:0x0006",
        "device_id": "860d0c2839bfb8cd8cf97021868f20e9",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-03-27T04:39:41.406994+00:00",
    "context": {
        "id": "11fb6bd3ec81575f24b03ec2b4172d0d",
        "parent_id": null,
        "user_id": null
    }
}

#Button 3
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "44:cf:8c:d7:3c:7b:3d:b8",
        "unique_id": "04:cf:6c:ff:3c:7d:ec:bf:1:0x0008",
        "device_id": "860d0c2839bfb8cd8cf97021868f20e9",
        "endpoint_id": 1,
        "cluster_id": 8,
        "command": "step",
        "args": [
            0,
            85,
            7
        ]
    },
    "origin": "LOCAL",
    "time_fired": "2021-03-27T04:39:18.167007+00:00",
    "context": {
        "id": "40b27fadbe1ccc2ba43fa7a11fc951d1",
        "parent_id": null,
        "user_id": null
    }
}

#Button 4
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "44:cf:8c:d7:3c:7b:3d:b8",
        "unique_id": "04:cf:6c:ff:3c:7d:ec:bf:1:0x0008",
        "device_id": "860d0c2839bfb8cd8cf97021868f20e9",
        "endpoint_id": 1,
        "cluster_id": 8,
        "command": "step",
        "args": [
            1,
            85,
            7
        ]
    },
    "origin": "LOCAL",
    "time_fired": "2021-03-27T04:39:02.790016+00:00",
    "context": {
        "id": "390807f33faa39697e6e40426c0d509a",
        "parent_id": null,
        "user_id": null
    }
}

Can someone make something with this? Or is it impossible to make blueprints for this device?

Same issue for me, I can’t get this blueprint to do anything. Looking at the ZHA events log mine is completely different than your output. The only way I see this working is if there is a way to define the zha_event data for each button press.

This is very helpful. Thank you!

i cant use this blueprint with ZHA… :frowning:

this had been broken for me for ages, was just re-adding my 4 button switch and it just started working, looks like this time its pulled a load of information it wasnt pulling before, almost like the interview process for the switch wasnt completeing properly

Thanks! Working nicely using the Zigbee Home Automation integration.
Note however I had to replace ‘1_long press’ with ‘1_hold’ in the template.

How is the battery life on this? I have a different 4 button switch that eats batteries every 3 months… looking to replace it.

Battery life is pretty good, my first one came in November, and I’m using it pretty regularly, its still at 100%

1 Like

Just if anyone stumples upon this:
If you har the same issue with the blueprint not working and the zha events including ““command”: “off”” like this, consider repairing the switch.
I got these result before the repairing, and after the blueprint worked.