Script to Play MP3s Over Alexa Devices Using AMP and MyMedia - MP3s Longer Than 240 Seconds

So I was today years old when I figured out how to use a script to play mp3’s over my Alexa devices, using MyMedia. Of course you can use MyMedia by voice and she can play what’s in your library, but I wanted to have the ability to play music using automations in Home Assistant.

Once you have installed MyMedia, added your music to it, and you’ve linked your Alexa account, all you need to do then is create the following script:

data:
  media_content_id: ask my media to play My New playlist
  media_content_type: custom
target:
  entity_id: media_player.my_echo_show
action: media_player.play_media

The media_content_id is what you would normally vocally say to Alexa to play your music. The commands work in English, but MyMedia’s website states you can also say commands in German, Italian, French, and Spanish. So these should also work (but I haven’t tested them myself). The commands can be found here.

To stop the music, you would use the following script:

alias: Ask Alexa To Stop Playing My Playlist
sequence:
  - data: {}
    target:
      entity_id: media_player.my_echo_show
    action: media_player.media_stop

Everyone keeps asking how to use Home Assistant to play mp3’s over Alexa devices, well this is how! Hope someone else finds this helpful, as I sure did. :slight_smile:

1 Like