-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tts.google_translate_say no longer works with Google Home #38346
Comments
Please provide your actual configuration. Did you set the |
google_translate documentation |
In my case, (Home Assistant Supervised running in a VirtualBox machine), google TTS works once of every 6 or 7 times i try (I go to media_player and write in the "Text to speak" box and usually doesn't works ( I receive a LOG message: "Error on init TTS: No TTS from google_translate for 'XXXXXXXXX'"... Some times it works (As said once every 6 or 7 times) but delays about 40 to 60 seconds in order to "speak" and then i receive a LOG message: "Timeout for google speech"... and even this isn't o.k. because Google TTS speaks "URL characters" as "hello twenty percent world" instead "hello world". |
for the %20 issue: a fix has been PR'ed by Frenck: #38339 (comment) and #38429 |
It used to work until a few versions ago. I didn't actually pay much attention to it when it stopped working.. so I didn't take note of the exact version number. |
Hi, I just updated to version 0.113.3 and Google Home TTS stoped working. This is the error I'm getting: Could this be related to issue #38429? |
I found the problem. I had installed "spotcast" from HACS to be able to send Spotify content to Google home. Note: By installing the last version of Spotcast, everything is working again. |
@dgomes I am using tts.google_translate_say NOT Spotify! |
This is not the issue ... it doesn't say Anything! |
This is not the issue ... the Google Home Hub Actually shows the cast on screen and makes the noise (so it can contact the server).. |
Ok ... found the issue ... when I inspect my google home after I try to play it the media_content_id specifies the almost correct URL ... the port number is now missing from it! |
So when I suggested to inspect |
@hmmbob |
Because there are changes since "a few versions ago"? It was mentioned in the change logs. |
Ok ... I just double checked... and the base url specifies the correct URL that it would work with ... but it does not seem to be using that at all and just uses the local IP address of the thing without the port |
Sorry just to ask ... it knows it's ip address and port ... so why do I now have to specify it in the base_url? Before it worked and knew that it was hosted on :8123 (or assumed it) ... but now it assumes it is hosted on port 80 for this without specifying it in the base_url? This doesn't make sense to me ... if it assumes it (rather than detects), unless you specify the base_url, shouldn't it assume that is on port 8123 since this is HA's default? |
I believe I'm having the same problem as the OP. Casting a message results in: |
Cast requires a valid SSL certificate, if using SSL. Try skipping SSL by using http://192.168.0.202:8123 |
I have a valid ssl certificate from Let's Encrypt and it appears to be properly installed against my HA FQDN. I've triple checked that via a web sslchecker. I don't think it a question of google accessing my site. If it helps (I'm not sure what methods google uses to do this), I have a usable mp3 file that came from google's TTS within my HA instance (i.e., tts/1519ae4eedc50d1cda10b6cd0e79433870382cbe_en_-_google_translate.mp3) that may further confirm. Looking at the other part of the error message (reachable from the cast device), as mentioned the cast device responds correctly to media_player.volume_set from HA, so I believe it is reachable. Still looking for ideas on next steps... |
Yeah, that's what I was trying to say: did you try what I suggested? Your certificate is valid for your FQDN, not for your IP. Just try removing the s fron https in you internal url, or don't use an internal url and send everything through your external url. That'll only work if "NAT hairpin" is we6t up correctly though. And it is not about google accessing anything, it is about your cast device trying to reach the audio file on your HA instance which fails because your ssl certificate gets rejected because it is set-up for a FQDN and not an IP address. Just try my suggestion, please. Remove the s out of https and see if that helps. |
@hmmbob - thanks for your help. OK. Here' what I tried in the last couple hours:
Any ideas on next steps? |
I managed to get it working by using my duckdns domain, I simply put the domain in the configuration.yaml file under the base_url, but I have not managed to get it working via a local IP address. |
@mghinch Fair comment about the https server - I was assuming something else was handling https and certificates for you (such as Traefik or HAProxy or something); my bad. You are right that you can't talk http to a https port. I know that I've worked around this myself by using https://FQDN:port for both internal_url, external_url and tts base_url (combined with having the correct NAT rules in place on my router). I did not set any additional DNS or something: I just route everything to my external IP/FQDN. That is by the way the same as what @MyNameIzApple suggests - worth a try, but YMMV (it'll depend on the capability of your router to handle "hairpin" situations). Core of your issue is that your Home speaker cannot get the audio file provided by HA. It is connected (hence the "starting beeps" you can hear), but because of routing or certificate issues it cannot load the audio file. |
@hmmbob - Thanks - the explanation and helping to narrow it down to routing or certificates helps quite a bit. And @MyNameIzApple, it's good to hear a success case. Two follow-on questions. The routing that has to happen is just to get packets from an internal device (Google Mini) directed to FQDN:8123 to resolve that address to the external IP address, and then successfully get those packets to that address:port, right? No port translation, etc... Second, just for the record, a Google Mini accepts Let's Encrypt certs and cert authority (DST Root), right? It's this latter point that seems like the highest probability of problem, since everything else on my network is happy with the routing and certs. |
Yes, I am using Letsencrypt too. If the certificate is valid, it should be fine. And as for routing: yes, that is the case. It is the same if you (instead your Google Mini) go to https://FQDN:8123/api/tts_proxy/ecb9c151c312ede762490397b67cf5c4ffc76a9e_en_-_google_translate.mp3 - this should work without accepting any certificate warnings (try with your non standard browser, to prevent caching) and without manually setting a DNS record or so for FQDN on your router or PC. |
OK. Got it, with thanks to @hmmbob. Turns out your original comments about "NAT Hairpin" applied to my recent DNS change that forced all traffic (internal and external) to the external IP address. Once I changed to forcing internal and external http requests to be directed to the external interface additional routing was needed to allow port 8123 from internal sources to be routed. The external ones were already being forwarded through my firewall, but the case of something arriving at the firewall from an internal source that then wanted to get back to an internal destination was not covered at my (externally focused) firewall. Fixed that and everything popped up right away. THANKS ALL. |
So no answer on this:
|
That's just how the web protocols work: if you don't specify a port, the stack will connect to the default port for that protocol (80 for http, 443 for https). And because it is the default port, it won't be shown/specified in an URL. Example: https://google.com actually means https://google.com:443 |
Even stranger behaviour on my side... I have ~6 scripts using Home Assistant and Google_Translate_Say. |
That makes sense, as TTS is cached locally (have a look in the TTS folder in your config directory). So, when you had a working message downloaded earlier, it will still play. |
Thanks so much hmmbob
|
You can't fix this yourself: the Google site changed and that is why it isn't working. |
Thanks. I've checked your other comments on #43801... What a team ! On synology, I don't see the config/component folder ( maybe should I use CLI ?), so not sure how to test. Should I wait for a stable fix to be published ? Will it be on the synology packet store or do I need to make a custome upgrade ? If you have 1 minute to spare, any hint on the syntax to 'hand over' the message from HTTP to TTS script ? Thx so much ! |
Don't know. @i00 If your issue is solved, would you mind closing this issue? |
I know how they work ... But surely this should look it up from the HA config to determine what port it is running on rather than just assume the port is 80! ... It used to work; and this over site makes it appear like a bug. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
The problem
When I call the service "tts.google_translate_say" GH acknowledges it (makes sound) but no message is played.
Environment
Problem-relevant
configuration.yaml
Select "Developer Tools" > "Services"
tts.google_translate_say
Traceback/Error logs
Additional information
The text was updated successfully, but these errors were encountered: