Tts.cloud_say not working since update to HA 2022.5.0 / Error Media Source not loaded

Any script or automation using tts.cloud_say isn’t working anymore since I upgraded to 2022.5.0 and raises an error in home-assistant.log:

2022-05-05 17:31:39 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140402381049040] Media Source not loaded
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 189, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1664, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 217, in async_say_handle
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1664, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/cast/media_player.py", line 608, in async_play_media
    sourced_media = await media_source.async_resolve_media(self.hass, media_id)
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 130, in async_resolve_media
    raise Unresolvable("Media Source not loaded")
homeassistant.components.media_source.error.Unresolvable: Media Source not loaded

Even using the tts test from the Home Assistant Cloud configuration raises the same error:

Anyone having the same problem?

3 Likes

Same issue here.

Fixed it by adding

media_source:

to my configuration.yaml and then restarting Home Assistant.

Ref: Media Source - Home Assistant

17 Likes

Confirm, don’t work.

Thank you very much!!

1 Like

Confrimed: needed to add: “media_source:” to configuration file.

Strange this is not mentioned in the breaking changes…

Thanks for the hint!

1 Like

I think it’s simply a bug. The docs state, that the integration should be configured automatically, if any integration implements a media source:

This integration is configured automatically through default_config or if another integration implements a media source.

This default behavior seems to be broken in 2022.5.

This fix doesn’t work for me.
I already had media_source: included in my configuration before upgrading to core v2022.5.0.

I’ve added media_source: to the config, but it’s changed nothing

Adding media_source: worked for me. Thanks!

Same issue. Removed base_url several updates back and tts has worked fine, until upgrading to 2022.5. Adding media_source: in configuration did not fix tts for me, so I rolled back.

Adding media_source: did not work for me. I’m using homepod mini’s in my setup and this stopped working with 2022.5 update. Could this be because homepod’s are not compatible with the media browser?

I have the same issue with my homepod mini after the 2022.5 core update.
How have you integrated your homepod minis? I have been using the apple_airplayer integration via HACS.

I use the Apple TV Beta integration via HACS.

removing the beta and using the general integration solved my problem.

As the error message states, you need to have media_source integration loaded. This is part of the default_config which is loaded by default. If you remove default_config from your configuration you are responsible yourself to keep up to date with loading the integrations that are loaded by default. You can find those on the default config documentation.

Any player that is able to play TTS is able to play media sources, but it needs to add a few lines of code to support this. All media players in Home Assistant have been upgraded to work with TTS via media sources. 2 missed the 2022.5 release but will be in the next release: vlc and gstreamer.

So if you are experiencing this issue:

  • load media_source if you have removed default_config
  • Remove the base_url from TTS configuration. If you have configured an SSL certificate in Home Assistant, make sure you have configured your internal and external URL correctly. If you don’t use SSL, keep default settings and it should all work fine.
  • if you’re using a custom integration that has an equivalent in core, remove the custom integration. If you continue to experience being unable to play with the core integration, open a new issue for that exact core integration (not the custom one).
  • if it’s a custom integration and there is no core version, make sure you update to the latest version of the custom integration. If problem persists, open an issue with the custom integration.
4 Likes

this also worked for me, thanks!

1 Like

Confirmed also. It worked for me after upgrade HA from a 6 months ago version.

Thank you, this solved the same problem for me.