Hi,
I’m a newbie with HA. I started to work with HA only 3 days ago.
TTS works fine in the default language English but I’d like to use it in my native language: Dutch.
After some research I found I had to add ‘language’ to the configuration.yaml
Default entries:
Text to speech
tts:
platform: google_translate
After change:
Text to speech
tts:
platform: google_translate
language: ‘nl’
I restarted HA, but the TTS langage remains English.
Have I missed something?
Thanks for your help
Using template for all fields here, but you can replace that with fixed values. for the language: any of the google languages is supported… (so you can have a dutch message pronounced with an Italian accent.
btw, for using code in this forum, please show them formatted correctly using 3 backticks before and after the code block, or use the </> in the editor menubar
my original point was, you dont need the language setting in the tts: section of configuration.yaml, since you can specify it in each service call. Or, as you can see in my config with template, vary according to specific needs through some extra inputs (which states are then templated into the tts service…)
to my configuration.yaml. When checking the configuration I got below errors:
Error loading /config/configuration.yaml: while parsing a block collection
in "/config/configuration.yaml", line 21, column 3
expected <block end>, but found '?'
in "/config/configuration.yaml", line 22, column 3
In the Developer Tools -> Services tts.google_say does not exist. I can see tts.google_translate_say.
Without adding any service, I changed the configuration.yaml to:
The chicken and the egg… What was first (read; what should be done first
I changed my configuration.yaml. For some reason this time no error while checking Restarted HA and went to the Develop Tools -> Services
Now indeed tts.google_say was in the list.
Made the entries with my Entity ID media_player.kitchen_display
This ID is a Google Mini. When activating ‘Call Service’ the Mini only gives a beep, no vocal message.
I went back to my Dashboard and tried what worked before by entering some text in ‘text to speech’ but again the speaker only gives a beep, before the changes I could hear my translated words in English…
well, depending on your instance you could need the external_url to be setup. are you by chance using a service like duckdns to reach your instance when away from your local network?
in which case it is useful (needed) to point HA to that resource, and a little trick (search for it on the forum here)
of course, 1234 needs to be substituted with the port you actually use in your config.
btw, using the frontend interface doesnt allow you to set a language, in which case it probably defaults to the default language, and not dutch. if you so desire you either have to use that in the tts: config after all, or, when you use tts only in automated situations, with automations and scripts, use the service block I showed you, which has the language set in the data options
External URL (https) is configured and works fine but about the tts it still doesn’t work.
Into my configuration.yaml I have:
# Text to speech
tts:
- platform: google_translate
service_name: google_say
cache: false
The text-to-speech feature in the mediaplayer default overview, or use of developer tools -> services gives the same result. The mediaplayer gives a beep, that’s all.
If I remove the lines
service_name: google_say
cache: false
to have the initial configuration, it also doesn’t work anymore in English…
yep, base_url can also be set in the tts configuration, though it should still work as I posted above, using the external_url in the homeassistant: hierarchy.
glad you got it working now, but you’ve ‘fixed’ your settings, making it less flexible for the services in automations and scripts to use.
My point in the opening reply was you dont need that in the main config for tts: since you can set it in the service and use it flexibly. If you don’t need that, this would work too.
One point to clarify that may confuse readers of this thread - to the best of my knowledge, the “language” option for say does not actually translate. It just affects the Google voice chosen to speak the message with.
In other words, if you pass a message written in English but invoke say with language set to “nl” it will speak the English message in English but with a Dutch accent. If you want the message spoken in actual Dutch, you need to send in the message in Dutch, not English.