Mediaplayer attributes to other string (KNX entity)

Hi, I’m using the bose soundtouch plus integration to control my soundtouch device. I’m also able to control it via KNX devices. However, I want to feedback the current track, interpret etc to my KNX devices as well. Looks like I can get this information from the media_player. So, I created a helper that extract the information. (Type template, using {{state_attr("media_player.soundtouch_300_2","media_title") }} ).
That helper shows me already the correct value. And I have also a KNX entity where I can send a string to. (Tested it via Dashboard)

So now I just need to write from one string into another. How can I do that?

Also open for complete different solutions :blush:

Thanks

Hi :wave:!
You can use “expose” https://www.home-assistant.io/integrations/knx/#exposing-entity-states-entity-attributes-or-time-to-knx-bus. No template or Knx entity needed :wink:

1 Like

Thank you, that worked for me.
I still use a template, wasn’t sure with the syntax. But I think thats not to bad, so I can put more code in the template like delete the title if no music is playing.

expose:
  - type: string
    address: "6/0/3"
    entity_id: sensor.soundtouch_currentmediatitle
  - type: string
    address: "6/0/2"
    entity_id: sensor.soundtouch_currentvolume

Example for the volume level helper template:

{{ state_attr("media_player.soundtouch_300_2","volume_level") *100}}
1 Like