Forked from seamus65/zha_symfonisk_remote_lights.yaml
Last active
September 25, 2024 03:04
-
-
Save sbyx/86d7ad965f3751d0bb9111fb8d63da5b to your computer and use it in GitHub Desktop.
Home Assistant Blueprint: ZHA - Symfonisk Sound Controller as dimmer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, e.g., a scene or anything else. | |
Rotating left/right will change the brightness smoothly of the selected light." | |
domain: automation | |
input: | |
remote: | |
name: Remote | |
description: IKEA Symfonisk controller to use | |
selector: | |
device: | |
integration: zha | |
manufacturer: IKEA of Sweden | |
model: SYMFONISK Sound Controller | |
light: | |
name: Light(s) | |
description: The light(s) to control | |
selector: | |
target: | |
entity: | |
domain: light | |
dimmer_interval: | |
name: Dimmer interval | |
description: Interval after which to increase brightness | |
default: 0.2 | |
selector: | |
number: | |
min: 0.1 | |
max: 1.0 | |
step: 0.1 | |
unit_of_measurement: s | |
mode: slider | |
dimmer_steps: | |
name: Dimmer steps | |
description: Number of steps from lowest to highest brightness | |
default: 5 | |
selector: | |
number: | |
min: 2 | |
max: 10 | |
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: {} | |
source_url: https://gist.github.com/sbyx/86d7ad965f3751d0bb9111fb8d63da5b | |
variables: | |
steps: !input "dimmer_steps" | |
step: "{{ 100 / float(steps) }}" | |
command: "{{ trigger.event.data.command }}" | |
args: "{{ trigger.event.data.args }}" | |
mode: restart | |
max_exceeded: silent | |
trigger: | |
- platform: event | |
event_type: zha_event | |
event_data: | |
device_id: !input "remote" | |
action: | |
- choose: | |
- conditions: | |
- "{{ command == 'toggle' }}" | |
sequence: !input "single_press" | |
- conditions: | |
- "{{ command == 'step' and args == [0, 1, 0] }}" | |
sequence: !input "double_press" | |
- conditions: | |
- "{{ command == 'step' and args == [1, 1, 0] }}" | |
sequence: !input "triple_press" | |
- conditions: | |
- "{{ command == 'move' and args == [0, 195] }}" | |
sequence: | |
- repeat: | |
count: !input "dimmer_steps" | |
sequence: | |
- delay: !input "dimmer_interval" | |
- service: light.turn_on | |
target: !input "light" | |
data: | |
brightness_step_pct: "{{ step }}" | |
transition: !input "dimmer_interval" | |
- conditions: | |
- "{{ command == 'move' and args == [1, 195] }}" | |
sequence: | |
- repeat: | |
count: !input "dimmer_steps" | |
sequence: | |
- delay: !input "dimmer_interval" | |
- service: light.turn_on | |
target: !input "light" | |
data: | |
brightness_step_pct: "{{ -step }}" | |
transition: !input "dimmer_interval" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment