Skip to content

Instantly share code, notes, and snippets.

@HcgRandon
Created March 27, 2021 19:13
Show Gist options
  • Save HcgRandon/1ae2079e25105ebb9d01a70ef0acb35d to your computer and use it in GitHub Desktop.
Save HcgRandon/1ae2079e25105ebb9d01a70ef0acb35d to your computer and use it in GitHub Desktop.
ZHA - ADUROLIGHT ERIA 4 Button Dim Switch
blueprint:
name: ZHA - ADUROLIGHT ERIA 4 Button Dimming Switch
description: Automate ADUROLIGHT ERIA 4 Button Dimming Switch using ZHA events.
domain: automation
input:
target_switch:
name: Select Target Switch
selector:
device:
integration: zha
manufacturer: ADUROLIGHT
model: Adurolight_NCC
turn_on:
name: Pressed On
description: Action to run when "On" is pressed
default: []
selector:
action:
dim_up:
name: Pressed Dim Up
description: Action to run when "Dim Up" is pressed
default: []
selector:
action:
dim_down:
name: Pressed Dim Down
description: Action to run when "Dim Down" is pressed
default: []
selector:
action:
turn_off:
name: Pressed Off
description: Action to run when "Off" is pressed
default: []
selector:
action:
mode: restart
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input target_switch
action:
- variables:
command: "{{ trigger.event.data.command }}"
step: "{{ trigger.event.data.args[0] }}"
- choose:
- conditions: "{{ command == 'on' }}"
sequence: !input "turn_on"
- conditions: "{{ command == 'off' }}"
sequence: !input "turn_off"
- conditions: "{{ command == 'step' }}"
sequence:
- choose:
- conditions: "{{ step == 0 }}"
sequence: !input "dim_up"
- conditions: "{{ step == 1 }}"
sequence: !input "dim_down"
@PondBeach
Copy link

I changed this part:

  • conditions: "{{ command == 'step' }}"
    sequence:
    - choose:
    - conditions: "{{ step == 0 }}"
    sequence: !input "dim_up"
    - conditions: "{{ step == 1 }}"
    sequence: !input "dim_down"

to this:

  • conditions: "{{ command == 'step' }}"
    sequence:
    - choose:
    - conditions: "{{ step == ''Step.Up'' }}"
    sequence: !input "dim_up"
    - conditions: "{{ step == ''Step.Down'' }}"
    sequence: !input "dim_down"

and got it working

@lurch89
Copy link

lurch89 commented Jan 17, 2023

I also spent way too long trying to find the solution that @PondBeach already commented on. If only I had read the comments.

@ericderuijter
Copy link

ericderuijter commented Feb 24, 2025

Hello i have a working update on the script: my new homeasstitant uses : AduroLight_NCC (Capital L) and the new conditions >> - conditions: '{{ step == ''StepMode.Up'' }}' // - conditions: '{{ step == ''StepMode.Down'' }}'

Maybe the blueprint designer can change the original script too >>

working for me on 24-02-2025 >>

blueprint:
  name: ZHA - ADUROLIGHT ERIA 4 Button Dimming Switch
  description: Automate ADUROLIGHT ERIA 4 Button Dimming Switch using ZHA events.
  domain: automation
  input:
    target_switch:
      name: Select Target Switch
      selector:
        device:
          integration: zha
          manufacturer: ADUROLIGHT
          model: AduroLight_NCC
          multiple: false
    turn_on:
      name: Pressed On
      description: Action to run when "On" is pressed
      default: []
      selector:
        action: {}
    dim_up:
      name: Pressed Dim Up
      description: Action to run when "Dim Up" is pressed
      default: []
      selector:
        action: {}
    dim_down:
      name: Pressed Dim Down
      description: Action to run when "Dim Down" is pressed
      default: []
      selector:
        action: {}
    turn_off:
      name: Pressed Off
      description: Action to run when "Off" is pressed
      default: []
      selector:
        action: {}
  source_url: https://gist.github.com/HcgRandon/1ae2079e25105ebb9d01a70ef0acb35d
mode: restart
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input target_switch
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    step: '{{ trigger.event.data.args[0] }}'
- choose:
  - conditions: '{{ command == ''on'' }}'
    sequence: !input turn_on
  - conditions: '{{ command == ''off'' }}'
    sequence: !input turn_off
  - conditions: "{{ command == 'step' }}"
    sequence:
          - choose:
              - conditions: '{{ step == ''StepMode.Up'' }}'
                sequence: !input "dim_up"
              - conditions: '{{ step == ''StepMode.Down'' }}'
                sequence: !input "dim_down"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment