Improved automation

I have the following actions in an automation:

  action: 
    - service: input_boolean.turn_on
      entity_id: 
        - input_boolean.radio_on
        - input_boolean.radio_play 
    - service: media_player.volume_set
      data_template:
        entity_id: media_player.salotto_audio
        volume_level: 0.60
    - service: media_player.play_media
      data_template:
        entity_id: media_player.salotto_audio
        media_content_id: >
          {{ ["http://icecast.unitedradio.it/Virgin.mp3",
          "http://stream-uk1.radioparadise.com/mp3-192",
          "http://8.38.78.173:8093/;mp3",
          "http://8.38.78.173:8226/;mp3", 
          "http://listen.shoutcast.com/Classic-RockFlorida", 
          "http://broadcast.infomaniak.net/tsfjazz-high.mp3", 
          "http://tx.sharp-stream.com/icecast.php?i=jazzfmmobile.mp3", 
          "http://peridot.streamguys.com:7010/bblive-sgplayer", 
          "http://stream1.rds.it:8000/rds64k", 
          "http://edge.radiomontecarlo.net/MC2.mp3",
          "http://shoutcast.rtl.it:3020/stream/1/",
          "http://soulradio04.live-streams.nl/soultunmp3"] | random }}        
        media_content_type: 'audio/mp4'       

And i’d like to improve it adding a notification with the name of the radio randomly chosen, but i do not know (due to my HA knowledge) where to begin to do this…
Any help?

What I would do is to define an input_text, then before the last step of your existing script, add a step to set the value of the input_text to the random selection. Then in the last step, rather than doing the random selection there, use the value from the input_text. You can then add a notification step that also uses the value of the input_text.

Hmm… very interesting only if i could be so smart to make what you advice me… maybe in a future i will be able to do this… :slight_smile:
BTW thanks for the idea…