Need help with custom Mp3s and Alexa Media Player

Very interesting! I’m definitely interested… I’d love to have the ability to play music or other media from HA automations to my Echo devices outside of Amazon Music.
I’ll tinker with this later, but I’m hoping I can get Mymedia running as a docker instead of a bloated Windows VM.

Thank you so much for this! Completely forgot about my WAF security rule on cloudflare

I notice custom mp3s can no longer be stopped from playing with a custom stop command to the speakers through home assistant. Anyone have a solution?

This still works for me (but I am using AMP version 5.7.3) …

              action: call-service
              service: media_player.play_media
              data:
                media_content_id: ask My Media stop
                media_content_type: custom
              target:
                entity_id: media_player.colton_s_echo_show

… but I have refused to update Alexa Media Player because I have way too many automations with notifications to have to go re-write them all again using the new command “action: notify.send_message”

I wonder if it’s your version that’s allowing it. I’m on Version 5.7.9.

I was able to upgrade to 5.7.9 and no longer have any issues with using my code I posted above.

I also am using the Beta version for HA… Core: 2025.11.0b0 with no issues.

I’m assuming you had no issues with your automations with AMP when you updated to 5.7.9?

I had to edit one of the py files to fix the missing action in AMP:

The fix that worked for me:

In 5.7.9's `__init__.py`, edit line 333 and change the `should_get_network` flag from `True` to `False` and restart HA.

If you have updated HA and AMP and using ‘media_content_type: custom’ and ‘media_content_id: ask XXXX stop’ doesn’t work, can you provide your logs so we can investigate it further for you?

After I play my home alarm custom mp3 via a notification with the link to the mp3 in the message section. I send this command to try stop it and it doesn’t work whilst the notification, in this case the mp3 is still playing.

Try typing in the action the way I have mine…

action: call-service
service: media_player.play_media

And in future, it’s always best to paste your yaml rather than taking a screen print. No one wants to type out your code manually… try this:

alias: Stop playing alarms on all speakers
action: call-service
service: media_player.play_media
data:
  media_content_id: ask My Media stop
  media_content_type: custom
target:
  entity_id:
    - media_player.bedroom_echo
    - media_player.bathroom_echo
    - media_player.fire_cube

NOTE: When I paste this yaml into Actions under Developer tools, I get the following error:
‘Defined action is invalid, please provide an action in the format domain.action’. Yet when I tap the stop button I created, it actually stops the mp3.

I dug deeper and found the reason why it still works:

" Existing UI-managed automations will be automatically converted the next time they are edited and saved. If you write automation in YAML, you can use either action or service, as this change is fully backward compatible, but we recommend using action from now on."

So how do you connect that to a button now? I tried entering it into a script and got the same error. Was this just a custom button on a dashboard?

Below is the yaml for the basic functions I use to control MyMediaAlexa using the basic button card. Just do a search and replace of media_player.[YOUR_DEVICE_NAME] including the square brackets, with your media player name, ex. media_player.fire_cube and it should work.

type: vertical-stack
cards:
  - type: custom:gap-card
    height: 15
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        icon: mdi:skip-previous-circle-outline
        name: ""
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: ask My Media previous
            media_content_type: custom
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background: rgba(0,0,0,0.5) !important;
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }
      - type: custom:button-card
        icon: mdi:stop-circle-outline
        name: ""
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: ask My Media stop
            media_content_type: custom
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background: rgba(0,0,0,0.5) !important;
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }
      - type: custom:button-card
        icon: mdi:play-circle-outline
        name: ""
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: ask My Media to play some music
            media_content_type: custom
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background: rgba(0,0,0,0.5) !important;
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }
      - type: custom:button-card
        icon: mdi:pause-circle-outline
        name: ""
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: ask My Media pause
            media_content_type: custom
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background: rgba(0,0,0,0.5) !important;
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }
      - type: custom:button-card
        icon: mdi:skip-next-circle-outline
        name: ""
        tap_action:
          action: call-service
          service: media_player.play_media
          data:
            media_content_id: ask My Media skip
            media_content_type: custom
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background: rgba(0,0,0,0.5) !important;
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        icon: mdi:volume-minus
        name: null
        tap_action:
          action: call-service
          service: media_player.volume_set
          data:
            volume_level: |
              [[[ 
               return states['media_player.[YOUR_DEVICE_NAME]'].attributes.volume_level - 0.1
              ]]]
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }
      - type: custom:gap-card
      - type: custom:mushroom-title-card
        title: Media
        alignment: center
        card_mod:
          style: |
            .header {
              display: block;
              background: none;
              border: none;
              box-shadow: none;
            }
            .title {
                color: rgba(0,215,0,1);
                font-size: var(--title-font-size);
                font-weight: var(--title-font-weight);
                line-height: var(--title-line-height);
                letter-spacing: var(--title-letter-spacing);
                --mdc-icon-size: var(--title-font-size);
            }
      - type: custom:gap-card
      - type: custom:button-card
        icon: mdi:volume-plus
        name: null
        tap_action:
          action: call-service
          service: media_player.volume_set
          data:
            volume_level: |
              [[[ 
               return states['media_player.[YOUR_DEVICE_NAME]'].attributes.volume_level + 0.1
              ]]]
          target:
            entity_id: media_player.[YOUR_DEVICE_NAME]
        card_mod:
          style: |
            ha-card {
              --ha-card-background
              border-width: 3px;
              border-color: rgba(0, 161, 224, 1);
              color: rgba(0, 161, 224,1);
              --card-mod-icon-color: rgba(0,215,0,1);
              font-size: 10px !important;
            }