I would like to run a script, that would start playing some radio station on mopidy media player. The name of the radio station would be retrieved from a custom component - variable. So if I run this script, it works:
…scripts…
play_radio:
sequence:
- service: media_player.play_media
data:
entity_id: media_player.mopidy_dnevna
media_content_id: http://live-a.radio.si:80/Europa05
media_content_type: 'audio/mp4'
But if I assign station name to some variable and then use the variable value in the script, it doesn’t work
variable:
radio:
value: "abc"
…scripts…
play_radio:
sequence:
- service: variable.set_variable
data:
variable: radio
value: http://live-a.radio.si:80/Europa05
- service: media_player.play_media
data:
entity_id: media_player.mopidy_dnevna
media_content_id: { states('variable.radio') }
media_content_type: 'audio/mp4'
Could you please help me with the correct syntax?