Not able to play mp3 file on Google Speaker

Hello Everyone,
I have copied mp3 file in /config/media and /config/www folders.
My configuration.yaml file is having following

homeassistant:
  external_url: https://my_sub_domain.my_domain.com
  internal_url: http://192.168.0.101:8123
  media_dirs:
     media: /config/media

I able to play mp3 file on Google Speaker with following code from Developer Tools

action: media_player.play_media
target:
  entity_id: media_player.speaker_in_dining_room
data:
  media_content_type: audio/mp3
  media_content_id: https://my_sub_domain.my_domain.com/local/door_squeak.mp3

I also able to file from “My Media” of Home Assistant on peaker_in_dining_room.

But not able to play file with following code from Developer Tools

action: media_player.play_media
target:
  entity_id: media_player.speaker_in_dining_room
data:
  media_content_type: audio/mp3
  media_content_id: https://my_sub_domain.my_domain.com/media/local/door_squeak.mp3

Got following error

2025-05-03 01:58:35.410 ERROR (Thread-6) [homeassistant.components.cast.media_player] Failed to cast media https://my_sub_domain.my_domain.com/media/local/door_squeak.mp3?authSig=hbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIyOTQxNTRlZmZjZjI0ZTkwOZmIwZGMwZGQ2YTI5ZSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvMTI1MDk3X19kcmVlbF9fZG9vcl9zcXVlYWtfMjhfMDNfMTFfMTIubXAzIiwicGFyYW1zIjpbXSwiaWF0IjoxNMjAxNTEzLCJleHAiOjE3NDYyODc5MTN9.79ZG1oIunGqj5sQLULwo2S9MLSXEYHDRoTLzND44 from external_url (https://my_sub_domain.my_domain.com). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Hello RAUS,

What kind of certs are you using in your external https?
It needs to be a traceable cert, not a local generated one.

Thanks. My domain is hosted on CloudFlare and using docker based Nginx Proxy Manager to reach to docker based Home Assistant. I am using SSL of Nginx Proxy Manager.

How can I check certificate that I am using is traceable and not local generated one. Sorry for very silly question.

On my firefox you click the lock in the status bar by the URL.


It will tell you.

It looks connection to my website is secured and certificate is verified. See the attached screenshots. Am I missing anything else?

Image-1
Screenshot 2025-05-04 at 11.37.18 PM

Image-2

Image-3

Image-4

Image-5

If that is pointing to somewhere inside your instance, it is wrong…

For me in configuration.yaml

homeassistant:
  media_dirs:
    local: /media

Then the /media path becomes part of /local .
And put the mp3 in a folder in HA under

/media/mp3

(The media folder already exists, you would want to add a sub folder to that, or at least I did, to keep your OCD happy.)
When I want to use an MP3, the path is

media-source://media_source/local/mp3/Ships_Bell_4.mp3

Adjust as you desire, but that is a basic version of mine.
Longer version in here: HA Config

Thanks. I able to play required mp3 file on Google Nest speaker from /config/media folder after using media-source as above.

Thanks again.

1 Like