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

Is it possible to modify this blueprint so that it does not create logs entries for any zigbee device associated with the zigbee2mqtt base topic.

The blueprint generates logs for devices that it is not associated with. I understand that this is due to the way that the automation is created to avoid using a device id, however it is undesirable to have this automation create logs for all devices.

Can you advise how to stop this automation from matching mqtt messages and creating logs from devices that it isn’t associated with?

Looking for to your response
Thanks!

Just to help me understand, which logs are you referring to?

It probably is as you say, relating to the way the device is selected, however, my automations using the blueprint don’t trigger when other Z2M MQTT devices send messages so I think there’s a difference perhaps to your experience?

The logbook logs within homeassistant.
I’ve uploaded an image where the symfonisk GEN2 automation matches the cube actions and other devices.

Open to any guidance in troubleshooting this. Thanks!

1 Like

Thanks will take a look when I get a second.

For everyone else, Z2M has been updated today with the fix for the dot buttons :+1:

3 Likes

Hi. I have a feature wish :slight_smile: I would like to set the max volume level that can be set using the remote. Kids can use the remote to switch the Xmax lights on/off, but use it also for music control and they love very loud music… Thanks!

Hi. Not sure it’s something you’ll be able to limit with this blueprint (thanks again Shawsky, it runs flawlessly now and I really love it). But do you know you’re able to limit the sonos speaker max volume speaker per speaker in the app ? I understand that couldn’t be the best but it’s a workable turnaround if You as an user never play the music loud.

I have Denon speakers and didn’t find any max volume limit in the settings :frowning:

My bad. This topic focus so much on Sonos speakers I thought the remote was dedicated to it.

I think as has been said it’s out of scope for the blueprint to deal with max volumes, in light of grouping/multiple combined speakers etc, however, I think it would be possible for you to add an automation to detect volume hitting or going over say 85% and setting the volume to 85% in effect setting a mex volume.

Something like that should give you what you need :slight_smile:

I noticed the same behaviour

I’ve had a look into the LogBook issue and there isn’t anything that can be done I’m afraid. There’s no way for a Blueprint/Automation to control whether an entry is made or not.

If you have more than one of the controllers and an automation set up for each using my blueprint (like I do) then they will all fire but only the relevant one will process so technically speaking the logbook is correct and is functioning as designed.

If you don’t wish to see entries from these automations you can use logbook filtering and exclusions Logbook - Home Assistant (home-assistant.io)

I’m interested in tweaking this blueprint for my use case - multiple media players outputting to a single source. I’m too cheap to buy Sonos so use a combination of media players (airplay, headless plexamp, MPD, and Mopidy) which all output their audio to Snapcast which then serves a simultaneous audio stream to clients on devices around the house. I use the Snapcast integration or standalone web app to switch the source and the respective integrations/apps for the media players to control the queue, play/pause, etc. I’d like to dynamically change the media_player defined in the input section based on whichever is currently playing or in a paused playback state - is that feasible? I’m new to working directly with scripts/YAML blueprints.

edit: I just set up 2 identical automations for the 2 media players and mapped one of the buttons to deactivate the current automation and activate the other. Works great!

The blueprint is working fine on booth my media controlers. But I do get an warning message in the log file: YAML file /config/blueprints/automation/homeassistant/Z2M_IKEA_Symfonisk.yaml contains duplicate key “sequence”. Check lines 199 and 206

Hi, Could you point me to the log you’re looking at please? I can’t see anything wrong with the code and also not seeing any warnings on my setup.

Thanks

Hi!

thanks for the blueprint, but it does not work for me.
I investigated why:

In my Z2M I am using a naming scheme like Room/Device, for example BueroGross/SonosRemote

This causes Z2M to put the devices deeper in the MQTT tree:
image

I modified your blueprint to use a manually provided MQTT-Path instead of the selector but I bet there is a better solution.

The positive thing is, I was also able to tailor the trigger this way, so that only the right automation is triggered. Maybe this helps:

blueprint:
  name: Z2M - IKEA Symfonisk sound controller GEN2 for media
  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:
    mqtt_topic:
      name: MQTT Topic without the ending /action
      default: zigbee2mqtt/Room/Devicename
    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.0
          max: 100.0
          step: 5.0
          unit_of_measurement: Num
          mode: slider
    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: {}
  source_url: https://community.home-assistant.io/t/z2m-ikea-symfonisk-gen2-e2123-media-control/559523
mode: restart
max_exceeded: silent
trigger_variables:
  mqtt_topic: !input mqtt_topic
trigger:
- platform: mqtt
  topic: '{{ mqtt_topic }}/action'
action:
- variables:
    controllertopic: '{{ mqtt_topic }}/action'
    player: !input media_player
    steps: !input volume_steps
    stepsize: '{{ 1.0 / steps }}'
- choose:
  - conditions:
    - '{{ trigger.payload != ''''}}'
    - '{{ trigger.topic == controllertopic }}'
    sequence:
    - choose:
      - conditions: '{{ trigger.payload == ''toggle'' }}'
        sequence:
        - service: media_player.media_play_pause
          entity_id: !input media_player
      - conditions: '{{ trigger.payload == ''track_next'' }}'
        sequence:
        - service: media_player.media_next_track
          entity_id: !input media_player
      - conditions: '{{ trigger.payload == ''track_previous'' }}'
        sequence:
        - service: media_player.media_previous_track
          entity_id: !input media_player
      - 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 }}'
      - 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 }}'
      - 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 }}'
      - 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 }}'
      - 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 }}'
      - 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 }}'
      - 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 }}'
      - 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 }}'
      - conditions: '{{ trigger.payload == ''dots_1_short_release'' }}'
        sequence: !input single_dot
      - conditions: '{{ trigger.payload == ''dots_1_double_press'' }}'
        sequence: !input single_dot_double_press
      - conditions: '{{ trigger.payload == ''dots_1_long_press'' }}'
        sequence: !input single_dot_long_press
      - conditions: '{{ trigger.payload == ''dots_2_short_release'' }}'
        sequence: !input double_dot
      - conditions: '{{ trigger.payload == ''dots_2_double_press'' }}'
        sequence: !input double_dot_double_press
      - conditions: '{{ trigger.payload == ''dots_2_long_press'' }}'
        sequence: !input double_dot_long_press

1 Like

Yeah it no longer fires all automations as you’ve hard coded the path - that’s expected. I plan on keeping the blueprint generic as it’s more user friendly that way.

Incidentally, the the mqtt_topic configuration is there for exactly this sort of thing, where you’ve either explicitly or via your setup altered the message topic. You might not need to use a modified version at all :slight_smile:

I wasn’t able to find a configuration that works though.

The point is that if I configured zigbee2mqtt/BueroGross your code would look for zigbee2mqtt/BueroGross/BueroGross_SonosRemote or something like that as HA builds a name inlcuding the path.
IIRC

FIrst of all, thanks for the blueprint.

I tried following your advice to re-add the device if it was updated, however I am having issues with that.
My device was updated after installing it the first time a while back and worked with some glitches (not all commands coming through), so after reading here I should re-add it, I went to do just that. I deleted the device from Z2M, removed the batteries for a bit (and a lonnger period of time, also replaced batteries), put it back together and now I can’t get it to start the interview again. I press and hold the connect/reset button for 10s, there is a barely noticable blink of the light and nothing else happens. Am I doing something wrong? Thanks for your replies

Nevermind, after about a 100 tries the light all of a sudden started dreaming and it connected to the network as expected. I am somehow afraid to ever repeat this process again. :slight_smile:

Keep up the good work and cheers.

I added additional condition before action as other action topics triggered this automation for false positives:

condition:
  - condition: template
    value_template: "{{ trigger.topic == base_topic+'/'+device_attr(controller, 'name')+'/action' }} "

1 Like