ZHA - IKEA Symfonisk sound controller for media (the spinny one)

Blueprint to support the Ikea Symfonsik sound controller and allow it to control a media player, and other devices.

The Symfonisk sound controller supports:

  • Single press
  • Double press
  • Triple press
  • Rotate left
  • Rotate right

Screen

Blueprint

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or import this Blueprint by using the forum topic URL:

blueprint:
  name: ZHA - IKEA Symfonisk sound controller for media
  description: 'Control media with an IKEA Symfonisk sound controller (the spinny ones).

    Single press will toggle Play/Pause on your selected media player.
    
    You can set functions for double press and triple press.

    Rotating left/right will change the volume smoothly of the selected media player, if that function is possible.'

  domain: automation
  input:
    remote:
      name: Remote
      description: IKEA Symfonisk controller to use
      selector:
        device:
          integration: zha
          manufacturer: IKEA of Sweden
          model: SYMFONISK Sound Controller
    media_player:
      name: Media Player
      description: The media player to control
      selector:
        target:
          entity:
            domain: media_player
    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/35bd8cf0323961aa42847a11c17e0de0
mode: single
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 }}'
- choose:
  - conditions:
    - '{{ command == ''toggle'' }}'
    - '{{ cluster_id == 6 }}'
    - '{{ endpoint_id == 1 }}'
    sequence:
    - service: media_player.media_play_pause
      target: !input 'media_player'
  - conditions:
    - '{{ command == ''step'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ trigger.event.data.params.step_mode == 0 }}'
    sequence: !input 'double_press'
  - conditions:
    - '{{ command == ''step'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ trigger.event.data.params.step_mode == 1 }}'
    sequence: !input 'triple_press'
  - conditions:
    - '{{ command == ''move'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ trigger.event.data.params.move_mode == 0}}'
    sequence:
    - service: media_player.volume_up
      target: !input 'media_player'
    - delay: 1
  - conditions:
    - '{{ command == ''move'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ trigger.event.data.params.move_mode == 1 }}'
    sequence:
    - service: media_player.volume_down
      target: !input 'media_player'
    - delay: 1
6 Likes

Thank you so much for this!

So I just tested this and I have some feedback.

I’m using this to control my Sonos system and I’m finding that rotating for volume up and volume down is very slow. Is there a way to make the volume more responsive?

Second, and not sure this is possible, since I’m using this for my Sonos I would like to be able to define the action for the single press. I need the volume control to work on all of the sonos speakers on the floor but the skip track feature should only be applied to a single media player. If I apply it to all of them then I get multiple skips because I am telling all of the speakers to skip.

I suppose this could be avoided if there were some sort of “increase volume of the sonos group” service but I don’t think there is. Even then, I would need a custom action for the volume up and volume down.

Because of the draconian reply policy, I’ve had to delete my previous reply in order to update with a new version.

Anyway, here is my version of this blueprint. It debounces (using the debouncing code from ZHA - IKEA Trader Shortcut button debounced, which seems to be working okay).

It also uses the script mode of “always” to better handle the volume changes - spinning the device starts the volume up or down loop, and when it stops that interrupts the running blueprint, stopping the volume change.

The various delays seem to be working okay for me right now.

blueprint:
  name: ZHA - IKEA Symfonisk sound controller for media
  description: 'Control media with an IKEA Symfonisk sound controller (the spinny
    ones).

    Single press will toggle Play/Pause on your selected media player.

    You can set functions for double press and triple press.

    Rotating left/right will change the volume smoothly of the selected media player,
    if that function is possible.'
  domain: automation
  input:
    remote:
      name: Remote
      description: IKEA Symfonisk controller to use
      selector:
        device:
          integration: zha
          manufacturer: IKEA of Sweden
          model: SYMFONISK Sound Controller
    media_player:
      name: Media Player
      description: The media player to control
      selector:
        target:
          entity:
            domain: media_player
    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://community.home-assistant.io/t/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one/266130/3
mode: restart
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 }}'
- choose:
  - conditions:
    - '{{ command == ''stop'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    sequence:
    - delay: 0.1
  - conditions:
    - '{{ command == ''toggle'' }}'
    - '{{ cluster_id == 6 }}'
    - '{{ endpoint_id == 1 }}'
    sequence:
    - wait_for_trigger:
      - platform: event
        event_type: zha_event
        event_data:
          device_id: !input 'remote'
          endpoint_id: 1
          cluster_id: 8
          command: 'toggle'
      timeout:
        milliseconds: 500
      continue_on_timeout: true
    - service: media_player.media_play_pause
      target: !input 'media_player'
  - 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:
        while:
        - condition: template
          value_template: "{{ repeat.index < 10 }}"
        sequence:
        - service: media_player.volume_up
          target: !input 'media_player'
        - delay: 0.1
  - conditions:
    - '{{ command == ''move'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [1, 195] }}'
    sequence:
      repeat:
        while:
        - condition: template
          value_template: "{{ repeat.index < 10 }}"
        sequence:
        - service: media_player.volume_down
          target: !input 'media_player'
        - delay: 0.1
6 Likes

Does this mean you can’t “accelerate” the turning up or down of volume by quickly turning the wheel in little steps or one big step but instead have to wait until it reaches the desired volume by itself?

So how you turn the wheel doesn’t make any difference?

Sorry…hope you get my point. It’s hard to describe what I mean…

Yeah, I understand what you mean - I don’t think there is a way to detect how fast the knob is spinning, only when it started spinning and when it stopped spinning.

I’ve also found at times it gets a bit behind, and events keep coming in seconds after interaction has stopped. Hence my kids are not allowed to touch the “black knob”, which is hooked up through HA.

(To be honest though, I think I have seen that behaviour with the IKEA hub connected one too, so they really aren’t supposed to play with the “white knob” either)

Ok, thanks. Looking for a better way to control my volume then.

Coool, i was looking for this a while. Very nice!


I’m still learning how everything works so sorry if my question is stupid. But why is my Symfonisk sound controller not selectable in the automation?

Welcome to the forum :partying_face:

Have you got the Symfonisk connected to your HA using the ZHA Integration?

1 Like

Hi, thanks for your reply. i guess not. It has been added via the Ikea TRĂ…DFRI integration.

I’m now running HA on my synology, but will start running it on a RasberryPI soon. I guess i need ZHA hardware to run the Symfonisk sound controler?

ZHA is just the integration method, not hardware. I’m guessing however that it’s likely not possible to use the ZHA integration with an IKEA zigbee hub. I’m currently using a Conbee2.

Hi sparkydave, so you replaced the Ikea hub with the Conbee 2? So you don’t use the Ikea integration? I integrade via the Conbee2 and link all the ikea lights etc via Conbee 2?

Correct. I never had an IKEA hub at all.

Nope

You can do it that way although surely the Symfonisk can be used with the IKEA Integration, just not with this Blueprint. Perhaps the Blueprint can be modified slightly to work with the IKEA Integration, I’m not sure as I haven’t yet tried creating a Blueprint. All my existing automations are in YAML.

Thanks, let me investigate further. What i want to achieve is using the Symfonisk sound controller for my HEOS speaker setup.

Hi sparkydave,

I got it working. The symfonsik controller is connected via ZHA the plueprint is in. The only part which doesn’t work yet is the HEOS volume control. What are the next steps to take? Can you help me with that?

Hi sparkydave, i got it working. Thanks for your help anyway!

Oh awesome, sorry I didn’t get back to you sooner.

Hey there,

I have been tinkering with your code and came up with a template that would read the current
media player volume value and add/subtract a floating value in order to try to smooth the stepping even further (I think).

Unfortunately I am having trouble with inserting selectors into my template so the media player entities are manually added. Give it a go and see what you think after merging, I’ll continue to work on the code in the meantime.

    sequence:
      repeat:
        while:
        - condition: template
          value_template: "{{ repeat.index < 20 }}"
        sequence:
        - service: media_player.volume_set
          entity_id: media_player.INSERT_PLAYER
          data_template:
            volume_level: "{{ state_attr('media_player.INSERT_PLAYER' , 'volume_level') | float + 0.02 }}"
        - delay: 0.75
  - conditions:
    - '{{ command == ''move'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [1, 195] }}'
    sequence:
      repeat:
        while:
        - condition: template
          value_template: "{{ repeat.index < 20 }}"
        sequence:
        - service: media_player.volume_set
          entity_id: media_player.INSERT_PLAYER
          data_template:
            volume_level: "{{ state_attr('media_player.INSERT_PLAYER' , 'volume_level') | float - 0.02 }}"
        - delay: 0.75
2 Likes

This works better - volume changes more rapidly.