Media_play does not work

hitting the same issue trying to use nabu casa cloud_say.

I have the same issue with my Google Home mini. TTS and casting media via HA is not working with the unreachable error message. Although, the HA is reachable via duckdns along with Google Assistant is linked and working correctly with HA. Anyone managed to find a working solution? Thanks.

Same here.

This fixed it. I replaced base_url with my nabu casa one, and its all working now. Feels like I shouldn’t have to do this however.

Has base_url not been deprecated? Thought it was replaced with external_url?
I have external_url pointing to http:://myexternalIP:8123 - but no joy :frowning:

I’m having the same issue as well. It started happening today, worked fine yesterday. I didn’t make any changes either to home assistant or to my cast devices.

I can’t cast TTS, music or videos. Getting the same loglines as mentioned above:

Failed to cast media https://r6---sn-uxaxovg-5god.googlevideo.com/videoplayback..... Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Failed to cast media https://www.home-assistant.io/images/cast/splash.png. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Hi.
I have similar issue.
When I turn on the media player (Nest Mini) through the HomeAssistant card, this error occurs:

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:348 
Integration: Google Cast (documentation, issues)
First occurred: 22:52:42 (1 occurrences) 
Last logged: 22:52:42

Failed to cast media https://www.home-assistant.io/images/cast/splash.png. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address
1 Like

Thanks… this was the solution for me too!

base_url did the trick for me as well !

Hi! Have you solved the problem?

Have I solved it?..no
Has it been solved?.. Yes - but not sure how/ why

I had HA running on a VM and this is where I experienced the issue. I decided to try HA in a docker container - and I can play audio with no issues - tried to replicate the settings on the VM - no sucess.
So I’m moving over to the container - now all I want is to be able to play more than one track at a time - but a seperate thread for that one!

This issue seems to have migrated to node red. (I’m using the addon). Now, using the cast node results in the same issue as above on the home mini, but not the home display. Another weird observation is that it creates a media_player.py error in the home assistant log just like the above. I’m not even using the media_player or home assistant or python to create the tts request! The error in node red is:

14 May 06:14:29 - [error] [cast-to-client:469f1ae.59745e4] Not able to load media:Load failed Not able to load the media.

Now I’m curious if the issue would appear on a node red instance on a machine without HA running. This occurs on standalone instances of node red on the same network.

I’m getting issues with using google cast also .

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:316
Integration: Google Cast (documentation, issues)
First occurred: 09:15:23 (2 occurrences)
Last logged: 09:15:24
Failed to cast media https://r1---sn-5ouxa-h8qe7.googlevideo.com/videoplayback?expire....

using youtube integration - was working up until 2 days ago.
using duckdns and proxymanager.
On my other HA instance I am getting pychromecast issues also.

When tts casts to google assistant it uses internal url, not external url.
It failed for me for tts casting.
But it works if I set my actual external url “https://xxxx.hd.free.fr:8123” in “internal url” field (from home assistant config UI).

Looks like issue for me was that trying to cast with internal url with http ("http://192.168.1.14:8123) does not work because only https is allowed.
https://192.168.1.14:8123/xxxx is reachable (I can play the message from my browser), but then the certificate does not match so google assistant probably rejects it (in my browser I had to explicitly ignore the security error)

Setting my base url to my https duckdns url under tts in the config file did not work. I still get the same error in node red cast node “Not able to load media:Load failed Not able to load the media.”

Google TTS is now working again. I am not sure what changed.

I have the same error:

“Failed to cast media https://myDuckDnsUrl.duckdns.org:8123/media/castle-doorbell-chime.mp3 from internal_url (https://myDuckDnsUrl.duckdns.org:8123) Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address”

I’ve setup duck DNS and can successfully use HomeAssistant with

https://myDuckDnsUrl.duckdns.org:8123/

In my config.yml I have also added

homeassistant:
    allowlist_external_dirs:
        - "/media/"
    allowlist_external_urls:
        - "https://myDuckDnsUrl.duckdns.org:8123"

(btw if I try to add /local/ to dirs I get an error Not a directory @ data['allowlist_external_dirs'][1])

For the Action In my automation file as ContentID I’ve tried both with and without /local/ in
https://myDuckDnsUrl.duckdns.org:8123/local/media/castle-doorbell-chime.mp3

Although I’m not sure if that is the actual ContentID/filelocation, because if I check via my macbook connected via samba it shows as filepaht:
/Volumes/media/castle-doorbell-chime.mp3

If I try to open song directly in my browser using any of the urls below I also get a 404

https://myDuckDnsUrl.duckdns.org:8123/local/media/castle-doorbell-chime.mp3
https://myDuckDnsUrl.duckdns.org:8123/Volumes/media/castle-doorbell-chime.mp3
https://myDuckDnsUrl.duckdns.org:8123//media/castle-doorbell-chime.mp3

But from my dashboard in lovelace I can play the song in my media-browser.
https://myDuckDnsUrl.duckdns.org:8123/media-browser

Also in my https://myDuckDnsUrl.duckdns.org:8123/config/core I have set internal and externaal url to my duckDns url:
https://myDuckDnsUrl.duckdns.org:8123

Any ideas?

I don’t know if it has anything to do with your issue but I notice I have https://homeassistant.local:8123/ as my Internal url on General configuration (duckdns url for External url though)

I’m having the same problem. Am trying media_player.play_media from the Dev console, trying to cast to my Google Home Mini:

Failed to cast media https://myddns.ddns.net:8123/media/countdown.mp3 from tts.base_url (https://myddns.net). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

I have base_url set as follows:

tts:
  - platform: google_translate
    base_url: https://myddns.ddns.net
    service_name: google_say

If I use an http URL on another server it works fine - e.g:

http://mydomain.com/countdown.mp3

I have tried to set my internal url to https and http://homeassistant.local/ and changed also the contentId path in my automation script to
https - and http://homeassistant.local:8123/media/castle-doorbell-chime.mp3

I get the same error:

[homeassistant.components.cast.media_player] Failed to cast media https://homeassistant.local:8123/media/castle-doorbell-chime.mp3 from internal_url (https://homeassistant.local:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address