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

@Nimrod_Dolev i tried v.0.6.0 and it is not working for me at all now. I am using the same script as before with only one speaker. No sound and no error messages.

Iā€™m sorry to hear that, can you please enable debug logging, run the script and then send me the log messages?

Also: please send me the script you are using so that I can test against it as well.

Unfortunately, the log information is not that informative.

File "/config/custom_components/chime_tts/__init__.py", line 224, in handle_service_calls
File "/config/custom_components/chime_tts/__init__.py", line 130, in async_say_execute
File "/config/custom_components/chime_tts/__init__.py", line 485, in async_get_playback_audio_path
output_audio = get_audio_from_path(hass, chime_path)
File "/config/custom_components/chime_tts/__init__.py", line 604, in get_audio_from_path

@theadlee I think you either did not correctly enable debug logs before calling the service, or you didnā€™t expand the full logs.

If the service is being called, I would expect to see at least the initial debug log.

Can you please follow these steps to reveal the full debug logs?

  1. Enable debug log messages:
    Settings ā†’ Devices & Services ā†’ Chime TTS ā†’ Enable debug logging

  2. Call the chime_tss.say service (or your script which calls the service)

  3. Open the full log messages for Chime TTS:
    Open the log messages: https://YOUR_HA_ADDRESS:8123/config/logs?filter=chime_tts
    Then press the LOAD FULL LOGS button

@Nimrod_Dolev

I figured out what the issue was. When I upgraded to v.0.6.0 it deleted all of my personal mp3s and the directory only contained the stock mp3s. This issue leaves the integration in a broken state which requires a restart of homeassistant.

It seems to be working relatively well now on two speakers that I have running in parallel with the exception of the volume being very low on occasion. I will keep playing with it and report back. Thanks again for your work on this.

I meant to say if the integration cannot find the mp3 it leaves the integration in a broken state.

Thank you, this release seems to indeed solve the issue! Great job!

1 Like

In further testing on V.0.6.0, the integration will intermittently crash during some TTS events but the main features are working as advertised. I will continue testing with debug turned on and capture the logs.

Iā€™m curious - why does this require a long lived token? Is there no way to get the TTS URL/audio file without using the REST API?

Yes, Chime TTS uses the Home Assistant tts_get_url API to generate the TTS audio and obtain the filepath, which requires a long lived token.

Iā€™ve tried to find a way around this but I couldnā€™t find any other way.

@Nimrod_Dolev for what its worth, I havenā€™t been able to reproduce this issue again on v0.6.0. Service calls to chime_tts seem to all work as expected when using Piper. Iā€™ll let you know if I see this happen again.

Hi @Nimrod_Dolev

I am also having trouble with the integration. I have not been able to get it to work at all with Nabu Casa TTS, the chime plays but no speech. Here are the debug logs:

2023-08-10 16:53:53.706 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-08-10 16:53:53.706 DEBUG (MainThread) [custom_components.chime_tts] * entity_ids = ['media_player.study']
2023-08-10 16:53:53.706 DEBUG (MainThread) [custom_components.chime_tts] * hass = <homeassistant.core.HomeAssistant object at 0x7fadeb8990>
2023-08-10 16:53:53.707 DEBUG (MainThread) [custom_components.chime_tts] * chime_path = custom_components/chime_tts/mp3s/choir.mp3
2023-08-10 16:53:53.707 DEBUG (MainThread) [custom_components.chime_tts] * delay = 450.0
2023-08-10 16:53:53.707 DEBUG (MainThread) [custom_components.chime_tts] * message = Hello
2023-08-10 16:53:53.707 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = cloud_say
2023-08-10 16:53:53.707 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2023-08-10 16:53:53.708 DEBUG (MainThread) [custom_components.chime_tts] * volume_level = 0.32
2023-08-10 16:53:53.708 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2023-08-10 16:53:53.708 DEBUG (MainThread) [custom_components.chime_tts] * announce = False
2023-08-10 16:53:53.708 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-08-10 16:53:53.708 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-08-10 16:53:53.709 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-08-10 16:53:53.709 DEBUG (MainThread) [custom_components.chime_tts] - async_get_cached_audio_data('583bf8ca5c7c971b1b3ed0dc254fe3ac788e0fcce55cd9025b23b30d901266d5')
2023-08-10 16:53:53.709 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving key/value from chime_tts storage:
2023-08-10 16:53:53.709 DEBUG (MainThread) [custom_components.chime_tts] - key: 583bf8ca5c7c971b1b3ed0dc254fe3ac788e0fcce55cd9025b23b30d901266d5
2023-08-10 16:53:53.710 DEBUG (MainThread) [custom_components.chime_tts] - value: {'audio_path': '/media/sounds/temp/chime_tts/0u4mh1ey.mp3', 'audio_duration': 3.328}
2023-08-10 16:53:53.712 DEBUG (MainThread) [custom_components.chime_tts] - Cached audio data found
2023-08-10 16:53:53.712 DEBUG (MainThread) [custom_components.chime_tts] Using previously generated mp3 saved in cache
2023-08-10 16:53:53.712 DEBUG (MainThread) [custom_components.chime_tts] - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/0u4mh1ey.mp3', 'audio_duration': 3.328}
2023-08-10 16:53:53.713 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.study", 0.32)
2023-08-10 16:53:53.713 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.study" to: 0.32
2023-08-10 16:53:53.739 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 16:53:53.739 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-08-10 16:53:53.739 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/0u4mh1ey.mp3
2023-08-10 16:53:53.739 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2023-08-10 16:53:53.739 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.study']
2023-08-10 16:53:53.810 DEBUG (MainThread) [custom_components.chime_tts] ...media_player.play_media completed.
2023-08-10 16:53:53.811 DEBUG (MainThread) [custom_components.chime_tts] Waiting 3.328s for audio playback to complete...
2023-08-10 16:53:57.143 DEBUG (MainThread) [custom_components.chime_tts] Returning media_player.study's volume level to 0.08
2023-08-10 16:53:57.143 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.study", 0.08)
2023-08-10 16:53:57.143 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.study" to: 0.08
2023-08-10 16:53:57.184 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 16:53:57.185 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 3479.0589999999997 ms -----

I am currently running v0.6.0. Previously the integration was working with Google TTS but now that doesnā€™t work either! :woozy_face:

EDIT: I have also found the audio file generated in the media folder and I can confirm it is just the chime with no TTS element.

Will

@varyamereon sorry to hear itā€™s not woprking for you.

The log messages you provided were from playing a previously cached generated audio file. Can you please play a new message (one that isnā€™t in the cache), so I can check the logs for what might be going wrong when generating the TTS?

Sure thing:

2023-08-10 17:08:43.288 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-08-10 17:08:43.288 DEBUG (MainThread) [custom_components.chime_tts] * entity_ids = ['media_player.study']
2023-08-10 17:08:43.288 DEBUG (MainThread) [custom_components.chime_tts] * hass = <homeassistant.core.HomeAssistant object at 0x7fadeb8990>
2023-08-10 17:08:43.288 DEBUG (MainThread) [custom_components.chime_tts] * chime_path = custom_components/chime_tts/mp3s/ding_dong.mp3
2023-08-10 17:08:43.289 DEBUG (MainThread) [custom_components.chime_tts] * delay = 450.0
2023-08-10 17:08:43.289 DEBUG (MainThread) [custom_components.chime_tts] * message = Hello
2023-08-10 17:08:43.289 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = cloud_say
2023-08-10 17:08:43.289 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2023-08-10 17:08:43.289 DEBUG (MainThread) [custom_components.chime_tts] * volume_level = 0.36
2023-08-10 17:08:43.290 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2023-08-10 17:08:43.290 DEBUG (MainThread) [custom_components.chime_tts] * announce = False
2023-08-10 17:08:43.290 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-08-10 17:08:43.290 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-08-10 17:08:43.291 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-08-10 17:08:43.291 DEBUG (MainThread) [custom_components.chime_tts] - async_get_cached_audio_data('d4eb43cffc8587a27197cd4ac6cf081679f48653aee4b6a9c6a556b95813b099')
2023-08-10 17:08:43.291 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving key/value from chime_tts storage:
2023-08-10 17:08:43.291 DEBUG (MainThread) [custom_components.chime_tts] - key: d4eb43cffc8587a27197cd4ac6cf081679f48653aee4b6a9c6a556b95813b099
2023-08-10 17:08:43.291 DEBUG (MainThread) [custom_components.chime_tts] - value: {'audio_path': '/media/sounds/temp/chime_tts/fhg_d5g8.mp3', 'audio_duration': 2.005}
2023-08-10 17:08:43.292 WARNING (MainThread) [custom_components.chime_tts] Could not find previosuly cached generated mp3 file
2023-08-10 17:08:43.299 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("custom_components/chime_tts/mp3s/ding_dong.mp3", 0, audio)
2023-08-10 17:08:43.299 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "custom_components/chime_tts/mp3s/ding_dong.mp3"...
2023-08-10 17:08:43.665 DEBUG (MainThread) [custom_components.chime_tts] - ...audio with duration 1.533s retrieved successfully
2023-08-10 17:08:43.665 DEBUG (MainThread) [custom_components.chime_tts] Cached TTS mp3 file exists?
2023-08-10 17:08:43.665 DEBUG (MainThread) [custom_components.chime_tts] - async_get_cached_audio_data('ad14d27cfbee1b282fd033bc90f8aeb6ea8f375c2d5c22e69073a5374f7b1e9c')
2023-08-10 17:08:43.665 DEBUG (MainThread) [custom_components.chime_tts] - Audio data not found in cache.
2023-08-10 17:08:43.666 DEBUG (MainThread) [custom_components.chime_tts] - filepath_hash ad14d27cfbee1b282fd033bc90f8aeb6ea8f375c2d5c22e69073a5374f7b1e9c does not exist in the cache.
2023-08-10 17:08:43.666 DEBUG (MainThread) [custom_components.chime_tts] - Cached TTS mp3 file not found
2023-08-10 17:08:43.666 DEBUG (MainThread) [custom_components.chime_tts] async_request_tts_audio_filepath(hass, tts_platform="cloud_say", message="Hello", language="None", tld="None", gender="None"))
2023-08-10 17:08:43.666 DEBUG (MainThread) [custom_components.chime_tts] Requesting TTS audio:
2023-08-10 17:08:43.667 DEBUG (MainThread) [custom_components.chime_tts] * url = http://192.168.1.41:8123/api/tts_get_url
2023-08-10 17:08:43.667 DEBUG (MainThread) [custom_components.chime_tts] * headers = {'Authorization': 'Bearer eyJhb##########DtMrE', 'Content-Type': 'application/json'}
2023-08-10 17:08:43.667 DEBUG (MainThread) [custom_components.chime_tts] * data = {"message": "Hello", "platform": "cloud_say", "cache": true}
2023-08-10 17:08:43.667 DEBUG (MainThread) [custom_components.chime_tts] * timeout = 10
2023-08-10 17:08:43.691 DEBUG (MainThread) [custom_components.chime_tts] - Repsonse status_code: "500"
2023-08-10 17:08:43.691 DEBUG (MainThread) [custom_components.chime_tts] - Repsonse received: "500: Internal Server Error"
2023-08-10 17:08:43.691 WARNING (MainThread) [custom_components.chime_tts] TTS Audio request unsuccessful: '500: Internal Server Error'
2023-08-10 17:08:43.693 DEBUG (MainThread) [custom_components.chime_tts] - No TTS filepaths returned
2023-08-10 17:08:43.694 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "custom_components/chime_tts/mp3s/_blank.mp3"...
2023-08-10 17:08:44.012 DEBUG (MainThread) [custom_components.chime_tts] - ...audio with duration 0.022s retrieved successfully
2023-08-10 17:08:44.016 DEBUG (MainThread) [custom_components.chime_tts] - Final audio created:
2023-08-10 17:08:44.016 DEBUG (MainThread) [custom_components.chime_tts] - Duration = 2.005s
2023-08-10 17:08:44.016 DEBUG (MainThread) [custom_components.chime_tts] Creating final audio file
2023-08-10 17:08:44.018 DEBUG (MainThread) [custom_components.chime_tts] - Temp folder exists: /media/sounds/temp/chime_tts/
2023-08-10 17:08:44.018 DEBUG (MainThread) [custom_components.chime_tts] - Creating temporary mp3 file...
2023-08-10 17:08:44.019 DEBUG (MainThread) [custom_components.chime_tts] - temp_obj = <tempfile._TemporaryFileWrapper object at 0x7f9d9e2010>
2023-08-10 17:08:44.021 DEBUG (MainThread) [custom_components.chime_tts] - Filepath = '/media/sounds/temp/chime_tts/n_e_lupo.mp3'
2023-08-10 17:08:44.322 DEBUG (MainThread) [custom_components.chime_tts] - File saved successfully
2023-08-10 17:08:44.323 DEBUG (MainThread) [custom_components.chime_tts] - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/n_e_lupo.mp3', 'audio_duration': 2.005}
2023-08-10 17:08:44.323 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.study", 0.36)
2023-08-10 17:08:44.323 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.study" to: 0.36
2023-08-10 17:08:44.349 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 17:08:44.349 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-08-10 17:08:44.349 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/n_e_lupo.mp3
2023-08-10 17:08:44.349 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2023-08-10 17:08:44.350 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.study']
2023-08-10 17:08:44.420 DEBUG (MainThread) [custom_components.chime_tts] ...media_player.play_media completed.
2023-08-10 17:08:44.421 DEBUG (MainThread) [custom_components.chime_tts] Waiting 2.005s for audio playback to complete...
2023-08-10 17:08:46.432 DEBUG (MainThread) [custom_components.chime_tts] Returning media_player.study's volume level to 0.08
2023-08-10 17:08:46.432 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.study", 0.08)
2023-08-10 17:08:46.433 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.study" to: 0.08
2023-08-10 17:08:46.465 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 17:08:46.465 DEBUG (MainThread) [custom_components.chime_tts] Saving generated mp3 file to cache
2023-08-10 17:08:46.465 DEBUG (MainThread) [custom_components.chime_tts] Saving to chime_tts storage:
2023-08-10 17:08:46.465 DEBUG (MainThread) [custom_components.chime_tts] - key: "d4eb43cffc8587a27197cd4ac6cf081679f48653aee4b6a9c6a556b95813b099"
2023-08-10 17:08:46.465 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'audio_path': '/media/sounds/temp/chime_tts/n_e_lupo.mp3', 'audio_duration': 2.005}"
2023-08-10 17:08:46.474 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 3186.735 ms -----

I see the 500 error, just out of interest calling the tts.cloud_say service works fine.

Will

I am still having issues with the integration stopping. It take a reboot to get it started again. Below is log of a recent event where the service stopped and would not restart.

2023-08-10 10:45:08.740 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-08-10 10:45:08.740 DEBUG (MainThread) [custom_components.chime_tts] * entity_ids = []
2023-08-10 10:45:08.740 DEBUG (MainThread) [custom_components.chime_tts] * hass = <homeassistant.core.HomeAssistant object at 0x7fa430935950>
2023-08-10 10:45:08.741 DEBUG (MainThread) [custom_components.chime_tts] * delay = 450.0
2023-08-10 10:45:08.742 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2023-08-10 10:45:08.742 DEBUG (MainThread) [custom_components.chime_tts] * volume_level = 1.0
2023-08-10 10:45:08.742 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2023-08-10 10:45:08.742 DEBUG (MainThread) [custom_components.chime_tts] * announce = False
2023-08-10 10:45:08.742 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-08-10 10:45:08.743 ERROR (MainThread) [custom_components.chime_tts] No valid media player found
2023-08-10 10:45:08.746 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-08-10 10:45:08.746 DEBUG (MainThread) [custom_components.chime_tts] * entity_ids = ['media_player.workout_room_2', 'media_player.living_room']
2023-08-10 10:45:08.746 DEBUG (MainThread) [custom_components.chime_tts] * hass = <homeassistant.core.HomeAssistant object at 0x7fa430935950>
2023-08-10 10:45:08.746 DEBUG (MainThread) [custom_components.chime_tts] * chime_path = custom_components/chime_tts/mp3s/teams_drip_drop.mp3
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * delay = 600.0
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * message = Todd is ending a Teams Meeting
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = amazon_polly
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * volume_level = 0.25
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] * announce = True
2023-08-10 10:45:08.747 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-08-10 10:45:08.748 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-08-10 10:45:08.748 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-08-10 10:45:08.748 DEBUG (MainThread) [custom_components.chime_tts] - async_get_cached_audio_data('ef6499742dc0546ccc38693aa2be1a000b30ed0cf322e67677c4bbe4dac44023')
2023-08-10 10:45:08.748 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving key/value from chime_tts storage:
2023-08-10 10:45:08.748 DEBUG (MainThread) [custom_components.chime_tts] - key: ef6499742dc0546ccc38693aa2be1a000b30ed0cf322e67677c4bbe4dac44023
2023-08-10 10:45:08.748 DEBUG (MainThread) [custom_components.chime_tts] - value: {'audio_path': '/media/sounds/temp/chime_tts/xec9gqef.mp3', 'audio_duration': 4.042}
2023-08-10 10:45:08.749 DEBUG (MainThread) [custom_components.chime_tts] - Cached audio data found
2023-08-10 10:45:08.749 DEBUG (MainThread) [custom_components.chime_tts] Using previously generated mp3 saved in cache
2023-08-10 10:45:08.749 DEBUG (MainThread) [custom_components.chime_tts] - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/xec9gqef.mp3', 'audio_duration': 4.042}
2023-08-10 10:45:08.749 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.workout_room_2", 0.25)
2023-08-10 10:45:08.749 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.workout_room_2" to: 0.25
2023-08-10 10:45:08.785 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 10:45:08.785 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.living_room", 0.25)
2023-08-10 10:45:08.785 DEBUG (MainThread) [custom_components.chime_tts] - Skipped setting volume
2023-08-10 10:45:08.785 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-08-10 10:45:08.786 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/xec9gqef.mp3
2023-08-10 10:45:08.786 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2023-08-10 10:45:08.786 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.workout_room_2', 'media_player.living_room']
2023-08-10 10:45:08.786 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
2023-08-10 10:45:08.820 DEBUG (MainThread) [custom_components.chime_tts] ...media_player.play_media completed.
2023-08-10 10:45:08.821 DEBUG (MainThread) [custom_components.chime_tts] Waiting 4.042s for audio playback to complete...
2023-08-10 10:45:12.866 DEBUG (MainThread) [custom_components.chime_tts] Waiting 0.0006s for final_delay to complete...
2023-08-10 10:45:13.470 DEBUG (MainThread) [custom_components.chime_tts] Returning media_player.workout_room_2's volume level to 0.14
2023-08-10 10:45:13.470 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.workout_room_2", 0.14)
2023-08-10 10:45:13.470 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.workout_room_2" to: 0.14
2023-08-10 10:45:13.486 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 10:45:13.486 DEBUG (MainThread) [custom_components.chime_tts] Returning media_player.living_room's volume level to 0.25
2023-08-10 10:45:13.486 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.living_room", 0.25)
2023-08-10 10:45:13.486 DEBUG (MainThread) [custom_components.chime_tts] - Skipped setting volume
2023-08-10 10:45:13.486 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 4740.732 ms -----
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * entity_ids = []
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * hass = <homeassistant.core.HomeAssistant object at 0x7fa430935950>
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * delay = 450.0
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * volume_level = 1.0
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2023-08-10 10:45:13.487 DEBUG (MainThread) [custom_components.chime_tts] * announce = False
2023-08-10 10:45:13.488 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-08-10 10:45:13.488 ERROR (MainThread) [custom_components.chime_tts] No valid media player found
2023-08-10 10:59:52.186 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-08-10 10:59:52.186 DEBUG (MainThread) [custom_components.chime_tts] * entity_ids = ['media_player.workout_room_2', 'media_player.living_room']
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * hass = <homeassistant.core.HomeAssistant object at 0x7fa430935950>
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * chime_path = custom_components/chime_tts/mp3s/keys.mp3
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * delay = 600.0
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * message = Garage Door Open
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = amazon_polly
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * volume_level = 0.25
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] * announce = True
2023-08-10 10:59:52.187 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] - async_get_cached_audio_data('4fa4eb1935d4583503c2ede6035d677f4291d765f5c48d417f8a5bacc6bdd6f5')
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving key/value from chime_tts storage:
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] - key: 4fa4eb1935d4583503c2ede6035d677f4291d765f5c48d417f8a5bacc6bdd6f5
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] - value: {'audio_path': '/media/sounds/temp/chime_tts/kptqvl_i.mp3', 'audio_duration': 2.661}
2023-08-10 10:59:52.188 DEBUG (MainThread) [custom_components.chime_tts] - Cached audio data found
2023-08-10 10:59:52.189 DEBUG (MainThread) [custom_components.chime_tts] Using previously generated mp3 saved in cache
2023-08-10 10:59:52.189 DEBUG (MainThread) [custom_components.chime_tts] - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/kptqvl_i.mp3', 'audio_duration': 2.661}
2023-08-10 10:59:52.189 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.workout_room_2", 0.25)
2023-08-10 10:59:52.189 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.workout_room_2" to: 0.25
2023-08-10 10:59:52.213 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 10:59:52.213 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.living_room", 0.25)
2023-08-10 10:59:52.213 DEBUG (MainThread) [custom_components.chime_tts] - Seting volume_level of media player "media_player.living_room" to: 0.25
2023-08-10 10:59:52.269 DEBUG (MainThread) [custom_components.chime_tts] - Volume set
2023-08-10 10:59:52.269 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-08-10 10:59:52.270 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/kptqvl_i.mp3
2023-08-10 10:59:52.270 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2023-08-10 10:59:52.270 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.workout_room_2', 'media_player.living_room']
2023-08-10 10:59:52.270 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
File "/config/custom_components/chime_tts/__init__.py", line 224, in handle_service_calls
File "/config/custom_components/chime_tts/__init__.py", line 179, in async_say_execute

I canā€™t get the integration to run for more than a few hours without crashing. Here is another log dump.

2023-08-10 21:00:00.965 DEBUG (MainThread) [custom_components.chime_tts] * data = {"message": "The Time Is 9:00 PM", "platform": "amazon_polly", "cache": true}
2023-08-10 21:00:00.966 DEBUG (MainThread) [custom_components.chime_tts] * timeout = 10
2023-08-10 21:00:02.184 DEBUG (MainThread) [custom_components.chime_tts] - Repsonse status_code: "200"
2023-08-10 21:00:02.185 DEBUG (MainThread) [custom_components.chime_tts] - Repsonse received: "{"url":"http://192.168.7.202:8123/api/tts_proxy/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3","path":"/api/tts_proxy/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3"}"
2023-08-10 21:00:02.185 DEBUG (MainThread) [custom_components.chime_tts] - TTS filepaths = {'path': '/config/tts/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3', 'url': 'http://192.168.7.202:8123/api/tts_proxy/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3'}
2023-08-10 21:00:02.185 DEBUG (MainThread) [custom_components.chime_tts] - TTS file path found: /config/tts/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3
2023-08-10 21:00:02.186 DEBUG (MainThread) [custom_components.chime_tts] Saving to chime_tts storage:
2023-08-10 21:00:02.186 DEBUG (MainThread) [custom_components.chime_tts] - key: "1fa2638756c57ab8e55099131d558aa6516bdfdd976a75759258cb85bb66a38c"
2023-08-10 21:00:02.186 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'audio_path': '/config/tts/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3', 'audio_duration': None}"
2023-08-10 21:00:02.197 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("/config/tts/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3", 0.1, audio)
2023-08-10 21:00:02.198 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/tts/3c468b5886c4a84c7cec982bc7df6c7c0de9e74c_en-us_98338dd59c_amazon_polly.mp3"...
File "/config/custom_components/chime_tts/__init__.py", line 224, in handle_service_calls
File "/config/custom_components/chime_tts/__init__.py", line 130, in async_say_execute
File "/config/custom_components/chime_tts/__init__.py", line 535, in async_get_playback_audio_path
File "/config/custom_components/chime_tts/__init__.py", line 604, in get_audio_from_path

It appears the new queueing feature is responsible.
For now I have release v0.6.1 which removes the service queue addition.
I will try to change the way service calls are queued in the next release.

v0.6.1 has been working great so far. I was also experiencing a delay between speakers on the prior release and that seems to have gone away also. I really donā€™t need the queue feature, I am calling the service from a script that I have set to queued mode and that seems to work just fine.

Glad to hear it, thanks for the feedback :+1:

I have been testing v0.6.1. Two issues still open. Sometimes the volume does not revert to what was before the announcement is played. Secondly, all the speaker are not 100% in sync. There is about a 200ms delay between speakers during an announcement. I am test by sending the announcement to three speakers.