I was wondering if there is a way of configuring multiple TTS platforms (e.g. one cloud-based and one offline) and fallback to the offline one when the Internet goes down. I mean without writing a custom component or a script.
Configure multiple TTS platforms.
Create an input_select that contains one option for each TTS services, like “tts.google_translate_say”, “tts.mary_tts_say” etc.
Create an automation that changes the input_select to the desired option when internet goes down/comes up again.
Use the value from the input select as your service in all your automations that use TTS.
Thanks for the suggestion, but how about a real fallback? E.g. if Google fails to provide voice data for whatever reason? That is, try Google and if it fails use Mary?
Your idea made me think about something. I can see that using separate scripts (one for each TTS platform) exceptions are thrown separately and the calling sequence would continue. I could use an input_select that would be set to true if the first TTS platform succeeds. An example would be (in pseudo-HA-code):
set input_select to false
call Google TTS
set input_select to true <-- Google worked
if input_select is false, call Mary
If the input_select is false, Mary won’t be called because of the condition I’d put.
I’ll do some tests and post my results. Thank you!
Ah yes, didn’t think about this, probably because I only use Mary
Your approach to overcome this issue sounds good.
And please tag me when you post your full configuration. In case you are interested, you can take a look at mine here, it’s a huge work in progress at the moment, as I’m restructuring the system and some parts are not online yet.
Don’t dive too deep As soon as I finished my restructuring, I will update my repo and also add some detailed instructions and then post it here on the forum.
Should you have any questions about my setup, feel free to send me a PM.