arnonym / ha-plugins

Home-Assistant SIP Gateway
Apache License 2.0
171 stars 22 forks source link

Tts platform different from good translate #65

Closed Extreme79 closed 1 year ago

Extreme79 commented 1 year ago

I'm trying to use different platform instead of google_translate. google_cloud is impossible to use due to the language: setting it, error is raised during usage as not supported (language is defined through voice used and defined in configuration), avoiding set it cause an error saving the ha-sip config. The same with tts pkatform watson_tts. Any way to change the platform?

arnonym commented 1 year ago

ha-sip can only use TTS platforms supported by home-assistant. So I guess all of these should work: https://www.home-assistant.io/integrations/#text-to-speech

If you configure one of those you must also configure ha-sip to use this one

Extreme79 commented 1 year ago

Sure, obviously. Google cloud tts or Watson tts (IBM) are supported by home assistant, and I normally use these. But trying to configure different service in ha-sip, there's the language problem. Without "language" option in configuration, a error is raised on config save:

Impossibile salvare la configurazione del componente aggiuntivo, Missing option 'language' in tts in ha-sip (c7744bff_ha-sip). Got {'sip_global': {'port': 5060, 'log_level': 5, 'name_server': ''}, 'sip': {'enabled': True, 'registrar_uri': 'sip:fritz.box', 'id_uri': 'sip:homeassistant@fritz.box', 'realm': '*', 'user_name': 'homeassistant', 'password': 'secret', 'answer_mode': 'listen', 'settle_time': 1, 'incoming_call_file': ''}, 'sip_2': {'enabled': False, 'registrar_uri': 'sip:fritz.box', 'id_uri': 'sip:anotheruser@fritz.box', 'realm': '*', 'user_name': 'anotheruser', 'password': 'secret', 'answer_mode':..

So language is required on ha-sip side. If I place the language option (not required in google_cloud, because the language is defined through the voice configured in the tts service), I can save the ha-sip configuration BUT something go wrong next: Placing a call I get only a long beep instead of the expected phrase and then silence; checking the ha log, I see these errors:

2023-08-21 08:44:09.526 ERROR (MainThread) [homeassistant.components.tts] Error on init tts: Language 'it' not supported

2023-08-21 08:44:09.572 ERROR (MainThread) [homeassistant.components.http.view] Unable to serialize to JSON. Bad data found at $.error=Language 'it' not supported(<class 'homeassistant.exceptions.HomeAssistantError'>

So I got beep&silence due to the language option.

Seems that language is required in the ha-sip configuration, but not in the tts service (language defined by the voice).. But errors are thrown if language is placed in tts config but not required.

arnonym commented 1 year ago

Can you please try with it-IT as the language in ha-sip?

Extreme79 commented 1 year ago

Done. Got it working. 👍

I'm feeling little bit dumb 😅

arnonym commented 1 year ago

I added a hint to the readme :-)