Set value of mediaplayer attribute

Hello ,

is there possibility to change the artist to a other artist ?

The code i have can determine if the attribute is there , but i cant actially overwrite the artist with a new text

only possible if i do manually

{% if state_attr('media_player.kantoor_3', 'media_artist') == None %}
its none  #set media_artist  to "_" 
{% else %}
its something  #do nothing
{% endif %}

i assume it not possible ? :confused:

We’ll start with usually no. But - not enough information does the device you’re controlling allow you to set the artist by itself?

What are you ACTUALLY trying to get done there may be a better way.

i want to overwrite or change the artist of a song

//pseudocode


if (artist === "None") {
  artist = "_";
} else {
  console.log("Artist is not 'None'.");
}



2024-05-14 15_56_07-Overzicht – Home Assistant – Mozilla Firefox

i can change anything in de status window manually but i want a script to to it for me

Changes in THAT interface (dev tools) are not intended to be propagated to the syswand are for testing purposes only. What that interface is doing is just force overwritinv the value in the database and it will be updated the next time the device reports status.

Consider the media player read only. You’re not actually updating its status you just want it to display differently - and that tells us what you need.

What you’re looking for is a way to override what a card says on the UI not the media player entity itself…

Its complex but you can absolutely do that with card mod. Go surf the card mod thread, I’m almost positive there’s media player examples.

1 Like