arnonym / ha-plugins

Home-Assistant SIP Gateway
Apache License 2.0
157 stars 19 forks source link

Error getting tts file 500 b'500: Internal Server Error' #98

Closed pow3r77 closed 4 months ago

pow3r77 commented 4 months ago

Hello, thank you for this great plugin! I'm trying to do some message, but when the call is etablihsed I can ear only one DTMS code:

| 20:28:35.688318 [1] Call is established. | 20:28:35.688425 [ ] Calling webhook sip_call_webhook_id with data {'event': 'call_established', 'caller': 'sip:xxx@sip.xxx.it', 'parsed_caller': 'xxx', 'sip_account': 1} | 20:28:35.709496 [ ] Webhook response 200 b'' | 20:28:35.709767 [1] Playing message: Test Message | 20:28:35.722759 [ ] Error getting tts file 500 b'500: Internal Server Error' 20:28:35.723 pjsua_aud.c Creating file player: /ha-sip/sound/answer.wav.. 20:28:35.723 wav_player.c .File player '/ha-sip/sound/answer.wav' created: samp.rate=44100, ch=1, bufsize=4KB, filesize=176KB 20:28:35.723 pjsua_aud.c .Player created, id=0, slot=2 20:28:35.723 pjsua_aud.c Conf connect: 2 --> 1 20:28:35.723 conference.c .Port 2 (/ha-sip/sound/answer.wav) transmitting to port 1 (sip:xxx@sip.xxx) | 20:28:35.723342 [1] No action supplied

arnonym commented 4 months ago

Looks like your TTS is not configured. Did you configure one of the TTS integrations? https://www.home-assistant.io/integrations/#text-to-speech

pow3r77 commented 4 months ago

Yes, Google service is correctly configured. If I try to invoke the tts say service of HA works perfectly.

arnonym commented 4 months ago

Is there anything in the home assistant logs? The 500 error doesn't sadly tell anything.

pow3r77 commented 4 months ago

Here the error in the log:

Logger: homeassistant.components.http.view Source: components/http/view.py:62 Integration: HTTP (documentation, issues) First occurred: 09:07:58 (3 occurrences) Last logged: 09:18:33

Unable to serialize to JSON. Bad data found at $.error=Provider google_translate not found(<class 'homeassistant.exceptions.HomeAssistantError'>

arnonym commented 4 months ago

At least you're not alone: https://community.home-assistant.io/t/tts-error-with-google-configuration-is-not-valid/589350/11

pow3r77 commented 4 months ago

Great, now it works!! Thank you for the support!

pow3r77 commented 4 months ago

Iis possible ot use the cloud_say service (internal of HA) instead of google_translate ?

arnonym commented 4 months ago

Can you document here what you changed exactly for future reference? And in the home-assistant forum also, if you don't mind.

cloud_say should also work, if you change to that in ha-sip config.

pow3r77 commented 4 months ago

Yes, here my step:

1)

Modiffy in manul the "local network" and set the internal ip of my instance "http://192.168.178.1:8123"

image

then add to the configuration.yaml this code:

`# Text to speech configuration tts:

The restart all HA (not the rapid one)

Then works perfectly

arnonym commented 4 months ago

Thanks!