Cast local media to Google Nest Mini


I’m using Home Assistant Core for a few days. I tried a lot now getting a doorbell function to work: Zigbee button results in a local mp3 being played on a Google Nest Mini. But I’m stuck at this error:

2022-02-05 22:06:25 ERROR (Thread-13) [homeassistant.components.cast.media_player] Failed to cast media from internal_url ( Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

I can curl this URL, so it is reachable. My YAML for the action is:

service: media_player.play_media
  media_content_id: media-source://media_source/media/Halloween-theme-doorbell-sound.mp3
  media_content_type: audio/mp3
  device_id: df5ce97cb857c836d0774a1f781f47f8

My configuration.yaml contains these:

  name: FG3H Control
  latitude: <redacted>
  longitude: <redacted>
  elevation: 430
  unit_system: metric
  currency: EUR
  time_zone: "Europe/Berlin"
#  internal_url: "https://<redacted>:8123"
  internal_url: ""
    - "/srv/pub"
    - "http://<redacted>/"
    - "https://<redacted>/"
    - ""
    media: "/srv/pub/media"
    recordings: "/srv/pub/recordings"
  legacy_templates: false

  ssl_certificate: /etc/letsencrypt/live/<redacted>/fullchain.pem
  ssl_key: /etc/letsencrypt/live/<redacted>/privkey.pem

I changed the URL from my internal domain to IP address and back but the error stayed the same. FWIW: When activating the media player service my Nest Mini reacts by bleeping to signal a connection. I have to stop streaming for any further attempts.

Any ideas?

Okay, after some hesitation I forwarded a port to my Home Assistant installation (and switched back to domain URLs for internal and external). Now, the integration works but I’m not happy opening a port.