Zigbee2MQTT - IKEA Symfonisk Gen2 [E2123] Media Control v1.55a

Thanks @Rudinhoo , @BRTK I wonder if it’s a language thing? Could you let me know exactly what you named your controllers and anything relevant to your setup please?

Are you using the group settings/options in Z2M at all?

Any detail you can think of that might be helpful, please share so I can try and replicate. The manufacturer and product code should be enough to show your devices in the blueprint so there must be something else we need to find.

Hey!
Yep, guess we are both on German. My device is named “Symfonisk Remote Bad”. But even without renaming I didn’t see the device in the blueprint. I run Home Assistant Green, everything is up to date.
So far I only have 4 other devices in Z2M (Aqara), no issues.
I’m not sure what else could be relevant.

I changed the HA language + Z2M language but still no luck.

this is the device name and friendly name


But for me it was the same as for @Rudinhoo it didnt matter if i change the friendly name or not the device was not showing in the blueprint.

Zigbee2mqtt Version: 2.0.0-2
Not using the group settings in Z2M
The remote is directly connected to the coordinator / Sonoff Stick
Latest HA Version

and i’m also not sure what else informations I could provide you

@Rudinhoo @BRTK

Thanks both, I think that’s probably all you could provide but I can try a few things using the names you’ve used. I can’t think of a reason why they don’t show at the moment so just need to try a few things.

Z2M groups was certainly an issue for others in the past but can be ruled out based on your feedback.

Leave it with me, I’ll come back to you as soon as I can.

** EDIT ** Having gone back to the beginning on my own setup it seems something has broken or been changed in HA that stops the remotes showing up. If I go to established usages of the Blueprint it is happy to list the remote that was originally selected.

Will be looking into it later

@Rudinhoo, @BRTK

Please re-import the Blueprint I’ve resolved the problem.

It seems Z2M has changed the description of the remote to drop “(E2123)” as well as the earlier addition of a comma.

It should all work ok now but please let me know :smiley:

1 Like

Hey @Shawsky ,
wow, amazing, it works!! I really appreciate your support. I’m new to Home Assistant, started a month ago and this was my first community contact. Looking forward to new stuff! :slight_smile:

1 Like

Excellent, no worries, happy to help and thanks for confirming it’s all ok :smiley:

Have fun learning and trying things out!

1 Like

This blueprint works for me, many thanks for sharing it!

The only thing I would like to have it’s a configurable action for play_pause button when nothing is playing/paused. With that action I could start playing a music or radio station, just by pressing the play button.

Perhaps this (already tested it):

blueprint:
# Media control via IKEA Symfonisk Gen2 - Shawsky April 2023 v1.55a
# Updated January 2025 - Fix Z2M Changed device description preventing devices being discovered
# Updated April 2024 - Add additional filtering to prevent triggering from other devices/false positives. Thanks kenno.
# Updated April 2024 - Add support for device rename in upcoming Z2M release & allow legacy action for Play/Pause
# Updated September 2023 - Further updates for group/non grouped behaviour / fix issue for volume hold for grouped/non grouped. Allow 100 volume steps.
# Updated August 2023 - Resolve a volume issue for media players with no group_memeber attribute
# Updated June 2023 - Resolve filtering issue where multiple devices are in use
# Updated May 2023 - Add group volume control

# Volume changes partially based on https://gist.github.com/erkr/a437ebcb98a2b5ba2deebabd02f5ffae Eric Kreuwels
# and https://gist.github.com/alexwmaustin/2c25cfa1a0ade1ab9fc1ef0940289672 Alex Austin

  name: Z2M - IKEA Symfonisk sound controller GEN2 for media
  author: Shawsky
  description: 
    'Control the selected media player (and any joined to it) with an IKEA Symfonisk sound controller GEN2 via Zigbee2MQTT (Z2M)

    Supports single press on media buttons and single, double and long press for the "dot" buttons.'
  domain: automation
  input:
    remote:
      name: Remote
      description: The IKEA Symfonisk controller GEN2 to use
      selector:
          device:
            filter:
            - integration: mqtt
              manufacturer: IKEA
              model: SYMFONISK sound remote gen2 (E2123)
            - integration: mqtt
              manufacturer: IKEA
              model: SYMFONISK sound remote, gen 2 (E2123)
            - integration: mqtt
              manufacturer: IKEA
              model: SYMFONISK sound remote, gen 2
    base_topic:
      name: Zigbee2MQTT Base mqtt topic
      description: The base topic configured in Zigbee2MQTT. If you haven't changed this, leave the default here ("zigbee2mqtt")
      default: zigbee2mqtt
    media_player:
      name: Media Player
      description: The media player to control with this automation
      selector:
        entity:
          domain: media_player
          multiple: false
    volume_steps:
      name: Volume number of steps
      description: Controls the volume scale. The default of 25 is the same scale as the Sonos app.
      default: 25
      selector:
        number:
          min: 5
          max: 100
          step: 5
          unit_of_measurement: "Num"
          mode: slider
    default_play:
      name: Default play action
      description: Action to run on single press on button play when nothing is playing or paused
      default: []
      selector:
        action: {}
    single_dot:
      name: Single Dot (Single)
      description: Action to run on single dot press
      default: []
      selector:
        action: {}
    single_dot_double_press:
      name: Single Dot (Double)
      description: Action to run on single dot double press
      default: []
      selector:
        action: {}
    single_dot_long_press:
      name: Single Dot (Long)
      description: Action to run on single dot long press
      default: []
      selector: 
        action: {}
    double_dot:
      name: Double Dot (Single)
      description: Action to run on double dot press
      default: []
      selector:
        action: {}
    double_dot_double_press:
      name: Double Dot (Double)
      description: Action to run on double dot double press
      default: []
      selector:
        action: {}
    double_dot_long_press:
      name: Double Dot (Long)
      description: Action to run on double dot long press
      default: []
      selector:
        action: {}
      
mode: restart
max_exceeded: silent

trigger_variables:
  base_topic: !input base_topic
  controller: !input remote

trigger:
  - platform: mqtt
    topic: "{{ base_topic }}/+/action"
condition:
  - condition: template
    value_template: "{{ trigger.topic == base_topic+'/'+device_attr(controller, 'name')+'/action' }} "  
action:
  - variables:
      controllertopic: "{{ base_topic }}/{{ device_attr(controller, 'name') }}/action"
      player: !input 'media_player'
      steps: !input volume_steps
      stepsize: '{{ 1.0 / steps }}'
  - choose:
    - conditions:
      - "{{ trigger.payload != ''}}"
      - "{{ trigger.topic == controllertopic }}"
      sequence:
        - choose:
          ## Commands

          # Play / Pause
          - conditions: "{{ trigger.payload == 'toggle' or trigger.payload == 'play_pause' }}"
            sequence:
              - choose:
                - conditions: "{{ states(player) in ['playing', 'paused'] }}"
                  sequence:
                    - service: media_player.media_play_pause
                      entity_id: !input 'media_player'
                default: !input default_play
          # Next Track
          - conditions: "{{ trigger.payload == 'track_next' }}"
            sequence:
            - service: media_player.media_next_track
              entity_id: !input 'media_player'
          # Previous Track
          - conditions: "{{ trigger.payload == 'track_previous' }}"
            sequence:
            - service: media_player.media_previous_track
              entity_id: !input 'media_player'

          ## Volume for media players supporting groups

          # Volume Up Press
          - conditions: "{{ trigger.payload == 'volume_up' and state_attr(player, 'group_members') != none and state_attr(player, 'group_members') != [] }}"
            sequence:
              - repeat:
                  for_each: "{{ state_attr(player, 'group_members') }}"
                  sequence:
                  - service: media_player.volume_set
                    target:
                      entity_id: "{{ repeat.item }}"
                    data:
                      volume_level: >-
                        {% set volume = state_attr(repeat.item, "volume_level") + stepsize %}
                        {{ 1.0 if volume > 1.0 else volume }}

          # Volume Down Press
          - conditions: "{{ trigger.payload == 'volume_down' and state_attr(player, 'group_members') != none and state_attr(player, 'group_members') != [] }}"
            sequence:
              - repeat:
                  for_each: "{{ state_attr(player, 'group_members') }}"
                  sequence:
                  - service: media_player.volume_set
                    target:
                      entity_id: "{{ repeat.item }}"
                    data:
                      volume_level: >-
                        {% set volume = state_attr(repeat.item, "volume_level") - stepsize %}
                        {{ 0.0 if volume < 0.0 else volume }}

          # Volume Up Hold
          - conditions: "{{ trigger.payload == 'volume_up_hold' and state_attr(player, 'group_members') != none and state_attr(player, 'group_members') != [] }}"
            sequence:
              - repeat:
                  for_each: "{{ state_attr(player, 'group_members') }}"
                  sequence:
                  - service: media_player.volume_up
                    target:
                      entity_id: "{{ repeat.item }}"

          # Volume Down Hold
          - conditions: "{{ trigger.payload == 'volume_down_hold' and state_attr(player, 'group_members') != none and state_attr(player, 'group_members') != [] }}"
            sequence:
              - repeat:
                  for_each: "{{ state_attr(player, 'group_members') }}"
                  sequence:
                  - service: media_player.volume_down
                    target:
                      entity_id: "{{ repeat.item }}"

          ## Volume for media players not supporting groups

          # Volume Up
          - conditions: "{{ trigger.payload == 'volume_up' and (state_attr(player, 'group_members') == none or state_attr(player, 'group_members') == []) }}"
            sequence:
              - service: media_player.volume_set
                target:
                  entity_id: "{{ player }}"
                data:
                  volume_level: >-
                    {% set volume = state_attr(player, "volume_level") + stepsize %}
                    {{ 1.0 if volume > 1.0 else volume }}
           
          # Volume Down Press
          - conditions: "{{ trigger.payload == 'volume_down' and (state_attr(player, 'group_members') == none or state_attr(player, 'group_members') == []) }}"
            sequence:
              - service: media_player.volume_set
                target:
                  entity_id: "{{ player }}"
                data:
                    volume_level: >-
                      {% set volume = state_attr(player, "volume_level") - stepsize %}
                      {{ 0.0 if volume < 0.0 else volume }}
          
          # Volume Up Hold
          - conditions: "{{ trigger.payload == 'volume_up_hold' and (state_attr(player, 'group_members') == none or state_attr(player, 'group_members') == []) }}"
            sequence:
              - service: media_player.volume_up
                target:
                  entity_id: "{{ player }}"
          
          # Volume Down Hold
          - conditions: "{{ trigger.payload == 'volume_down_hold' and (state_attr(player, 'group_members') == none or state_attr(player, 'group_members') == []) }}"
            sequence:
              - service: media_player.volume_down
                target:
                  entity_id: "{{ player }}"

          ## Actions

          # Single Dot Press
          - conditions: "{{ trigger.payload == 'dots_1_short_release' }}"
            sequence: !input single_dot
          # Single Dot Double Press
          - conditions: "{{ trigger.payload == 'dots_1_double_press' }}"
            sequence: !input single_dot_double_press
          # Single Dot Long Press
          - conditions: "{{ trigger.payload == 'dots_1_long_press' }}"
            sequence: !input single_dot_long_press
          # Double Dot Press
          - conditions: "{{ trigger.payload == 'dots_2_short_release' }}"
            sequence: !input double_dot
          # Double Dot Double Press
          - conditions: "{{ trigger.payload == 'dots_2_double_press' }}"
            sequence: !input double_dot_double_press
          # Double Dot Long Press
          - conditions: "{{ trigger.payload == 'dots_2_long_press' }}"
            sequence: !input double_dot_long_press

Hi, glad you find it useful. I have some updates and new features almost ready to go so I will take a look at this and see if I can incorporate it into the Blueprint :slight_smile:

Hoping to have everything ready to go early October.

1 Like

Hi, Thanks a lot for the work you put in this blueprint!

I don’t know what is your current version but I’ve tried to make it work with my ikea remote control and the Sonos/IKEA Symfonisk. The blocking points for me was the play/pause action: pause was OK but play needed to be pressed twice in order to work.

I changed a portion of your code as a workaround:

  1. determine if player is playing or paused.
  2. if paused then send twice the play command.

This work for my use case, maybe it will help others or you have found another elegant solution and share it with us :slight_smile:

In the meantime here is my contribution for the play / pause block:

          # Play / Pause
          - conditions: "{{ trigger.payload == 'toggle' or trigger.payload == 'play_pause' }}"
            sequence:
              - choose:
                - conditions: "{{ states(player) in ['playing'] }}"
                  sequence:
                    - service: media_player.media_pause
                      entity_id: !input 'media_player'
                - conditions: "{{ states(player) in ['paused'] }}"
                  sequence:
                    - service: media_player.media_play
                      entity_id: !input 'media_player'
                    - service: media_player.media_play
                      entity_id: !input 'media_player'
#                default: !input default_play

Hope it will help some, in the meantime thanks again.

Thanks, glad you find it useful.

That sounds like something not quite right with your setup. Make sure you have the latest firmware on your device and try re-registering it first.

You shouldn’t need to add that workaround at all. I’ve multiple devices and never seen this and I think with a few exceptions (changes to Z2MQTT for example) all issues posted in this thread have been something to do with configuration.

I wanted my remotes to only control one speaker (so I could have per-room volume control), so I added this to the config:

control_group:
  name: Control grouped speakers
  description: >
    If enabled, volume controls affect all speakers grouped with the selected
    media player. If disabled, only the selected media player is affected.
  default: false
  selector:
    boolean: {}

control_group: !input control_group

And now there’s a box to check if you want group control or single speaker control

I have an update coming which will help in this regard, it’s well overdue as I was hoping to have it done in October, but it’s almost there.

Should be done over the Christmas period :slight_smile:

1 Like

Everything is ready to go but I can’t edit my post anymore :frowning:

I don’t know why you can’t update a post. You should be able to. @Shawsky

The options have gone. No edit option at the bottom of the post and clicking the pencil at the top only allows me to see the edit history not actually make any changes.

I posted in the Uncategorised section of the community but not sure I’m going to get a response in there and no idea how to get support for something that should just work :man_shrugging:

I pinged someone. Well see

1 Like

Evening Everyone,

Thankyou for your support of this Blueprint over the last few years, those of you making suggestions, testing and feeding back has helped me make it what it is.

I have a new V2.0 ready to go with some exciting/interesting new features but my edit access has been revoked to the topic and I’ve exhausted all avenues to get it re-instated. I’m told it’s just the way the community forum is and I really don’t have time to hit the criteria required on a continual basis just to ensure I can edit my topic. Why this change has occurred and seemingly impossible to override for someone who clearly has and wants to contribute I don’t know :man_shrugging:

With regret, that’s it for updates here. If I setup the yaml somewhere else, I’ll post here with a link.

Cheers

Shawsky

3 Likes

That’s disheartening. Thanks for all of your work, and please do update if you post elsewhere!

1 Like