Trigger Sonos>Apple Music>Specific Artist/Song

So I know we can trigger SONOS to activate specific ‘favorites’ or Spotify Playlists.
Im wondering if there is a way to trigger Sonos to play a very specific item from the AppleMusic service. If so, how do I structure the YAML?

Please read the category descriptions before posting. Moved.

I created a helper input_text item called songtitle
I added this item to an entity card on my dashboard.
Now when I click on the card I can input a song title or genre.
I then created an automation that when the state of input_text.songtitle changes it runs a script.
The script takes the text from the input_text and feeds it to the media_content_id: field. Then my song is played.

Here is a sample of what my script looks like
#Play User selected Song

play_song_title_from_apple_music:
  alias: Play Song Title from Apple Music
  sequence:
  - service: media_player.turn_on
    data: {}
    target:
      entity_id: media_player.living_room_stereo
  - service: media_player.volume_set
    data:
      volume_level: 0.2
    target:
      entity_id: media_player.living_room_stereo
  - service: media_player.select_source
    data:
      source: audio1
    target:
      entity_id: media_player.living_room_stereo
  - service: media_player.play_media
    data:
      media_content_id: '{{ states.input_text.SongTitle.state }}'
      media_content_type: APPLE_MUSIC
    target:
      entity_id: media_player.charles_s_echo_dot

Hope this helps…but the key to this is getting the song title sent in the media_content_id code.

It would help but sadly it’s not working for me. :frowning:
None of my HomePods starts playing the song. Did something change in HA or am I doing anything wrong? Thanks for your answer in advance!