Watson TTS vs 0.100.x release

Hi all,

I’ve been using the Watson TTS service since it became available. I’ve just noticed lately that it is not working anymore. HA is not able to initiate the service correctly at startup anymore. I get the following message:

Error setting up platform: watson_tts

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 131, in async_setup_platform
    provider = await hass.async_add_job(platform.get_engine, hass, p_config)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/watson_tts/tts.py", line 97, in get_engine
    service = TextToSpeechV1(url=config[CONF_URL], iam_apikey=config[CONF_APIKEY])
  File "/usr/local/lib/python3.7/site-packages/ibm_watson/text_to_speech_v1.py", line 102, in __init__
    display_name='Text to Speech')
TypeError: __init__() got an unexpected keyword argument 'vcap_services_name'

My Watson TTS config has not changed within months.

I cannot confirmed that the problem started with the 0.100 release or if it was only a coincidence.

Before Opening an issue, I would like to know if someone else is having the same issue with the Watson TTS integration on HA version 0.100.x?

Hi,
I have the same issu after update to the last version of HA.
watson_tts stop working like before without changes in my config.yaml.

Thank you for the response. Happy to learn that I’m not the only one with this problem. I just Reported the issue. The issue tracking number is 27722.

I also have the same problem after upgrading to version 0.100.x. Any solution?

I’ve not yet seen any activities on this reported issue. For now, I consider this integration to be broken in current HA release (and future releases). With no timeframe on resolution (if any), I’ll have to revert back on using Google TTS.

I will continue to monitor this issue and report update here until it is resolved or it is confirmed that it won’t (can’t) be. In such case, the Watson TTS platform will then need to be remove from HA altogether.

Thanks

Hi,
After waiting some day’s for any fix here or discussions about it, i revert to google_translate.
I hope someone can fix that before 2025.

Thanks

What’s going to happen in 2025?

This has now been fixed and is working again in 0.102.0 release.

If you are using the Watson Text-to-Speech free plan (lite), you will most likely need to update your API key. The Watson free plan deactivate itself after 30 days of inactivity which would apply to everyone since its been more than 30 days since this component stopped working. If you get a “Forbiden” error message, this is mostly your issue.

If the issue persist after updating your API key, check your API URL. It should match the one provided in your Watson API key web page. You might need to specify it manually in tts platform Config using the “watson_url” configuration variable. The default API URL as specified in the doc (https://stream.watsonplatform.net/text-to-speech/api) is not the one that I needed to used. The URL that worked for me was : https://gateway-wdc.watsonplatform.net/text-to-speech/api.

Hi

if I do this command in my Linux and its work great. create an audio file and sound clearly
why in my home assistant its doesn’t work?
this API its work for sure

curl -X POST -u "apikey:O9O7gkOYemJWA*********************" \
--header "Content-Type: application/json" \
--data "{\"text\":\"hello world\"}" \
--output hello_world.ogg \
"https://gateway-lon.watsonplatform.net/text-to-speech/api/v1/synthesize"

the cofiguration.yaml :

tts:
  - platform: watson_tts
    watson_apikey: O9O7gkOYemJWA*****************

the test :
service tts.watson_tts_say

entity_id: media_player.livingroom_speaker
message: 'abc'

the error:

Log Details (ERROR)
Wed Nov 27 2019 16:44:57 GMT
Error: Forbidden, Code: 403
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1236, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 159, in async_say_handle
    p_type, message, cache=cache, language=language, options=options
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 339, in async_get_url
    engine, key, message, use_cache, language, options
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 350, in async_get_tts_audio
    extension, data = await provider.async_get_tts_audio(message, language, options)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/watson_tts/tts.py", line 145, in get_tts_audio
    message, accept=self.output_format, voice=self.default_voice
  File "/usr/local/lib/python3.7/site-packages/ibm_watson/text_to_speech_v1.py", line 265, in synthesize
    response = self.send(request)
  File "/usr/local/lib/python3.7/site-packages/ibm_cloud_sdk_core/base_service.py", line 157, in send
    response.status_code, error_message, http_response=response)
ibm_cloud_sdk_core.api_exception.ApiException: Error: Forbidden, Code: 403

I recently upgraded and it seems like watson tts is broken again.

core-2021.3.2
os: 5.11