|
blueprint: |
|
name: ZHA - IKEA Symfonisk sound controller for lights |
|
description: Control lights with an IKEA Symfonisk sound controller (the spinny ones). You can set functions for single press, double press and triple press (this allows you to assign a scene, script, etc). Rotating left/right will change the brightness smoothly of the selected light. |
|
domain: automation |
|
source_url: https://gist.github.com/blizzrdof77/ced20025d0328d4adce4c28e8d22cee5 |
|
input: |
|
remote: |
|
name: Remote |
|
description: IKEA Symfonisk controller to use |
|
selector: |
|
device: |
|
integration: zha |
|
manufacturer: IKEA of Sweden |
|
model: SYMFONISK Sound Controller |
|
linked_entity_id: |
|
name: Linked Entity (Optional) |
|
description: Optionally link an entity to use it's custom attributes defined in customize.yaml. |
|
default: "" |
|
selector: |
|
entity: {} |
|
light: |
|
name: Light(s) |
|
description: The light or light group to control. |
|
selector: |
|
entity: |
|
domain: light |
|
sensitivity: |
|
name: Sensitivity |
|
description: Reducing sensitivity will reduce rate of brightness change. |
|
default: 5 |
|
selector: |
|
number: |
|
min: 1 |
|
max: 10 |
|
step: 0.1 |
|
mode: slider |
|
transition_time: |
|
name: Transition |
|
description: Transition time in seconds. |
|
default: 1 |
|
selector: |
|
number: |
|
min: 0 |
|
max: 5 |
|
step: 1 |
|
mode: slider |
|
single_press: |
|
name: Single press |
|
description: Action to run on single press |
|
default: [] |
|
selector: |
|
action: {} |
|
double_press: |
|
name: Double press |
|
description: Action to run on double press |
|
default: [] |
|
selector: |
|
action: {} |
|
triple_press: |
|
name: Triple press |
|
description: Action to run on triple press |
|
default: [] |
|
selector: |
|
action: {} |
|
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 }}' |
|
sensitivity: !input 'sensitivity' |
|
transition_time: !input 'transition_time' |
|
linked_entity: !input 'linked_entity_id' |
|
light_entity: !input 'light' |
|
- variables: |
|
brightness_change_pct: '{{ (sensitivity|float * 2)|int }}' |
|
repetitions: '{{ ((100 / ((sensitivity|float * 2)|int))|int) + 1 }}' |
|
- choose: |
|
- conditions: |
|
- '{{ command == "toggle" }}' |
|
- '{{ cluster_id == 6 }}' |
|
- '{{ endpoint_id == 1 }}' |
|
sequence: !input 'single_press' |
|
- conditions: |
|
- '{{ command == "step" }}' |
|
- '{{ cluster_id == 8 }}' |
|
- '{{ endpoint_id == 1 }}' |
|
- '{{ args == [0, 1, 0] }}' |
|
sequence: !input 'double_press' |
|
- conditions: |
|
- '{{ command == "step" }}' |
|
- '{{ cluster_id == 8 }}' |
|
- '{{ endpoint_id == 1 }}' |
|
- '{{ args == [1, 1, 0] }}' |
|
sequence: !input 'triple_press' |
|
- conditions: |
|
- '{{ command == "move" }}' |
|
- '{{ cluster_id == 8 }}' |
|
- '{{ endpoint_id == 1 }}' |
|
- '{{ args == [0, 195] }}' |
|
sequence: |
|
- repeat: |
|
count: '{{ repetitions|int }}' |
|
sequence: |
|
- service: light.turn_on |
|
data: |
|
entity_id: !input 'light' |
|
brightness_step_pct: '{{ brightness_change_pct }}' |
|
transition: '{{ transition_time|int }}' |
|
- delay: '{{ transition_time|int }}' |
|
- conditions: |
|
- '{{ command == "move" }}' |
|
- '{{ cluster_id == 8 }}' |
|
- '{{ endpoint_id == 1 }}' |
|
- '{{ args == [1, 195] }}' |
|
sequence: |
|
- repeat: |
|
count: '{{ repetitions|int }}' |
|
sequence: |
|
- service: light.turn_on |
|
data: |
|
entity_id: !input 'light' |
|
brightness_step_pct: '{{ brightness_change_pct * -1 }}' |
|
transition: '{{ transition_time|int }}' |
|
- delay: '{{ transition_time|int }}' |