Control 2 groups of lights using the EcoDim ED-10013 remote in ZHA.
This blueprint supports both on/off and dimming
The time between dimmings steps and the percentage each dimming step takes is configurable.
(Originaly based on ZHA EcoDim ED-10014 4 channel remote )
blueprint:
name: ZHA - EcoDim ED-10013 - 2 Channel Remote
description: 'Control any light using the EcoDim ED-10013 remote on ZHA'
domain: automation
input:
remote:
name: Remote controller
description: Remote to use
selector:
device:
integration: zha
manufacturer: EcoDim
model: ED-10013
light_1:
name: Light row 1
description: The lights that will be controlled with row 1
selector:
target:
entity:
domain: light
light_2:
name: Light row 2
description: The lights that will be controlled with row 2
selector:
target:
entity:
domain: light
step_size:
name: Step Size
description: The % step each dimming step takes
default: 10
selector:
number:
min: 5
max: 25
unit_of_measurement: '%'
step_delay:
name: Step Delay
description: The time between dimming steps (ms)
default: 1000
selector:
number:
min: 100
max: 2000
unit_of_measurement: 'milliseconds'
source_url: https://gist.github.com/TexTown/c0a04da27592c2f238cba24c21ffbe1b
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
args: '{{ trigger.event.data.args }}'
step_size: !input 'step_size'
- choose:
- conditions:
- "{{ command == 'on' }}"
- "{{ cluster_id == 6 }}"
- "{{ endpoint_id == 1 }}"
sequence:
- service: light.turn_on
target: !input 'light_1'
data:
transition: 1
- conditions:
- "{{ command == 'off' }}"
- "{{ cluster_id == 6 }}"
- "{{ endpoint_id == 1 }}"
sequence:
- service: light.turn_off
target: !input 'light_1'
data:
transition: 1
- conditions:
- "{{ command == 'move_with_on_off' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 1 }}"
- "{{ trigger.event.data.args[0] == 0 }}"
- "{{ trigger.event.data.args[1] == 50 }}"
sequence:
repeat:
while:
- condition: template
value_template: "{{ repeat.index < ((100 / step_size)|int) }}"
sequence:
- service: light.turn_on
target: !input 'light_1'
data:
transition: 1
brightness_step_pct: !input 'step_size'
- delay:
milliseconds: !input 'step_delay'
- conditions:
- "{{ command == 'move_with_on_off' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 1 }}"
- "{{ trigger.event.data.args[0] == 1 }}"
- "{{ trigger.event.data.args[1] == 50 }}"
sequence:
repeat:
while:
- condition: template
value_template: "{{ repeat.index < ((100 / step_size) | int) }}"
sequence:
- service: light.turn_on
target: !input 'light_1'
data:
transition: 1
brightness_step_pct: "{{ step_size * -1 }}"
- delay:
milliseconds: !input 'step_delay'
- conditions:
- "{{ command == 'on' }}"
- "{{ cluster_id == 6 }}"
- "{{ endpoint_id == 2 }}"
sequence:
- service: light.turn_on
target: !input 'light_2'
data:
transition: 1
- conditions:
- "{{ command == 'off' }}"
- "{{ cluster_id == 6 }}"
- "{{ endpoint_id == 2 }}"
sequence:
- service: light.turn_off
target: !input 'light_2'
data:
transition: 1
- conditions:
- "{{ command == 'move_with_on_off' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 2 }}"
- "{{ trigger.event.data.args[0] == 0 }}"
- "{{ trigger.event.data.args[1] == 50 }}"
sequence:
repeat:
while:
- condition: template
value_template: "{{ repeat.index < ((100 / step_size) | int) }}"
sequence:
- service: light.turn_on
target: !input 'light_2'
data:
transition: 1
brightness_step_pct: !input 'step_size'
- delay:
milliseconds: !input 'step_delay'
- conditions:
- "{{ command == 'move_with_on_off' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 2 }}"
- "{{ trigger.event.data.args[0] == 1 }}"
- "{{ trigger.event.data.args[1] == 50 }}"
sequence:
repeat:
while:
- condition: template
value_template: "{{ repeat.index < ((100 / step_size)|int) }}"
sequence:
- service: light.turn_on
target: !input 'light_2'
data:
transition: 1
brightness_step_pct: "{{ step_size * -1 }}"
- delay:
milliseconds: !input 'step_delay'