core: Unable to cast TTS to Google Cast despite proper `external_url` set

The problem

I have following configuration:

  • https://ha.domain.example is publicly reachable and set as HA external_url
  • https://ha.internal.domain.example is provided through PiHole in local network and set as internal_url.
  • *.internal.domain.example resolves to generic “not found” error over internet.

My Nest device is unable to play TTS messages (see log section).

It would be useful to force use of external URL in such case, or at least fallback to it.

What version of Home Assistant Core has the issue?

2023.2.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Google Cast

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Failed to cast media https://ha.internal.domain.example/api/tts_proxy/640ab2bae07bedc4c163f679a746f7ab7fb5d1fa_en_-_google_translate.mp3 from internal_url (https://ha.internal.domain.example).

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

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

I’m facing the same issue. Setting the internal URL in HA network settings to be the same as the external URL fixed the problem.

I believe this is caused by the TTS integration trying the internal URL when the media player is on a local network.

In my case the Google device is not allowed to access the HA VLAN. Is there any other way to force the usage of the external URL for TTS?

I’m struggling with the same issue. I previously used this in the yaml configuration which was working fine:

# Text to Speech
tts:
  - platform: google_translate
    base_url: http://<ha-vm-ip-address>:8123
    service_name: google_translate_say
    cache: true
    cache_dir: /tmp/tts
    time_memory: 300

But now that this has been deprecated I am unable to get the TTS casting to my Google speakers to work.

I have tried installing the new Google Text to Speech integrationand and removed the old lines related to TTS services in the yaml configuration. Using the developer tools/services I have attempted to test the Speak service like this:

service: tts.speak
data:
  message: Testing Testing
  media_player_entity_id: media_player.living_room
  language: en-us
target:
  entity_id: tts.google_en_com

However, I only get a “ding” from the speaker and nothing else.

I read a mention somewhere of the new TTS service requiring a HTTPS URL, but I already have both my internal address and my external address set up with HTTPS.

image

Has anyone been able to find a solution / workaround for this?

@ChrisCarini , I think you have your answer by now:

Configuration invalid! Invalid config for [tts.google_translate]: [base_url] is an invalid option for [tts.google_translate]. Check: tts.google_translate->base_url. (See ?, line ?).

@dshokouhi

what happens if you configure external_url under tts like the docs mention?

System fails with:

Invalid config for [tts.google_translate]: [external_url] is an invalid option for [tts.google_translate]. Check: tts.google_translate->external_url. (See ?, line ?). 

I also found undocumented and deprecated base_url under TTS config. Providing it fixes a problem, but I’m not sure when it will be removed.

Root issue is that Google devices seems to ignore local DNS server sometimes.

@mcarter14777

Do you use Nabu Casa?

No, I setup my own reverse proxy.