Chime TTS - Play audio before/after TTS audio lag free

I’m getting an ‘unknown error’ when trying to call this service. There is nothing being logged, however, at least as far as I can find.

What other troubleshooting steps should I take to try to get this working for me?

EDIT: I do find that there is nothing being logged when trying to play to one of the Sonos players, but if I try to play to something Echo-based ( a Show, Dot, etc.), there is an error logged like the following:

[custom_components.chime_tts] Unable to get current volume for media player 'media_player.allie_s_office_show'

In the system’s log page, can you please press: LOAD FULL LOGS and see if there’s anything else that could be helpful to understand what might be causing the “unknown error”?

Regarding the current volume error message: it indicates that Chime TTS cannot access that particular media_player’s volume_level attribute - but that just means it won’t adjust the volume before playing the notification. Do you end up hearing the notification on the speaker?

Using this action:

I get four separate errors in the log:
1:
This error originated from a custom integration.

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/init.py:92
Integration: Chime TTS (documentation, issues)
First occurred: 11:27:04 AM (6 occurrences)
Last logged: 11:39:25 AM

No filepath provided

2
Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 11:13:48 AM (12 occurrences)
Last logged: 11:39:25 AM

Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py”, line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “aiohttp/_http_parser.pyx”, line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message=“Bad status line ‘Invalid method encountered’”

3
This error originated from a custom integration.

Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/chime_tts/init.py:198
Integration: Chime TTS (documentation, issues)
First occurred: 11:24:16 AM (11 occurrences)
Last logged: 11:39:25 AM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: HTTPSConnectionPool(host=‘192.168.50.12’, port=8123): Max retries exceeded with url: /api/tts_get_url (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)’)))
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 714, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 403, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 1053, in validate_conn
conn.connect()
File “/usr/local/lib/python3.11/site-packages/urllib3/connection.py”, line 419, in connect
self.sock = ssl_wrap_socket(
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl
.py", line 453, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl
.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/ssl.py”, line 517, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/ssl.py”, line 1075, in _create
self.do_handshake()
File “/usr/local/lib/python3.11/ssl.py”, line 1346, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/requests/adapters.py”, line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 798, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py”, line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘192.168.50.12’, port=8123): Max retries exceeded with url: /api/tts_get_url (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)’)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 452, in _async_step
await getattr(self, handler)()
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 685, in _async_call_service_step
await service_task
File “/usr/src/homeassistant/homeassistant/core.py”, line 1910, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1950, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File “/config/custom_components/chime_tts/init.py”, line 92, in async_say
audio_path = await async_get_playback_audio_path(params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/chime_tts/init.py”, line 231, in async_get_playback_audio_path
tts_audio_path = await async_request_tts_audio_filepath(hass, tts_platform, message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/chime_tts/init.py”, line 178, in async_request_tts_audio_filepath
response = await hass.async_add_executor_job(post_request, url, headers, data, TIMEOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/chime_tts/init.py”, line 198, in post_request
return post(url, headers=headers, data=data, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/api.py”, line 115, in post
return request(“post”, url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/adapters.py”, line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘192.168.50.12’, port=8123): Max retries exceeded with url: /api/tts_get_url (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)’)))

4
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/chime_tts/init.py:198
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:24:16 AM (11 occurrences)
Last logged: 11:39:25 AM

[281472621075408] Error handling message: Unknown error (unknown_error) Jay from 192.168.50.9 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36)
[281471943784336] Error handling message: Unknown error (unknown_error) Jay from 192.168.50.9 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36)
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 714, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 403, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 1053, in validate_conn
conn.connect()
File “/usr/local/lib/python3.11/site-packages/urllib3/connection.py”, line 419, in connect
self.sock = ssl_wrap_socket(
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl
.py", line 453, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl
.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/ssl.py”, line 517, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/ssl.py”, line 1075, in _create
self.do_handshake()
File “/usr/local/lib/python3.11/ssl.py”, line 1346, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/requests/adapters.py”, line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py”, line 798, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py”, line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘192.168.50.12’, port=8123): Max retries exceeded with url: /api/tts_get_url (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)’)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py”, line 26, in _handle_async_response
await func(hass, connection, msg)
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 678, in handle_execute_script
await script_obj.async_run(msg.get(“variables”), context=context)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1533, in async_run
await asyncio.shield(run.async_run())
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 410, in async_run
await self._async_step(log_exceptions=False)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 454, in _async_step
self._handle_exception(
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 477, in _handle_exception
raise exception
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 452, in _async_step
await getattr(self, handler)()
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 685, in _async_call_service_step
await service_task
File “/usr/src/homeassistant/homeassistant/core.py”, line 1910, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1950, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File “/config/custom_components/chime_tts/init.py”, line 92, in async_say
audio_path = await async_get_playback_audio_path(params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/chime_tts/init.py”, line 231, in async_get_playback_audio_path
tts_audio_path = await async_request_tts_audio_filepath(hass, tts_platform, message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/chime_tts/init.py”, line 178, in async_request_tts_audio_filepath
response = await hass.async_add_executor_job(post_request, url, headers, data, TIMEOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/chime_tts/init.py”, line 198, in post_request
return post(url, headers=headers, data=data, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/api.py”, line 115, in post
return request(“post”, url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/requests/adapters.py”, line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘192.168.50.12’, port=8123): Max retries exceeded with url: /api/tts_get_url (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1002)’)))

Thank you for providing the log messages. I found the problem and released a new version (v0.3.1) which should fix your issue. Please update to the new version and let me know if you’re still having issues or if it’s now fixed.

2 Likes

After updating 0.3.1, its says “action run successfully” but no sound output. one error message

This error originated from a custom integration.

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/init.py:92
Integration: Chime TTS (documentation, issues)
First occurred: 1:18:22 PM (12 occurrences)
Last logged: 1:25:04 PM

No filepath provided

Can you please enable debug logging for the integration, call the service again, and send the log messages?

service: logger.set_level
data:
  custom_components.chime_tts: debug

enabled debug logging per your directions. same error message

This error originated from a custom integration.

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/init.py:92
Integration: Chime TTS (documentation, issues)
First occurred: 1:58:48 PM (6 occurrences)
Last logged: 2:03:16 PM

No filepath provided

Please note that upon executing the action, HA takes 5 full seconds to actually execute the command. my google translate actions are immediate for comparison

Can you please press the LOAD FULL LOGS button in the system’s log page and filter for ‘chime_tts’?

sorry about that!

2023-06-19 13:39:08.221 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration chime_tts which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2023-06-19 13:58:48.724 WARNING (MainThread) [custom_components.chime_tts] No filepath provided

2023-06-19 13:58:49.160 WARNING (MainThread) [custom_components.chime_tts] No filepath provided

2023-06-19 14:00:13.589 DEBUG (MainThread) [custom_components.chime_tts] async_say(service)

2023-06-19 14:00:13.590 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path(params={‘hass’: <homeassistant.core.HomeAssistant object at 0xffff7d419ad0>, ‘chime_path’: ‘’, ‘end_chime_path’: ‘’, ‘delay’: 450.0, ‘tts_platform’: ‘google_translate’, ‘message’: ‘A door is open’})

2023-06-19 14:00:13.590 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 0, audio)

2023-06-19 14:00:13.590 WARNING (MainThread) [custom_components.chime_tts] No filepath provided

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] async_get_tts_cache_path(‘Z29vZ2xlX3RyYW5zbGF0ZS1BIGRvb3IgaXMgb3Blbg==’)

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] Retrieving key/value from chime_tts storage:

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] key: Z29vZ2xlX3RyYW5zbGF0ZS1BIGRvb3IgaXMgb3Blbg==

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] value: /config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] - async_get_tts_cache_path(‘Z29vZ2xlX3RyYW5zbGF0ZS1BIGRvb3IgaXMgb3Blbg==’) returned value: ‘/config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3’

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] - Using cached TTS mp3 filepath

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("/config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3", 450.0, audio)

2023-06-19 14:00:13.592 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: “/config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3”…

2023-06-19 14:00:13.912 DEBUG (MainThread) [custom_components.chime_tts] - …audio retrieved successfully

2023-06-19 14:00:13.913 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 450.0, audio)

2023-06-19 14:00:13.913 WARNING (MainThread) [custom_components.chime_tts] No filepath provided

2023-06-19 14:00:13.915 DEBUG (MainThread) [custom_components.chime_tts] - Final audio created with duration = 1.416s

2023-06-19 14:00:14.085 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.garage_fire_tablet”, -1.0)

2023-06-19 14:00:14.085 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: slipped

2023-06-19 14:00:14.085 DEBUG (MainThread) [custom_components.chime_tts] Playing media…

2023-06-19 14:00:14.085 DEBUG (MainThread) [custom_components.chime_tts] - audio_path = “/tmp/tmpg7n2idyg.mp3”

2023-06-19 14:00:14.085 DEBUG (MainThread) [custom_components.chime_tts] - entity_id = “media_player.garage_fire_tablet”

2023-06-19 14:00:14.192 DEBUG (MainThread) [custom_components.chime_tts] …media finished playback:

2023-06-19 14:00:15.610 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.garage_fire_tablet”, 0.75)

2023-06-19 14:00:15.610 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player “media_player.garage_fire_tablet” to: 0.75

2023-06-19 14:00:17.457 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: completed

2023-06-19 14:01:56.495 DEBUG (MainThread) [custom_components.chime_tts] async_say(service)

2023-06-19 14:01:56.495 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path(params={‘hass’: <homeassistant.core.HomeAssistant object at 0xffff7d419ad0>, ‘chime_path’: ‘custom_components/chime_tts/mp3s/bells.mp3’, ‘end_chime_path’: ‘’, ‘delay’: 450.0, ‘tts_platform’: ‘google_translate’, ‘message’: ‘A door is open’})

2023-06-19 14:01:56.495 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path(“custom_components/chime_tts/mp3s/bells.mp3”, 0, audio)

2023-06-19 14:01:56.495 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: “custom_components/chime_tts/mp3s/bells.mp3”…

2023-06-19 14:01:56.735 DEBUG (MainThread) [custom_components.chime_tts] - …audio retrieved successfully

2023-06-19 14:01:56.736 DEBUG (MainThread) [custom_components.chime_tts] async_get_tts_cache_path(‘Z29vZ2xlX3RyYW5zbGF0ZS1BIGRvb3IgaXMgb3Blbg==’)

2023-06-19 14:01:56.736 DEBUG (MainThread) [custom_components.chime_tts] Retrieving key/value from chime_tts storage:

2023-06-19 14:01:56.736 DEBUG (MainThread) [custom_components.chime_tts] key: Z29vZ2xlX3RyYW5zbGF0ZS1BIGRvb3IgaXMgb3Blbg==

2023-06-19 14:01:56.736 DEBUG (MainThread) [custom_components.chime_tts] value: /config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3

2023-06-19 14:01:56.736 DEBUG (MainThread) [custom_components.chime_tts] - async_get_tts_cache_path(‘Z29vZ2xlX3RyYW5zbGF0ZS1BIGRvb3IgaXMgb3Blbg==’) returned value: ‘/config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3’

2023-06-19 14:01:56.737 DEBUG (MainThread) [custom_components.chime_tts] - Using cached TTS mp3 filepath

2023-06-19 14:01:56.737 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("/config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3", 450.0, audio)

2023-06-19 14:01:56.738 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: “/config/tts/38a3d9352dd22a2bf54d93e8175b78024dec3ecf_en_-_google_translate.mp3”…

2023-06-19 14:01:57.015 DEBUG (MainThread) [custom_components.chime_tts] - …audio retrieved successfully

2023-06-19 14:01:57.017 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 450.0, audio)

2023-06-19 14:01:57.017 WARNING (MainThread) [custom_components.chime_tts] No filepath provided

2023-06-19 14:01:57.022 DEBUG (MainThread) [custom_components.chime_tts] - Final audio created with duration = 2.81s

2023-06-19 14:01:57.206 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.garage_fire_tablet”, -1.0)

2023-06-19 14:01:57.206 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: slipped

2023-06-19 14:01:57.207 DEBUG (MainThread) [custom_components.chime_tts] Playing media…

2023-06-19 14:01:57.207 DEBUG (MainThread) [custom_components.chime_tts] - audio_path = “/tmp/tmpzodnae9w.mp3”

2023-06-19 14:01:57.207 DEBUG (MainThread) [custom_components.chime_tts] - entity_id = “media_player.garage_fire_tablet”

2023-06-19 14:01:58.115 DEBUG (MainThread) [custom_components.chime_tts] …media finished playback:

2023-06-19 14:02:00.927 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.garage_fire_tablet”, 0.75)

2023-06-19 14:02:00.927 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player “media_player.garage_fire_tablet” to: 0.75

2023-06-19 14:02:02.221 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: completed

2023-06-19 14:03:16.436 DEBUG (MainThread) [custom_components.chime_tts] async_say(service)

2023-06-19 14:03:16.436 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path(params={‘hass’: <homeassistant.core.HomeAssistant object at 0xffff7d419ad0>, ‘chime_path’: ‘custom_components/chime_tts/mp3s/bells.mp3’, ‘end_chime_path’: ‘’, ‘delay’: 450.0, ‘tts_platform’: ‘google_translate’, ‘message’: ‘testing’})

2023-06-19 14:03:16.436 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path(“custom_components/chime_tts/mp3s/bells.mp3”, 0, audio)

2023-06-19 14:03:16.438 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: “custom_components/chime_tts/mp3s/bells.mp3”…

2023-06-19 14:03:16.676 DEBUG (MainThread) [custom_components.chime_tts] - …audio retrieved successfully

2023-06-19 14:03:16.676 DEBUG (MainThread) [custom_components.chime_tts] async_get_tts_cache_path(‘Z29vZ2xlX3RyYW5zbGF0ZS10ZXN0aW5n’)

2023-06-19 14:03:16.676 DEBUG (MainThread) [custom_components.chime_tts] Retrieving key/value from chime_tts storage:

2023-06-19 14:03:16.677 DEBUG (MainThread) [custom_components.chime_tts] key: Z29vZ2xlX3RyYW5zbGF0ZS10ZXN0aW5n

2023-06-19 14:03:16.677 DEBUG (MainThread) [custom_components.chime_tts] value: /config/tts/dc724af18fbdd4e59189f5fe768a5f8311527050_en_-_google_translate.mp3

2023-06-19 14:03:16.677 DEBUG (MainThread) [custom_components.chime_tts] - async_get_tts_cache_path(‘Z29vZ2xlX3RyYW5zbGF0ZS10ZXN0aW5n’) returned value: ‘/config/tts/dc724af18fbdd4e59189f5fe768a5f8311527050_en_-_google_translate.mp3’

2023-06-19 14:03:16.677 DEBUG (MainThread) [custom_components.chime_tts] - Using cached TTS mp3 filepath

2023-06-19 14:03:16.677 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("/config/tts/dc724af18fbdd4e59189f5fe768a5f8311527050_en_-_google_translate.mp3", 450.0, audio)

2023-06-19 14:03:16.678 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: “/config/tts/dc724af18fbdd4e59189f5fe768a5f8311527050_en_-_google_translate.mp3”…

2023-06-19 14:03:16.914 DEBUG (MainThread) [custom_components.chime_tts] - …audio retrieved successfully

2023-06-19 14:03:16.919 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 450.0, audio)

2023-06-19 14:03:16.920 WARNING (MainThread) [custom_components.chime_tts] No filepath provided

2023-06-19 14:03:16.921 DEBUG (MainThread) [custom_components.chime_tts] - Final audio created with duration = 2.33s

2023-06-19 14:03:17.115 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.garage_fire_tablet”, -1.0)

2023-06-19 14:03:17.116 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: slipped

2023-06-19 14:03:17.116 DEBUG (MainThread) [custom_components.chime_tts] Playing media…

2023-06-19 14:03:17.116 DEBUG (MainThread) [custom_components.chime_tts] - audio_path = “/tmp/tmprrtgj3p0.mp3”

2023-06-19 14:03:17.116 DEBUG (MainThread) [custom_components.chime_tts] - entity_id = “media_player.garage_fire_tablet”

2023-06-19 14:03:17.888 DEBUG (MainThread) [custom_components.chime_tts] …media finished playback:

2023-06-19 14:03:20.220 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.garage_fire_tablet”, 0.75)

2023-06-19 14:03:20.220 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player “media_player.garage_fire_tablet” to: 0.75

2023-06-19 14:03:20.652 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: completed

Unfortunately nothing looks wrong in the log messages. I don’t have a fire tablet so I can’t test the issue but behind the scenes the integration calls the native media player’s play media service. Are you able to play TTS messages (or plain media files) normally on the tablet?
As for the delay, it’s an open issue but unrelated to your issue of no audio playing.

I recently removed it because NabuCasa tts was not working.
Haven’t gotten around to it yet but will install and test tomorrow.
I will let you know how it works, or if there are any errors.

Just downloaded, installed and rebooted. I am seeing the exact same thing, audio file is created, the filename and path are correct, but sound output is not heard. Here is the log dump from just a few minutes ago.

2023-06-20 20:19:32.197 DEBUG (MainThread) [custom_components.chime_tts] async_say(service)
2023-06-20 20:19:32.197 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path(params={'hass': <homeassistant.core.HomeAssistant object at 0x7f8704b610>, 'chime_path': 'custom_components/chime_tts/mp3s/ding_dong.mp3', 'end_chime_path': '', 'delay': 450.0, 'tts_platform': 'google_cloud', 'message': 'Hello Art. How are you doing?'})
2023-06-20 20:19:32.197 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("custom_components/chime_tts/mp3s/ding_dong.mp3", 0, audio)
2023-06-20 20:19:32.198 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: "custom_components/chime_tts/mp3s/ding_dong.mp3"...
2023-06-20 20:19:32.566 DEBUG (MainThread) [custom_components.chime_tts] - ...audio retrieved successfully
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] async_get_tts_cache_path('Z29vZ2xlX2Nsb3VkLUhlbGxvIEFydC4gSG93IGFyZSB5b3UgZG9pbmc/')
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] Retrieving key/value from chime_tts storage:
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] key: Z29vZ2xlX2Nsb3VkLUhlbGxvIEFydC4gSG93IGFyZSB5b3UgZG9pbmc/
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] value: /config/tts/701649d11d32e06ba0a1bdbea89a09cb209f67d3_en-us_bcdbf0dd85_google_cloud.mp3
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] - async_get_tts_cache_path('Z29vZ2xlX2Nsb3VkLUhlbGxvIEFydC4gSG93IGFyZSB5b3UgZG9pbmc/') returned value: '/config/tts/701649d11d32e06ba0a1bdbea89a09cb209f67d3_en-us_bcdbf0dd85_google_cloud.mp3'
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] - Using cached TTS mp3 filepath
2023-06-20 20:19:32.567 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("/config/tts/701649d11d32e06ba0a1bdbea89a09cb209f67d3_en-us_bcdbf0dd85_google_cloud.mp3", 450.0, audio)
2023-06-20 20:19:32.568 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: "/config/tts/701649d11d32e06ba0a1bdbea89a09cb209f67d3_en-us_bcdbf0dd85_google_cloud.mp3"...
2023-06-20 20:19:32.908 DEBUG (MainThread) [custom_components.chime_tts] - ...audio retrieved successfully
2023-06-20 20:19:32.925 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 450.0, audio)
2023-06-20 20:19:32.926 WARNING (MainThread) [custom_components.chime_tts] No filepath provided
2023-06-20 20:19:32.930 DEBUG (MainThread) [custom_components.chime_tts] - Final audio created with duration = 4.071s
2023-06-20 20:19:33.320 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.office", 0.26)
2023-06-20 20:19:33.320 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.office" to: 0.26
2023-06-20 20:19:33.353 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: completed
2023-06-20 20:19:33.353 DEBUG (MainThread) [custom_components.chime_tts] Playing media...
2023-06-20 20:19:33.353 DEBUG (MainThread) [custom_components.chime_tts] - audio_path = "/tmp/tmpmjkzd_71.mp3"
2023-06-20 20:19:33.353 DEBUG (MainThread) [custom_components.chime_tts] - entity_id = "media_player.office"
2023-06-20 20:19:33.414 DEBUG (MainThread) [custom_components.chime_tts] ...media finished playback:

Hopefully additional users and log files can help isolate the cause. I really like this idea and hope you can get it resolved.

1 Like

@kartcon, I agree that your log messages don’t indicate an issue, but I will take a look into it.

Could you please verify whether you are able to play a local .mp3 file on that media player, using Home Assistant’s native media_player.play_media service?

For example:

service: media_player.play_media
data:
  media_content_id: /local/a_local_audio_file.mp3
  media_content_type: music
target:
  entity_id: media_player.office

Hi, after last update works great.
It’s possible to work with dialects?

My configuration.yaml is:

tts:

  • platform: google_translate
    language: “pt”
    tld: pt

like explained here

But Brazilian is spoken

Thanks

@juaurodri, I added the functionalty for language support to a new release v0.3.2. You should see an update in HACS.

Thanks for that!

I found 2 bugs:
File “/config/custom_components/chime_tts/init.py”, line 302, in async_get_playback_audio_path
filename_bytes = filename.encode(‘ascii’)
^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\xe1’ in position 32: ordinal not in range(128)

Filename dont accept words like Olá or João

And this one:
Audio filepath does not exist: “/config/tts/796cb494dc874f990bfd552d48105731bb65ad1e_pt_693225a70b_google_translate.mp3”

And
Source: custom_components/chime_tts/init.py:113
Integration: Chime TTS (documentation, issues)
First occurred: 9:20:52 PM (1 occurrences)
Last logged: 9:20:52 PM

Unable to create audio for playback

Thanks

Hey @juaurodri, thanks for reporting the issues :+1:

I fixed the first issue and I think the second one might be related, so hopefully it’s also fixed.
Could you please upgrade to the new version (v0.3.3) and let me know if if you’re still having any issues?

If you are still having issues after upgrading, please first turn on debug logging, then run the service and reply with the log messages so I might have a better idea of what could be going on.

thanks @Nimrod_Dolev for the feedback.

Debug enable: (I removed some keys)

10:27:45.340 WARNING (MainThread) [custom_components.chime_tts] Audio filepath does not exist: “/config/tts/d904ff352873fdb2ed2c0422810cb61fb5c313b0_pt_693225a70b_google_translate.mp3”
2023-06-22 10:27:45.343 ERROR (MainThread) [custom_components.chime_tts] Unable to create audio for playback
2023-06-22 10:30:47.420 DEBUG (MainThread) [custom_components.chime_tts] async_say(service)
2023-06-22 10:30:47.420 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path(params={‘hass’: <homeassistant.core.HomeAssistant object at 0x7fe7c5a35650>, ‘chime_path’: ‘custom_components/chime_tts/mp3s/bells.mp3’, ‘end_chime_path’: ‘’, ‘delay’: 450.0, ‘tts_platform’: ‘google_translate’, ‘message’: ‘teste um dois tres’, ‘language’: ‘pt’, ‘tld’: ‘pt’, ‘gender’: ‘female’})
2023-06-22 10:30:47.420 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path(“custom_components/chime_tts/mp3s/bells.mp3”, 0, audio)
2023-06-22 10:30:47.423 DEBUG (MainThread) [custom_components.chime_tts] Retrieving audio from path: “custom_components/chime_tts/mp3s/bells.mp3”…
2023-06-22 10:30:47.763 DEBUG (MainThread) [custom_components.chime_tts] - …audio retrieved successfully
2023-06-22 10:30:47.764 DEBUG (MainThread) [custom_components.chime_tts] async_get_tts_cache_path(‘Key removed’)
2023-06-22 10:30:47.769 DEBUG (MainThread) [custom_components.chime_tts] - TTS file does not exist in cache.
2023-06-22 10:30:47.769 DEBUG (MainThread) [custom_components.chime_tts] async_request_tts_audio_filepath(hass, tts_platform=“google_translate”, message=“teste um dois tres”, language=“pt”, tld=“pt”, gender=“female”)
2023-06-22 10:30:47.770 DEBUG (MainThread) [custom_components.chime_tts] Requesting TTS audio:
2023-06-22 10:30:47.770 DEBUG (MainThread) [custom_components.chime_tts] * url = http://192.168.4.25:8123/api/tts_get_url
2023-06-22 10:30:47.770 DEBUG (MainThread) [custom_components.chime_tts] * headers = {‘Authorization’: ‘Bearer Key removed’, ‘Content-Type’: ‘application/json’}
2023-06-22 10:30:47.770 DEBUG (MainThread) [custom_components.chime_tts] * data = {“message”: “teste um dois tres”, “platform”: “google_translate”, “cache”: true, “language”: “pt”, “options”: {“tld”: “pt”}}
2023-06-22 10:30:47.770 DEBUG (MainThread) [custom_components.chime_tts] * timeout = 10
2023-06-22 10:30:48.090 DEBUG (MainThread) [custom_components.chime_tts] - Repsonse status_code: “200”
2023-06-22 10:30:48.090 DEBUG (MainThread) [custom_components.chime_tts] - Repsonse received: “{“url”:“http://192.168.4.25:8123/api/tts_proxy/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3",“path”:"/api/tts_proxy/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3"}"
2023-06-22 10:30:48.090 DEBUG (MainThread) [custom_components.chime_tts] - REST API request to /api/tts_get_url returned audio path: ‘/config/tts/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3’
2023-06-22 10:30:48.090 DEBUG (MainThread) [custom_components.chime_tts] Saving to chime_tts storage:
2023-06-22 10:30:48.090 DEBUG (MainThread) [custom_components.chime_tts] key: “Key removed”
2023-06-22 10:30:48.090 DEBUG (MainThread) [custom_components.chime_tts] value: “/config/tts/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3”
2023-06-22 10:30:48.366 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path(”/config/tts/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3”, 450.0, audio)
2023-06-22 10:30:48.366 WARNING (MainThread) [custom_components.chime_tts] Audio filepath does not exist: “/config/tts/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3”
2023-06-22 10:30:48.368 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 450.0, audio)
2023-06-22 10:30:48.368 DEBUG (MainThread) [custom_components.chime_tts] No filepath provided
2023-06-22 10:30:48.368 DEBUG (MainThread) [custom_components.chime_tts] - Final audio created with duration = 0.944s
2023-06-22 10:30:48.901 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.homepod_mini”, 0.58)
2023-06-22 10:30:48.901 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player “media_player.homepod_mini” to: 0.58
2023-06-22 10:30:49.044 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level: completed
2023-06-22 10:30:49.044 DEBUG (MainThread) [custom_components.chime_tts] Playing media…
2023-06-22 10:30:49.044 DEBUG (MainThread) [custom_components.chime_tts] - audio_path = “/tmp/tmpn0xd5utw.mp3”
2023-06-22 10:30:49.044 DEBUG (MainThread) [custom_components.chime_tts] - entity_id = “media_player.homepod_mini”
2023-06-22 10:30:59.045 DEBUG (MainThread) [custom_components.chime_tts] …media finished playback:
2023-06-22 10:30:59.991 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level(“media_player.homepod_mini”, 0.47)
2023-06-22 10:30:59.991 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player “media_player.homepod_mini” to: 0.47

Thanks @juaurodri for supplying the logs.

It looks like the TTS request completes successfully and provides the file path to the .mp3 file, but when Chime TTS tries to access it, it fails to load.

  1. Do you hear the chime sound from your media player?

  2. To rule out any issue with the .mp3 file, can you please try to open the .mp3 path directly in your browser?
    http://192.168.4.25:8123/api/tts_proxy/deeddf06306e52f24574a76e7a18303d1d36120f_pt_693225a70b_google_translate.mp3
    If it loads normally from the browser I will add a catch to use the full URL instead of the local path.

  3. Could you please share with me which installation type you have for your Home Assistant instance (Raspberry Pi / docker / etc.)?

yeah @Nimrod_Dolev ,

1 - yes
2 - no, because the config/tts folder didn’t have the file
3 - docker

Its working now, I tried a normal tts.google and it saved the .mp3 in the tts folder, after that the chimeTTS started working ( with .mp3 file in the tts folder)

Strange behavior

But thanks!
looks great, I just need to confirm the announce feature works, if so, it’s perfect