Skip to content

Instantly share code, notes, and snippets.

@diminDDL
Created December 4, 2022 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diminDDL/cd973a67f7ae209afa6f929864648e41 to your computer and use it in GitHub Desktop.
Save diminDDL/cd973a67f7ae209afa6f929864648e41 to your computer and use it in GitHub Desktop.
(Improved) ZHA - IKEA Symfonisk sound controller for lights
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
multiple: false
light:
name: Light(s)
description: The light(s) to control
selector:
target:
entity:
domain: light
brightness_step:
name: Brightness step
description: The value of the brighness step when spinning
default: 10
selector:
number:
min: 1
max: 100
mode: slider
step: 1
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/seamus65/0cd586edfee2e245e0b7e8081c5865f1
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 }}'
move_mode: "{{ trigger.event.data.params.move_mode }}"
step_size: "{{ trigger.event.data.params.step_size }}"
step_mode: "{{ trigger.event.data.params.step_mode }}"
br_step: !input brightness_step
- choose:
- conditions:
- '{{ command == ''toggle'' }}'
sequence: !input "single_press"
- conditions:
- "{{ command == 'step' and step_size == 1 and step_mode == 'StepMode.Up' }}"
sequence: !input "double_press"
- conditions:
- "{{ command == 'step' and step_size == 1 and step_mode == 'StepMode.Down' }}"
sequence: !input "triple_press"
- conditions:
- "{{ command == 'move' and move_mode == 'MoveMode.Up' }}"
sequence:
- repeat:
count: 10
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: '{{br_step}}'
transition: 0.5
- delay:
milliseconds: 500
- conditions:
- "{{ command == 'move' and move_mode == 'MoveMode.Down' }}"
sequence:
- repeat:
count: 10
sequence:
- service: light.turn_on
target: !input light
data:
brightness_step_pct: '{{br_step | multiply(-1)}}'
transition: 0.5
- delay:
milliseconds: 500
@maxwood
Copy link

maxwood commented Jan 8, 2023

I'm having an issue where single press to toggle the light on/off causes the light to flash instead. Do you have the same problem?

@diminDDL
Copy link
Author

diminDDL commented Jan 8, 2023

@maxwood I believe this is an issue with the firmware on the remote itself, for me a single press would produce 3 calls in the HA logbook. I was unable to implement a filter for this in yaml as it's way too annoying. I maybe one day will try AppDaemon to fix this. In the meantime I recommend setting up OTA, maybe an update will fix this.

@diminDDL
Copy link
Author

diminDDL commented Jan 8, 2023

Actually it looks like it fixed itself @maxwood After updating HA and having OTA set up for about a month it seems to have fixed itself on my end.
image
image

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