deCONZ - Aqara Opple (6 way) remote for lights

Blueprint to support the Aqara Opple switch 3 bands (WXCJKG13LM).

The following events are currently supported

  • single press to turn ON or OFF the lights
  • long press to increase or decrease the brightness smoothly until released
  • double press to adjust the brightness to 100% or 10%

In addition, you also have the choice to determine a forced brightness for when you turn on the lights.

Get started

Import this blueprint into your Home Assistant instance, with a simple click via the button below.

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

The code:

blueprint:
  name: deCONZ - Aqara Opple (6 way) remote for lights
  description: |
    Control 3 lights with an Aqara Opple switch 3 bands (WXCJKG13LM).

    Each band controls one light/group.
    - single press to turn ON or OFF the lights
    - long press to increase or decrease the brightness smoothly until released
    - double press to adjust the brightness to 100% or 10%

    In addition, you also have the choice to determine a forced brightness for when you turn on the lights.
  domain: automation
  input:
    remote:
      name: Remote
      description: Opple remote to use
      selector:
        device:
          integration: deconz
          manufacturer: LUMI
          model: lumi.remote.b686opcn01
    light_1:
      name: Light(s)
      description: The first light(s group) to control
      selector:
        target:
          entity:
            domain: light
    light_2:
      name: Light(s)
      description: The second light(s group) to control
      selector:
        target:
          entity:
            domain: light
    light_3:
      name: Light(s)
      description: The third light(s group) to control
      selector:
        target:
          entity:
            domain: light
    force_brightness:
      name: Force turn on brightness
      description: >
        Force the brightness to the set level below, when the "on" button on
        the remote is pushed and lights turn on.
      default: false
      selector:
        boolean:
    brightness:
      name: Brightness
      description: Brightness of the light(s) when turning on
      default: 50
      selector:
        number:
          min: 0
          max: 100
          mode: slider
          step: 1
          unit_of_measurement: "%"

mode: restart
max_exceeded: silent

variables:
  force_brightness: !input force_brightness

trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      device_id: !input 'remote'

action:
  - variables:
      event: '{{ trigger.event.data.event }}'

  - choose:
      # ---------------------------- TURN ON OR OFF ---------------------------- #
      - conditions:
          - '{{ event == 1002 }}'
        sequence:
          - choose:
              - conditions: "{{ force_brightness }}"
                sequence:
                  - service: light.turn_on
                    target: !input 'light_1'
                    data:
                      transition: 1
                      brightness_pct: !input brightness
            default:
              - service: light.turn_on
                target: !input 'light_1'
                data: {}
      - conditions:
          - '{{ event == 2002 }}'
        sequence:
          - service: light.turn_off
            data: {}
            target: !input 'light_1'
      - conditions:
          - '{{ event == 3002 }}'
        sequence:
          - choose:
              - conditions: "{{ force_brightness }}"
                sequence:
                  - service: light.turn_on
                    target: !input 'light_2'
                    data:
                      transition: 1
                      brightness_pct: !input brightness
            default:
              - service: light.turn_on
                target: !input 'light_2'
                data: {}
      - conditions:
          - '{{ event == 4002 }}'
        sequence:
          - service: light.turn_off
            data: {}
            target: !input 'light_2'
      - conditions:
          - '{{ event == 5002 }}'
        sequence:
          - choose:
              - conditions: "{{ force_brightness }}"
                sequence:
                  - service: light.turn_on
                    target: !input 'light_3'
                    data:
                      transition: 1
                      brightness_pct: !input brightness
            default:
              - service: light.turn_on
                target: !input 'light_3'
                data: {}
      - conditions:
          - '{{ event == 6002 }}'
        sequence:
          - service: light.turn_off
            data: {}
            target: !input 'light_3'
      # ---------------------------- INCREASE OR DECREASE BRIGHTNESS ---------------------------- #
      - conditions:
          - '{{ event == 1001 }}'
        sequence:
          - repeat:
              until:
                - condition: template
                  value_template: '{{ event == 1003 }}'
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 10
                    transition: 0.5
                  target: !input 'light_1'
                - delay: '0.2'
      - conditions:
          - '{{ event == 2001 }}'
        sequence:
          - repeat:
              until:
                - condition: template
                  value_template: '{{ event == 2003 }}'
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -10
                    transition: 0.5
                  target: !input 'light_1'
                - delay: '1'
      - conditions:
          - '{{ event == 3001 }}'
        sequence:
          - repeat:
              until:
                - condition: template
                  value_template: '{{ event == 3003 }}'
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 10
                  target: !input 'light_2'
                - delay: '0.2'
      - conditions:
          - '{{ event == 4001 }}'
        sequence:
          - repeat:
              until:
                - condition: template
                  value_template: '{{ event == 4003 }}'
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -10
                  target: !input 'light_2'
                - delay: '1'
      - conditions:
          - '{{ event == 5001 }}'
        sequence:
          - repeat:
              until:
                - condition: template
                  value_template: '{{ event == 5003 }}'
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 10
                  target: !input 'light_3'
                - delay: '0.2'
      - conditions:
          - '{{ event == 6001 }}'
        sequence:
          - repeat:
              until:
                - condition: template
                  value_template: '{{ event == 6003 }}'
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -10
                  target: !input 'light_3'
                - delay: '1'
      # ---------------------------- MAX OR MIN BRIGHTNESS ---------------------------- #
      # ---------- MAX ---------- #
      - conditions:
          - '{{ event == 1004 }}'
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 100
              transition: 0.5
            target: !input 'light_1'
      - conditions:
          - '{{ event == 3004 }}'
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 100
              transition: 0.5
            target: !input 'light_2'
      - conditions:
          - '{{ event == 5004 }}'
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 100
              transition: 0.5
            target: !input 'light_3'
      # ---------- MIN ---------- #
      - conditions:
          - '{{ event == 2004 }}'
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 10
              transition: 0.5
            target: !input 'light_1'
      - conditions:
          - '{{ event == 4004 }}'
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 10
              transition: 0.5
            target: !input 'light_2'
      - conditions:
          - '{{ event == 6004 }}'
        sequence:
          - service: light.turn_on
            data:
              brightness_pct: 10
              transition: 0.5
            target: !input 'light_3'

Notes

It has been tested and works fine. If you run into problems or if you want me to add more events in the blueprint, please let me know :smile:

6 Likes

Hi everyone,

how can i use blueprint with cc2531 zigbee2mqtt?

You have to adapt it to what details Z2M provides

Hey man,

Awesome job. My opples will be delivered soon. I want to use 1 opple for my curtains. Is it possible to make this work with curtains open/close % instead of brightness?

Tnx

Perhaps this will help you: deCONZ - Aqara D1 (1 way) remote for cover

I just don’t know if the event codes correspond to this blueprint, otherwise you could take it over and adjust it yourself :wink:

Tnx. I tried your blueprint yesterday and seem to work ok-ish. Sometimes the lights respond quite slow.

Maybe that’s because of the built-in delay and transition in my yaml code.

Hi, great job. I tried your code and it worked great, but I only have one problem. This feels more as a problem with the Aqara switch but when you hold the button to dim to long you don’t get a x003 Release (after hold) command and the light just continue to dim until max or min. I checked the events responds in HA -> Developer Tools -> Events and I can see that if I hold any button for less then around 5s I receive the x001 Hold and then the x003 Release (after hold) command but if I hold longer I only get the x001 Hold and no x003 Release (after hold) command. Have you seen this problem and do you know if there is anything you can do about it?

Thanks.

I hadn’t noticed it before but I’m experiencing the same problem, strange that we don’t get an x003 status when you hold down for a very long time.

EDIT:

Currently I have also opened a new issue about this, it may be fixed in the next stable release of deCONZ.

1 Like

can you make six independent buttons (with long and double click press) and also add scenes in the actions not only lights

that will then be a completely different blueprint, something that will not be high on my list to pick up at the moment.

1 Like

Hello, could you control your curtains with opple?

Yes, I’ve used the following blueprint as a base. I modified the the device model to lumi.remote.b286opcn01 and used different events. I can share if you want, but will be a bit later today as I’m not at my PC

Thanks friend, sorry for the delay in answering, i had lost my account :confused:

Hi, nice work. Does it work with 6 single buttons as well, and 6 lights, where the dimming cycles up and down. I like to have similar behaviour with the KNX Switches we have, where we use the relative dimming for KNX:

A hint how to do this would be OK as well :wink:

I’m looking for some blueprint with the opple switch to control my roller shutters. Any thought?

With some tweaking you might be able to use these: deCONZ - Aqara D1 (1 way) remote for cover

The 6way switch maybe also?

@klaasnicolaas would it possible for you to make the blueprint timeout after 6 seconds and stop the dimming process. Then the user can just start it again (release and hold again) to resume the process. The script is great, well done. With that workaround it could be used, even with this glitch in Deconz. Also, is it possible to make the blueprint usable for 2 and 4 buttons? Either by accepting those buttons as input (and then then user just doesn’t configure the extra buttons) or by making two more cut-down versions?
Great work.

I think it is indeed a good addition to set a timeout there, just have to see how that should be added in the yaml code these days. As for the other button models, I would prefer cut down versions derived from this one.