home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.92k stars 30.98k forks source link

Media playback suddenly stopped working #125545

Open oywino opened 2 months ago

oywino commented 2 months ago

The problem

I've had the tts:speak service running for a long time with no issues at all. Then suddenly the other day - out of the blue - it stopped working. That is, I can hear the 'blip' in the speakers (I have several) when the volume is set, but the message is never played. I have several different automations sending messages to various speakers depending on different triggers. All was working well, but now none of them work anymore. Then I noticed that I cannot playback any media files (MP3) anymore, not just messages (which in essence are also mp3 files). I haven't changed any network settings and I've double checked that both external and internal URL is good. I have deleted the TTS integration, rebooted and re-installed it, but to no avail.

What version of Home Assistant Core has the issue?

System Information version | core-2024.9.1 -- | -- installation_type | Home Assistant Container dev | false hassio | false docker | true user | root virtualenv | false python_version | 3.12.4 os_name | Linux os_version | 5.10.60-qnap arch | x86_64 timezone | Europe/Oslo config_dir | /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 5000 Installed Version | 2.0.1 Stage | running Available Repositories | 1471 Downloaded Repositories | 27
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 8 -- | -- resources | 14 views | 17 mode | storage
Recorder oldest_recorder_run | September 4, 2024 at 9:09 AM -- | -- current_recorder_run | September 8, 2024 at 10:38 PM estimated_db_size | 1823.38 MiB database_engine | mysql database_version | 11.4.2
Sonoff version | 3.8.0 (79ecd72) -- | -- cloud_online | 0 / 0 local_online | 1 / 1

What was the last working version of Home Assistant Core?

2024.8.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Google Translate Text-to-speech

Link to integration documentation on our website

https://www.home-assistant.io/integrations/google_translate

Diagnostics information

No response

Example YAML snippet

type: media-control
entity: media_player.living_room_speaker

Then I click on the "Browse Media" which takes me to the Cast overview where I can choose "My media" and "Text-to-speech" 
Both fail with the same error message.

Anything in the logs that might be useful for us?

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:405
integration: Google Cast (documentation, issues)
First occurred: 11:10:32 PM (1 occurrences)
Last logged: 11:10:32 PM

Failed to cast media http://192.168.1.8:8123/api/tts_proxy/11533e3e7509eebb2eb61bde5afed2c021cc01e5_en_-_tts.google_translate_no_no.mp3 from internal_url (http://192.168.1.8:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Additional information

No response

home-assistant[bot] commented 2 months ago

google_translate documentation google_translate source

MatteoBriscini commented 2 months ago

I have the same problem in HA 2024.6.1 using all my Chromecast devices. I tried to configure external and internal URLs in YAML manually (also using the external URL identical to the internal), but I'm still unable to reproduce anything.

It still results in:

Failed to cast media http://[external_URL]/api/tts_proxy/4208b9904e34fd7b38dbc34ca5f7a237c5523aa9_it_-_google_translate.mp3 from internal_url (http://[external_URL]). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

My external URL is accessible internally and externally from my network. going to the URL manually the audio is correctly reproduced.

NineteenSeventySix commented 2 months ago

I have the same problem. It just stopped working. I get the error:

Logger: homeassistant.components.tts
Source: components/tts/__init__.py:1064
integration: Text-to-speech (TTS) (documentation, issues)
First occurred: 10:42:07 (13 occurrences)
Last logged: 10:52:03

Error on load tts: cc154eef94f80543f151ecd6826fb568e8012db1_en-us_6e8b81ac47_cloud not in cache!

Followed by the error:

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:405
integration: Google Cast ([documentation], [issues])
First occurred: 10:42:07 (4 occurrences)
Last logged: 10:52:03

Failed to cast media https://[MY EXTERNAL ADDRESS]:8123/api/tts_proxy/cc154eef94f80543f151ecd6826fb568e8012db1_en-us_6e8b81ac47_cloud.mp3 from external_url (https://[MY EXTERNAL ADDRESS]:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address.

If I try to access the file "https://[MY EXTERNAL ADDRESS]:8123/api/tts_proxy/cc154eef94f80543f151ecd6826fb568e8012db1_en-us_6e8b81ac47_cloud.mp3" i get the browser error "Hmmm… can't reach this page"....

If I try and access an old working cached mp3 on the address "https://[MY EXTERNAL ADDRESS]:8123/api/tts_proxy/4ab57afd210a619093d91f431954f22265502c7eda-_google_translate.mp3" it works fine.

oywino commented 2 months ago

How did you find the name of your "old" mp3 file, and how did you know that it was cached? Could you have sent any mp3 file located somewhere on your HDD?

NineteenSeventySix commented 2 months ago

How did you find the name of your "old" mp3 file, and how did you know that it was cached? Could you have sent any mp3 file located somewhere on your HDD?

When the plugin stopped working I found the url of the cached MP3 in the logs of home assistant. Then when I reinstalled the plugin the name of the mp3 changed to a new name/file. The file I cannot access....

oywino commented 2 months ago

Have you exposed HA directly to the internet using port forward, or are you using a reverse proxy?

bjerem commented 2 months ago

Hello, Same issue on my side when I'm trying to use TTS with Google Home Nest Mini Here is the HA Cast debug logs with the followings error : [pychromecast.controllers] Media:Load failed with code None(unknown code) for queue item id 1 [pychromecast.controllers] Media:Not firing load failed

2024-09-05 21:25:23.370 DEBUG (MainThread) [homeassistant.components.cast.media_player] [media_player.salon Salon] Playing {'media_id': 'http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3', 'media_type': 'audio/mpeg'} with default_media_receiver
2024-09-05 21:25:23.371 INFO (SyncWorker_59) [pychromecast.controllers] Receiver:Launching app CC1AD845
2024-09-05 21:25:23.371 DEBUG (SyncWorker_59) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'LAUNCH', 'appId': 'CC1AD845', 'requestId': 507}
2024-09-05 21:25:23.374 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to sender-0: {'launchRequestId': 507, 'status': 'USER_ALLOWED', 'type': 'LAUNCH_STATUS'}
2024-09-05 21:25:23.374 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Message unhandled: Message urn:x-cast:com.google.cast.receiver from receiver-0 to sender-0: {'launchRequestId': 507, 'status': 'USER_ALLOWED', 'type': 'LAUNCH_STATUS'}
2024-09-05 21:25:23.385 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received unknown namespace: Message urn:x-cast:com.google.cast.multizone from receiver-0 to *: {'requestId': 0, 'status': {'devices': [{'capabilities': 196612, 'deviceId': '5b722a16-35fe-36d1-a8aa-e42ebd83cbf2', 'name': 'Salon', 'volume': {'level': 0.6200000047683716, 'muted': False}}], 'isMultichannel': False, 'playbackSession': {'appAllowsGrouping': True, 'isVideoContent': False, 'streamTransferSupported': True}}, 'type': 'MULTIZONE_STATUS'}
2024-09-05 21:25:24.332 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-243) [pychromecast.discovery] add_service _googlecast._tcp.local., Google-Nest-Mini-5b722a1635fe36d1a8aae42ebd83cbf2._googlecast._tcp.local.
2024-09-05 21:25:24.333 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-243) [homeassistant.components.cast.discovery] Discovered new or updated chromecast ChromecastInfo(cast_info=CastInfo(services={HostServiceInfo(host='192.168.X.Y', port=8009), MDNSServiceInfo(name='Google-Nest-Mini-5b722a1635fe36d1a8aae42ebd83cbf2._googlecast._tcp.local.')}, uuid=UUID('5b722a16-35fe-36d1-a8aa-e42ebd83cbf2'), model_name='Google Nest Mini', friendly_name='Salon', host='192.168.X.Y', port=8009, cast_type='audio', manufacturer='Google Inc.'), is_dynamic_group=None)
2024-09-05 21:25:24.334 DEBUG (MainThread) [homeassistant.components.cast.media_player] _async_create_cast_device: ChromecastInfo(cast_info=CastInfo(services={HostServiceInfo(host='192.168.X.Y', port=8009), MDNSServiceInfo(name='Google-Nest-Mini-5b722a1635fe36d1a8aae42ebd83cbf2._googlecast._tcp.local.')}, uuid=UUID('5b722a16-35fe-36d1-a8aa-e42ebd83cbf2'), model_name='Google Nest Mini', friendly_name='Salon', host='192.168.X.Y', port=8009, cast_type='audio', manufacturer='Google Inc.'), is_dynamic_group=None)
2024-09-05 21:25:24.334 DEBUG (MainThread) [homeassistant.components.cast.media_player] Discovered chromecast with same UUID: ChromecastInfo(cast_info=CastInfo(services={HostServiceInfo(host='192.168.X.Y', port=8009), MDNSServiceInfo(name='Google-Nest-Mini-5b722a1635fe36d1a8aae42ebd83cbf2._googlecast._tcp.local.')}, uuid=UUID('5b722a16-35fe-36d1-a8aa-e42ebd83cbf2'), model_name='Google Nest Mini', friendly_name='Salon', host='192.168.X.Y', port=8009, cast_type='audio', manufacturer='Google Inc.'), is_dynamic_group=None)
2024-09-05 21:25:24.335 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 507, 'status': {'applications': [{'appId': 'CC1AD845', 'appType': 'WEB', 'displayName': 'Default Media Receiver', 'iconUrl': '', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.debugoverlay'}, {'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:com.google.cast.media'}], 'senderConnected': False, 'sessionId': 'bd4d6669-bb05-429a-bba2-fffa99bb821a', 'statusText': 'Default Media Receiver', 'transportId': 'bd4d6669-bb05-429a-bba2-fffa99bb821a', 'universalAppId': 'CC1AD845'}], 'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.6200000047683716, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2024-09-05 21:25:24.335 DEBUG (Thread-7) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.6200000047683716, volume_muted=False, app_id='CC1AD845', display_name='Default Media Receiver', namespaces=['urn:x-cast:com.google.cast.debugoverlay', 'urn:x-cast:com.google.cast.cac', 'urn:x-cast:com.google.cast.media'], session_id='bd4d6669-bb05-429a-bba2-fffa99bb821a', transport_id='bd4d6669-bb05-429a-bba2-fffa99bb821a', status_text='Default Media Receiver', icon_url='', volume_control_type='master')
2024-09-05 21:25:24.335 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Sending: Message urn:x-cast:com.google.cast.tp.connection from sender-0 to bd4d6669-bb05-429a-bba2-fffa99bb821a: {'type': 'CONNECT', 'origin': {}, 'userAgent': 'PyChromecast', 'senderInfo': {'sdkType': 2, 'version': '15.605.1.3', 'browserVersion': '44.0.2403.30', 'platform': 4, 'systemVersion': 'Macintosh; Intel Mac OS X10_10_3', 'connectionType': 1}}
2024-09-05 21:25:24.336 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to bd4d6669-bb05-429a-bba2-fffa99bb821a: {'type': 'GET_STATUS', 'requestId': 508}
2024-09-05 21:25:24.337 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to bd4d6669-bb05-429a-bba2-fffa99bb821a: {'media': {'contentId': 'http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3', 'streamType': 'LIVE', 'contentType': 'audio/mpeg', 'metadata': {}}, 'type': 'LOAD', 'autoplay': True, 'customData': {}, 'requestId': 509, 'sessionId': 'bd4d6669-bb05-429a-bba2-fffa99bb821a'}
2024-09-05 21:25:24.354 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 0, 'status': {'applications': [{'appId': 'CC1AD845', 'appType': 'WEB', 'displayName': 'Default Media Receiver', 'iconUrl': '', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.debugoverlay'}, {'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:com.google.cast.media'}], 'senderConnected': True, 'sessionId': 'bd4d6669-bb05-429a-bba2-fffa99bb821a', 'statusText': 'Default Media Receiver', 'transportId': 'bd4d6669-bb05-429a-bba2-fffa99bb821a', 'universalAppId': 'CC1AD845'}], 'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.6200000047683716, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2024-09-05 21:25:24.354 DEBUG (Thread-7) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.6200000047683716, volume_muted=False, app_id='CC1AD845', display_name='Default Media Receiver', namespaces=['urn:x-cast:com.google.cast.debugoverlay', 'urn:x-cast:com.google.cast.cac', 'urn:x-cast:com.google.cast.media'], session_id='bd4d6669-bb05-429a-bba2-fffa99bb821a', transport_id='bd4d6669-bb05-429a-bba2-fffa99bb821a', status_text='Default Media Receiver', icon_url='', volume_control_type='master')
2024-09-05 21:25:24.397 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to *: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 0}
2024-09-05 21:25:24.397 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Message unhandled: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to *: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 0}
2024-09-05 21:25:24.398 DEBUG (Thread-7) [pychromecast.controllers] Media:Updated status <MediaStatus {'metadata_type': None, 'title': None, 'series_title': None, 'season': None, 'episode': None, 'artist': None, 'album_name': None, 'album_artist': None, 'track': None, 'subtitle_tracks': {}, 'images': [], 'supports_pause': False, 'supports_seek': False, 'supports_stream_volume': False, 'supports_stream_mute': False, 'supports_skip_forward': False, 'supports_skip_backward': False, 'current_time': 0.0, 'content_id': None, 'content_type': None, 'duration': None, 'stream_type': 'UNKNOWN', 'idle_reason': None, 'media_session_id': None, 'playback_rate': 1.0, 'player_state': 'UNKNOWN', 'supported_media_commands': 0, 'volume_level': 1.0, 'volume_muted': False, 'media_custom_data': {}, 'media_metadata': {}, 'current_subtitle_tracks': [], 'last_updated': None}>
2024-09-05 21:25:24.419 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to sender-0: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 508}
2024-09-05 21:25:24.419 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Message unhandled: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to sender-0: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 508}
2024-09-05 21:25:24.419 DEBUG (Thread-7) [pychromecast.controllers] Media:Updated status <MediaStatus {'metadata_type': None, 'title': None, 'series_title': None, 'season': None, 'episode': None, 'artist': None, 'album_name': None, 'album_artist': None, 'track': None, 'subtitle_tracks': {}, 'images': [], 'supports_pause': False, 'supports_seek': False, 'supports_stream_volume': False, 'supports_stream_mute': False, 'supports_skip_forward': False, 'supports_skip_backward': False, 'current_time': 0.0, 'content_id': None, 'content_type': None, 'duration': None, 'stream_type': 'UNKNOWN', 'idle_reason': None, 'media_session_id': None, 'playback_rate': 1.0, 'player_state': 'UNKNOWN', 'supported_media_commands': 0, 'volume_level': 1.0, 'volume_muted': False, 'media_custom_data': {}, 'media_metadata': {}, 'current_subtitle_tracks': [], 'last_updated': None}>
2024-09-05 21:25:24.443 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3', 'streamType': 'LIVE', 'contentType': 'audio/mpeg', 'metadata': {}, 'mediaCategory': 'AUDIO'}, 'currentItemId': 1, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3', 'streamType': 'LIVE', 'contentType': 'audio/mpeg', 'metadata': {}, 'mediaCategory': 'AUDIO'}, 'mediaSessionId': 1}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 509}
2024-09-05 21:25:24.443 DEBUG (Thread-7) [pychromecast.controllers] Media:Updated status <MediaStatus {'metadata_type': None, 'title': None, 'series_title': None, 'season': None, 'episode': None, 'artist': None, 'album_name': None, 'album_artist': None, 'track': None, 'subtitle_tracks': {}, 'images': [], 'supports_pause': True, 'supports_seek': True, 'supports_stream_volume': True, 'supports_stream_mute': True, 'supports_skip_forward': False, 'supports_skip_backward': False, 'current_time': 0, 'content_id': 'http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3', 'content_type': 'audio/mpeg', 'duration': None, 'stream_type': 'LIVE', 'idle_reason': None, 'media_session_id': 1, 'playback_rate': 1, 'player_state': 'IDLE', 'supported_media_commands': 274447, 'volume_level': 1, 'volume_muted': False, 'media_custom_data': {}, 'media_metadata': {}, 'current_subtitle_tracks': [], 'last_updated': datetime.datetime(2024, 9, 5, 19, 25, 24, 443475)}>
2024-09-05 21:25:24.443 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received unknown namespace: Message urn:x-cast:com.google.cast.multizone from receiver-0 to *: {'requestId': 0, 'status': {'devices': [{'capabilities': 196612, 'deviceId': '5b722a16-35fe-36d1-a8aa-e42ebd83cbf2', 'name': 'Salon', 'volume': {'level': 0.6200000047683716, 'muted': False}}], 'isMultichannel': False, 'playbackSession': {'appAllowsGrouping': True, 'isVideoContent': False, 'streamTransferSupported': True}}, 'type': 'MULTIZONE_STATUS'}
2024-09-05 21:25:24.529 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to sender-0: {'type': 'LOAD_FAILED', 'requestId': 509, 'itemId': 1}
2024-09-05 21:25:24.530 DEBUG (Thread-7) [pychromecast.controllers] Media:Load failed with code None(unknown code) for queue item id 1
2024-09-05 21:25:24.530 DEBUG (Thread-7) [pychromecast.controllers] Media:Not firing load failed
2024-09-05 21:25:24.543 DEBUG (Thread-7) [pychromecast.socket_client] [Salon(192.168.X.Y):8009] Received: Message urn:x-cast:com.google.cast.media from bd4d6669-bb05-429a-bba2-fffa99bb821a to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 1, 'idleReason': 'ERROR'}], 'requestId': 0}
2024-09-05 21:25:24.543 DEBUG (Thread-7) [pychromecast.controllers] Media:Updated status <MediaStatus {'metadata_type': None, 'title': None, 'series_title': None, 'season': None, 'episode': None, 'artist': None, 'album_name': None, 'album_artist': None, 'track': None, 'subtitle_tracks': {}, 'images': [], 'supports_pause': True, 'supports_seek': True, 'supports_stream_volume': True, 'supports_stream_mute': True, 'supports_skip_forward': False, 'supports_skip_backward': False, 'current_time': 0, 'content_id': 'http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3', 'content_type': 'audio/mpeg', 'duration': None, 'stream_type': 'LIVE', 'idle_reason': 'ERROR', 'media_session_id': 1, 'playback_rate': 1, 'player_state': 'IDLE', 'supported_media_commands': 274447, 'volume_level': 1, 'volume_muted': False, 'media_custom_data': {}, 'media_metadata': {}, 'current_subtitle_tracks': [], 'last_updated': datetime.datetime(2024, 9, 5, 19, 25, 24, 543734)}>
2024-09-05 21:25:24.544 ERROR (Thread-7) [homeassistant.components.cast.media_player] Failed to cast media http://192.168.X.X:8123/api/tts_proxy/b9f585d4b6c6118bee72e30172f31e5eab01aea1_fr-fr_-_google_translate.mp3 from internal_url (http://192.168.X.X:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Here is a tcpdump just to show you that there is no communication issue :

21:47:00.822352 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [S], seq 4257761461, win 29200, options [mss 1300,sackOK,TS val 2781757587 ecr 0,nop,wscale 6], length 0
21:47:00.822403 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [S.], seq 1696396716, ack 4257761462, win 65160, options [mss 1460,sackOK,TS val 4153937653 ecr 2781757587,nop,wscale 7], length 0
21:47:00.824794 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [P.], seq 1:639, ack 1, win 457, options [nop,nop,TS val 2781757590 ecr 4153937653], length 638
21:47:00.824832 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [.], ack 639, win 505, options [nop,nop,TS val 4153937655 ecr 2781757590], length 0
21:47:00.826156 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 1:208, ack 639, win 505, options [nop,nop,TS val 4153937656 ecr 2781757590], length 207
21:47:00.826198 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 208:6648, ack 639, win 505, options [nop,nop,TS val 4153937656 ecr 2781757590], length 6440
21:47:00.826211 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 6648:11800, ack 639, win 505, options [nop,nop,TS val 4153937656 ecr 2781757590], length 5152
21:47:00.826265 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [.], ack 1, win 457, options [nop,nop,TS val 2781757589 ecr 4153937653], length 0
21:47:00.826287 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [.], ack 639, win 505, options [nop,nop,TS val 4153937656 ecr 2781757590], length 0
21:47:00.830412 IP 192.168.X.X.48080 > 192.168.X.Y.8009: Flags [.], ack 4100, win 887, options [nop,nop,TS val 4153937661 ecr 2781757555], length 0
21:47:00.833054 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [.], ack 11800, win 836, options [nop,nop,TS val 2781757598 ecr 4153937656], length 0
21:47:00.833092 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 11800:24680, ack 639, win 505, options [nop,nop,TS val 4153937663 ecr 2781757598], length 12880
21:47:00.833113 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 24680:25968, ack 639, win 505, options [nop,nop,TS val 4153937663 ecr 2781757598], length 1288
21:47:00.833131 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 25968:37560, ack 639, win 505, options [nop,nop,TS val 4153937663 ecr 2781757598], length 11592
21:47:00.836304 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [.], ack 13088, win 876, options [nop,nop,TS val 2781757601 ecr 4153937663], length 0
21:47:00.836343 IP 192.168.X.X.8123 > 192.168.X.Y.50720: Flags [P.], seq 37560:40136, ack 639, win 505, options [nop,nop,TS val 4153937666 ecr 2781757601], length 2576
21:47:00.840085 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [R.], seq 639, ack 20816, win 1117, options [nop,nop,TS val 2781757605 ecr 4153937663], length 0
21:47:00.840288 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [R], seq 4257762100, win 0, length 0
21:47:00.841824 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [R], seq 4257762100, win 0, length 0
21:47:00.842066 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [R], seq 4257762100, win 0, length 0
21:47:00.843324 IP 192.168.X.Y.50720 > 192.168.X.X.8123: Flags [R], seq 4257762100, win 0, length 0

192.168.X.X is my HA 192.168.X.Y is my Google Home

Everything works before and unfortunately I can't say exactly when it starts to fail. I'm running HA Core 2024.9.1 in a docker container and I'm using GoogleCast native integration. I'm using a reverse proxy for WAN connections but in this example , my computer, the HA container and the Google est are in the same ipv4 network.

Thank you for your help

arnoldpronobis commented 2 months ago

I have the same problem. From my observations, the TTS file is created in the /tts directory and the reading is set to /tts_proxy.

Failed to cast media http://xxx.xxx.xxx.xxx:8123/api/tts_proxy/7110eda4d09e062aa5e4a390b0a572ac0d2c0220_pl_-_tts.google_translate_pl_com.mp3 from internal_url (http://xxx.xxx.xxx.xxx:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

image

parberge commented 2 months ago

I also have this problem. For me it's a specific device that stopped working: My google nest hub.

The error I see is the same as reported:

2024-09-14 15:36:39.913 ERROR (Thread-8) [homeassistant.components.cast.media_player] Failed to cast media http://xxxxx:8123/api/tts_proxy/xxxx-_tts.google_translate_sv_se.mp3 from internal_url (http://xxxx:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Sending the same data to my google nest mini works, and it's connected to the same local network. Not sure if the error we get is correct given my other device works.

Have anybody tried turning on more logging?

oywino commented 2 months ago

I experience something similar. My Google nest mini stopped responding totts.speak but i have the same device also integrated through the Logitech Mediaserver (LMS) integration, and if I use that entity as a target, then it works. So it is the same physical device (Nets mini), but one entity is coming from the media.player integration and the other entity from the LMS integration. The first one fails while the second works. Beats me. This setup has been like this for over three years. Never had any problems with it, until suddenly. All I have done that I'm aware of, is to regularly update HA I therefore suspect that this has something to do with a very resent upgrade, but I'm not sure.

iliessens commented 2 months ago

I have a similar issue as well: playback from audio files within the Home Assistant media browser to my Google Nest Mini stopped working suddenly. I hear the chime of the Nest turning on, but only silence after that. The logs only show the same "Failed to cast media".

I tried restoring a backup of the VM to version 2024.8.2, but the behaviour is the same. And I'm quite sure the issue started later then that upgrade. So maybe something changed on the Nest Mini's side?

parberge commented 2 months ago

I have a similar issue as well: playback from audio files within the Home Assistant media browser to my Google Nest Mini stopped working suddenly. I hear the chime of the Nest turning on, but only silence after that. The logs only show the same "Failed to cast media".

I tried restoring a backup of the VM to version 2024.8.2, but the behaviour is the same. And I'm quite sure the issue started later then that upgrade. So maybe something changed on the Nest Mini's side?

Interesting. Because I have google nest Minis that work, while my google nest hub doesn't 🤔 . Problem on the nest side of things feels likely.

NineteenSeventySix commented 2 months ago

I have done some more testing and it seems to be working fine on my 3x Chromecast with Google TV. But it does not work with my Google Nest Hub or with my Google Home

williamg97 commented 2 months ago

Also echoing @parberge - my Google Nest Mini works fine but my 3 hubs have stopped working with the same error message. It was working on 2024.9.1 but since updating to 2024.9.2 earlier it has stopped.

wsfriday-sfd commented 2 months ago

I'm also having the same issue and it started right after the upgrade to 2024.9.2. I have a Google TV and a Chromecast Ultra, the Google TV still works without any issues, but the Chromecast Ultra is refusing to play local media from HA and also some external media that it had no issues playing before the HA upgrade.

Downgrading HA to 2024.9.1 didn't help, removing the Cast integration and setting things up again didn't help, and factory resetting the Chromecast Ultra didn't help.

Blackreb commented 2 months ago

Same issue, for 10 days, I can't play any media on Chromecast devices. This error happens : Failed to cast media http://xxx ... Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

wasalm commented 2 months ago

Same issue here. I can't play local files from HA to Nest Mini

bkampsnl commented 2 months ago

Same problem over here. Also tried to restore a backup of HA, did a factory reset of the speaker > didn't help..

I have two google nest speakers, now only one works!

LostSoulfly commented 2 months ago

Same issue here. Some work, some don't. If they're part of a group, the TTS just doesn't go through. The speakers wake and the volume changes but it doesn't play at all.

Seems to have started when I upgraded to 2024.9.1, persists on 2024.9.2 as of this evening.

yzjJosh commented 2 months ago

I'm having the same issue starting from this morning. Note that I have 3 Nest Mini and 1 Home Mini. Only one Nest Mini has this issue. I have reset the Nest Mini but am still able to reproduce this issue.

Note that I've tested casting a public url (http://stream.tilos.hu:8000/tilos) to the broken Nest Mini, and this url works. So I suspect the issue is related to Nest Mini unable to access local urls in LAN, though all my other devices can access it.

juanmejiar commented 2 months ago

Im having the same problems, first started happening with a google home mini then with a nest mini, neither local media or tts are working.

ngreis commented 2 months ago

Hello Same here, 2 Home minis stooped working with legacy TTS in configuration file since 9.1 Went to migrate to new TTS, also did not work. The minis chime as usual, but dont say the text. The logs say the same as above, Failed to cast media http://xxx/ ... Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address The external url works, the internal also, i even added a local DNS rewrite with SSL to try to get it to work, this also works, the link the log generates, if i open it in chrome the file plays ok. Any news are welcome.

rishanshah commented 2 months ago

Same issue here. I try using TTS and there is no speech but there is a beep on the google home mini. Funnily enough I have 3 minis and the other two work.

yzjJosh commented 2 months ago

Adding my observations so far:

  1. Even in the same LAN, some Nest devices work, while others don't work.
  2. This issue happens with or without HA upgrade, and previously working device can suddenly stops working.
  3. I've switched the static IP addresses between a working device a non-working device. It doesn't change the behavior.
  4. Factory reset the broken nest device doesn't fix the issue.

These points indicate that the issue is on the broken Nest device itself. It could be due to a server side config roll out that is gradually pushed to devices.

  1. My "broken" device is still able to cast my Android phone's audio in the same LAN, meaning the issue is not very specific to LAN environment.
  2. On my "broken" device, I can use home assistant to cast some public URLs (like http://stream.tilos.hu:8000/tilos), but not other public URLs (e.g. https://samplelib.com/lib/preview/mp3/sample-3s.mp3). So this issue can also happen with some public URLs outside of LAN.
  3. My "broken" device is able to cast normal YouTube Music audios. So non home-assistant initiated cast seems to work.
  4. Someone in this thread mentioned the "broken" device can still cast audio from Logitech Mediaserver (LMS) integration. So this issue is only seen with media_player entities.

These points make me think this issue could be due to some incompatible change in the Nest device that breaks Home Assistant's Google Cast integration. Since the same "broken" device can still cast audio from other sources, a fix can probably be made in the HA's integration.

If this issue is caused by some server config roll out, it may become a more widespread problems later on, and other working Google Cast devices may suddenly stop working.

onchobot commented 2 months ago

I have the same problem. Two identical Google Nest Mini 2nd. Both latest firmware from August. TTS works on one and not on the other. I've tried factory settings, re-adding with no result. From HA I am able to play radio stream from internet, local data not. I fear the problem is more likely to be with Google, the device that stopped working is about 6 months older.

wasalm commented 2 months ago

My Google Nest does not work when I want to play from Home Assistant, but it will play files via Music Assistant. For me this will be a temporary alternative as I am not using TTN

yzjJosh commented 2 months ago

My Google Nest does not work when I want to play from Home Assistant, but it will play files via Music Assistant. For me this will be a temporary alternative as I am not using TTN

How did you link Text-to-speech to music assistant? I would also like to try this workaround until a permanent fix is available.

wasalm commented 2 months ago

My Google Nest does not work when I want to play from Home Assistant, but it will play files via Music Assistant. For me this will be a temporary alternative as I am not using TTN

How did you link Text-to-speech to music assistant? I would also like to try this workaround until a permanent fix is available.

I removed the Nest Mini from Home Assistant and added it to Music Assistant. Using the "Music Assistant Integration" I can play anything on the Nest Mini again

yzjJosh commented 2 months ago

My Google Nest does not work when I want to play from Home Assistant, but it will play files via Music Assistant. For me this will be a temporary alternative as I am not using TTN

How did you link Text-to-speech to music assistant? I would also like to try this workaround until a permanent fix is available.

I removed the Nest Mini from Home Assistant and added it to Music Assistant. Using the "Music Assistant Integration" I can play anything on the Nest Mini again

Thanks for the tip! Does Music Assistant support text-to-speech? I rely on home assistant to announce events using my nest mini so I need text-to-speech support.

wasalm commented 2 months ago

My Google Nest does not work when I want to play from Home Assistant, but it will play files via Music Assistant. For me this will be a temporary alternative as I am not using TTN

How did you link Text-to-speech to music assistant? I would also like to try this workaround until a permanent fix is available.

I removed the Nest Mini from Home Assistant and added it to Music Assistant. Using the "Music Assistant Integration" I can play anything on the Nest Mini again

Thanks for the tip! Does Music Assistant support text-to-speech? I rely on home assistant to announce events using my nest mini so I need text-to-speech support.

I tried and yes it works!

Idea is that TTS is just a program that changes text into an audio file. Home assistant just sends this audio file to a media player. Instead of sending it direct to the Nest Mini, we send it via the Music assistant.

WaeedHussain commented 2 months ago

My Google Nest does not work when I want to play from Home Assistant, but it will play files via Music Assistant. For me this will be a temporary alternative as I am not using TTN

How did you link Text-to-speech to music assistant? I would also like to try this workaround until a permanent fix is available.

I removed the Nest Mini from Home Assistant and added it to Music Assistant. Using the "Music Assistant Integration" I can play anything on the Nest Mini again

Thanks for the tip! Does Music Assistant support text-to-speech? I rely on home assistant to announce events using my nest mini so I need text-to-speech support.

I tried and yes it works!

Idea is that TTS is just a program that changes text into an audio file. Home assistant just sends this audio file to a media player. Instead of sending it direct to the Nest Mini, we send it via the Music assistant.

Just tried it now and it works for casting a media file. Perfect workaround!

yzjJosh commented 2 months ago

My nest mini suddenly starts working after staying broken for 1 day. I didn't do anything other than installing the music assistant to my HA instance and I haven't even started using it. All of sudden, the speaker starts working again. Not sure why, but maybe the nest side bug has been fixed?

LostSoulfly commented 2 months ago

Just got my first notification after a few days randomly.. fingers crossed it was Google that fixed their issue!

parberge commented 2 months ago

Started working for me as well

iliessens commented 2 months ago

Works for me as well this morning. Was troubleshooting a bit yesterday using PyChromecast directly, and while this was communicating correctly, playing any files failed. Strangely enough, I also noticed that HLS streams did work.

I could also see that the Nest was in fact requesting the file from my web server, but then bailed.

So, if it now suddenly works, it must be some change by Google indeed.

bjerem commented 2 months ago

Works for me too. I did not change anything. It's just like magic 🪄

oywino commented 2 months ago

I suspect that everyone of you who now report that thing mysteriously are working again - are from the US, right? Cause here in Europe - at least for me - the problem still exists. What I'm saying (speculating), is that Google has found the culprit, but that they are carefully rolling out the fix. Could that be the case?

ngreis commented 2 months ago

I suspect that everyone of you who now report that thing mysteriously are working again - are from the US, right? Cause here in Europe - at least for me - the problem still exists. What I'm saying (speculating), is that Google has found the culprit, but that they are carefully rolling out the fix. Could that be the case?

I am from Europe, and it also started to work out of thin air, just a couple of minutes ago. Perhaps just wait until tomorrow, if its a rolling a fiz for you maybe. I also did not change nothing from my original reply.

bjerem commented 2 months ago

I'm from France so Europe too. Waiting tomorrow to confirm that the problem not occurs again but it disappears this evening.

NineteenSeventySix commented 2 months ago

Working again after updating to core 2024.9.2

oywino commented 2 months ago

Indeed - suddenly it works here for me too! What a thrill 😄 But I wish someone (Google insiders?) could explain and confirm that something was done, found and fixed. Anyway, again this shows why we shouldn't rely on cloud solutions - unless there is no other choice. I have a local instance of Logitech Media Server (LMS) running on a Linux server, and it never failed to drive any of my media devices, including Google Nest.

NineteenSeventySix commented 2 months ago

Indeed - suddenly it works here for me too! What a thrill 😄 But I wish someone (Google insiders?) could explain and confirm that something was done, found and fixed. Anyway, again this shows why we shouldn't rely on cloud solutions - unless there is no other choice. I have a local instance of Logitech Media Server (LMS) running on a Linux server, and it never failed to drive any of my media devices, including Google Nest.

So my Google TV runs local ? And my Google Nest runs online only ?

oywino commented 2 months ago

So my Google TV runs local ? And my Google Nest runs online only ?

That I know nothing about. I don't have a Google TV

nathan40 commented 1 month ago

I'm in the US and still having this issue. The mini chimes but nothing plays. I was able to get to the file via http://ip:port/api/tts_proxy/filename.mp3 which does have the message that I requested. I checked in the Home app and the Cast Firmware for the mini I have is at 3.73.429109. Could anyone that is working confirm your cast firmware?

I began creating some automations with this and it has never worked, but I started last week. I am hoping this is my only issue.

UPDATE: I figured out my issue. My local environment had a separate DNS system and so my local network setting for Home Assistant was set to http://ha.local:8123. After changing that to the IP address, the Mini has no issue playing back my message!

Comment, would it be possible to have in the Google Translate text-to-speech or Google Cast Integration to specify for it the local IP address? I am not sure I really like that as it splits the location of where that could be set, but it is nice that I could utilize my local DNS naming somehow still for Home Assistant.

rishanshah commented 1 month ago

This is so crazy I upgraded to 2024.9.2 from 9.1 and it started working. Then I upgrated again to 9.3 and its broken again. I just hear a beep on the google home device and nothing is said.