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

Hi Chrisandsally, you’re the first to report this issue as far as I know - and it’s always a good idea to provide debug logs :wink:

It’s hard to understand what might be causing the issue, so please send me the debug logs and i’ll try to see what might be the cause.

Hi Coolie, I agree with @ColtonYYZ that the issue for your missing playback is related to the folder path you have defined for temporary TTS audio files. You are trying to play audio files from a folder that is not inside your media direcotry (/config/tts).

Try changing this path to /media/tts (or any subfolder inside of the /media folder).

Is it mandatory that it be in the media folder?

I believe so. Try changing the path and see if it makes a difference.

Weird because I have been using /config/tts for years

How have you been using it?

@Nimrod_Dolev

Thanks for getting back to me. I setup a script with the following YAML;

alias: Chime TTS Test
sequence:
  - service: logger.set_level
    data:
      custom_components.chime_tts: debug
  - service: chime_tts.say
    target:
      entity_id:
        - media_player.breakfast_sonos
        - media_player.kitchen_sonos
        - media_player.livingroom_sonos
        - media_player.roam_sl_sonos
        - media_player.workshop_sonos
    data:
      chime_path: fanfare
      message: This is a test
      tts_platform: tts.google_en_com
      join_players: true
      unjoin_players: true
mode: single

Monitoring execution of the script in the SONOS application, I see an audio file received and played by the breakfast_sonos speaker. None of the other speakers are joined together prior to the message being played. I tried running the script a couple of times.

Log entries follow;

2024-05-07 17:35:31.214 WARNING (SyncWorker_2) [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
2024-05-07 17:46:58.882 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta4 -----
2024-05-07 17:46:58.882 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.roam_sl_sonos
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.workshop_sonos
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: media_player.kitchen_sonos
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 3: media_player.livingroom_sonos
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 4: media_player.breakfast_sonos
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = fanfare
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-05-07 17:46:58.890 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: {'entity_id': 'media_player.roam_sl_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: {'entity_id': 'media_player.workshop_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: {'entity_id': 'media_player.kitchen_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 3: {'entity_id': 'media_player.livingroom_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 4: {'entity_id': 'media_player.breakfast_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = This is a test
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = tts.google_en_com
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = True
2024-05-07 17:46:58.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = True
2024-05-07 17:46:58.892 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "custom_components/chime_tts/mp3s/fanfare.mp3"...
2024-05-07 17:46:59.581 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 3.515s
2024-05-07 17:46:59.582 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-05-07 17:46:59.582 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'tts.google_en_com'
2024-05-07 17:46:59.582 DEBUG (MainThread) [custom_components.chime_tts] * message = 'This is a test'
2024-05-07 17:46:59.583 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-05-07 17:46:59.583 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-05-07 17:46:59.583 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-05-07 17:47:00.452 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 870.0ms
2024-05-07 17:47:00.460 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-07 17:47:00.751 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /media/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:00.982 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-05-07 17:47:00.983 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.357
2024-05-07 17:47:00.983 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/6ipc12at.mp3"
2024-05-07 17:47:00.983 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-05-07 17:47:00.983 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3"
2024-05-07 17:47:00.983 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-05-07 17:47:00.983 WARNING (MainThread) [custom_components.chime_tts] Unable to join speakers. 0 supported media_players found (minimum is 2).
2024-05-07 17:47:00.983 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] 5 Sonos media players detected:
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] - media_player.roam_sl_sonos
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.roam_sl_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] - media_player.workshop_sonos
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.workshop_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] - media_player.kitchen_sonos
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.kitchen_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] - media_player.livingroom_sonos
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.livingroom_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] - media_player.breakfast_sonos
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.breakfast_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:47:00.984 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:47:00.985 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:47:00.985 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:00.985 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:47:00.987 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:47:00.987 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:47:00.987 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:00.987 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:47:00.988 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:47:00.989 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:47:00.989 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:00.989 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:47:00.990 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:47:01.004 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:47:01.004 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:01.004 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:47:01.017 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:47:01.017 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:47:01.017 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:01.017 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:47:01.029 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:47:01.029 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:47:01.029 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/6ipc12at.mp3
2024-05-07 17:47:01.029 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:47:01.034 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 5.357s for audio playback to complete...
2024-05-07 17:47:06.396 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 5 media_players aren't playing...
2024-05-07 17:47:06.396 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.roam_sl_sonos
2024-05-07 17:47:06.396 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.kitchen_sonos
2024-05-07 17:47:06.597 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.workshop_sonos
2024-05-07 17:47:06.799 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.livingroom_sonos
2024-05-07 17:47:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.breakfast_sonos
2024-05-07 17:47:07.001 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 8.11 s -----
2024-05-07 17:48:03.803 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta4 -----
2024-05-07 17:48:03.803 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.roam_sl_sonos
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.workshop_sonos
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: media_player.kitchen_sonos
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 3: media_player.livingroom_sonos
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 4: media_player.breakfast_sonos
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = fanfare
2024-05-07 17:48:03.807 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: {'entity_id': 'media_player.roam_sl_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: {'entity_id': 'media_player.workshop_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: {'entity_id': 'media_player.kitchen_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 3: {'entity_id': 'media_player.livingroom_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 4: {'entity_id': 'media_player.breakfast_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = This is a test
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = tts.google_en_com
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-05-07 17:48:03.808 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = True
2024-05-07 17:48:03.809 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = True
2024-05-07 17:48:03.809 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "custom_components/chime_tts/mp3s/fanfare.mp3"...
2024-05-07 17:48:04.059 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 3.515s
2024-05-07 17:48:04.061 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-05-07 17:48:04.061 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'tts.google_en_com'
2024-05-07 17:48:04.061 DEBUG (MainThread) [custom_components.chime_tts] * message = 'This is a test'
2024-05-07 17:48:04.061 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-05-07 17:48:04.061 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-05-07 17:48:04.062 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-05-07 17:48:04.280 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 220.0ms
2024-05-07 17:48:04.288 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-07 17:48:04.583 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /media/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.832 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-05-07 17:48:04.833 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.357
2024-05-07 17:48:04.833 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/s2lkndde.mp3"
2024-05-07 17:48:04.833 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-05-07 17:48:04.833 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3"
2024-05-07 17:48:04.833 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-05-07 17:48:04.833 WARNING (MainThread) [custom_components.chime_tts] Unable to join speakers. 0 supported media_players found (minimum is 2).
2024-05-07 17:48:04.834 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-07 17:48:04.835 DEBUG (MainThread) [custom_components.chime_tts] 5 Sonos media players detected:
2024-05-07 17:48:04.835 DEBUG (MainThread) [custom_components.chime_tts] - media_player.roam_sl_sonos
2024-05-07 17:48:04.836 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.roam_sl_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:04.836 DEBUG (MainThread) [custom_components.chime_tts] - media_player.workshop_sonos
2024-05-07 17:48:04.836 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.workshop_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:04.836 DEBUG (MainThread) [custom_components.chime_tts] - media_player.kitchen_sonos
2024-05-07 17:48:04.836 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.kitchen_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:04.836 DEBUG (MainThread) [custom_components.chime_tts] - media_player.livingroom_sonos
2024-05-07 17:48:04.837 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.livingroom_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:04.837 DEBUG (MainThread) [custom_components.chime_tts] - media_player.breakfast_sonos
2024-05-07 17:48:04.837 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.breakfast_sonos', 'platform': 'sonos', 'should_change_volume': False, 'initial_volume_level': 0.01, 'playback_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-07 17:48:04.837 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:48:04.837 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:48:04.837 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.838 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:48:04.846 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:48:04.846 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:48:04.846 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.846 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:48:04.848 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:48:04.848 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:48:04.848 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.848 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:48:04.851 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:48:04.852 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:48:04.852 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.852 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:48:04.853 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:48:04.853 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:48:04.853 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.853 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:48:04.855 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-07 17:48:04.855 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-07 17:48:04.855 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/s2lkndde.mp3
2024-05-07 17:48:04.855 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.breakfast_sonos']
2024-05-07 17:48:04.871 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 5.357s for audio playback to complete...
2024-05-07 17:48:10.243 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 5 media_players aren't playing...
2024-05-07 17:48:10.243 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.roam_sl_sonos
2024-05-07 17:48:10.243 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.kitchen_sonos
2024-05-07 17:48:10.444 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.workshop_sonos
2024-05-07 17:48:10.646 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.livingroom_sonos
2024-05-07 17:48:10.848 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.breakfast_sonos
2024-05-07 17:48:10.849 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 7.04 s -----

Here’s an image of the SONOS App prior to running the script.

Here’s an image of the SONOS App after running the script.

You can see that Breakfast SONOS played the chime and the message however no other SONOS speakes were joined with it.

Via a script with multiple automations.

You may want to review how the media source works in Home Assistant

If you want to use the folder /config/tts you will need to ensure that this path is included in media_source in your configuration.yaml file.

1 Like

I just released a new beta release, v1.1.0-beta 5 with the following:

:toolbox: Improvements:

  • Converted included chime paths to absolute file paths

:lady_beetle: Bugfixes:

  • Fix for incorrect label for the 4th custom chime in the dropdown UI
  • Fix for downloading chime audio files
  • Fixes for joined media_players (eg: Sonos)
  • Fix to prevent original chime files from being overwritten by audio_conversion

To install the new beta version:

  1. Open the Chime TTS repository in HACS
  2. Click on the button in the top right
  3. Select the ↻ Redownload option
  4. Enable the Show beta versions option (it may take a moment to update the list)
  5. Select version v1.1.0-beta5 from the updated version drop-down list
  6. Restart Home Assistant
1 Like

Thank you @Nimrod_Dolev . My HA instance can’t be restarted at the moment. It’s running some night routines. I’ll install beta 5 and test in the am. I’ll keep you posted.

I can report this changes is working well. Thanks @Nimrod_Dolev

Chime: v1.1.0-beta6 on WARNINGS HA startup also with b5

Logger: py.warnings
Source: runner.py:190
First occurred: 4:32:11 PM (1 occurrences)
Last logged: 4:32:11 PM

/usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine ‘ChimeTTSQueueManager.queue_processor’ was never awaited handle = None # Needed to break cycles when an exception occurs.

Logger: homeassistant.util.loop
Source: util/loop.py:70
First occurred: 4:32:11 PM (1 occurrences)
Last logged: 4:32:11 PM

Detected blocking call to import_module with args (‘custom_components.chime_tts’,) in /usr/src/homeassistant/homeassistant/loader.py, line 1041: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop

@Nimrod_Dolev Hey there! Thanks again for all your hard work on this integration! Really! It’s working well for me! So all is good!!

I wondered if it’s by design or not, but I noticed whenever Chime TTS creates a file and places it in my /www/chime_tts folder, once the chime has completed, it doesn’t delete this file. Is this normal? Is there any way to get rid of the file once the chime as completed?

I found temp files (random names to them using letters-and-numbers.mp3) so I have manually deleted them. But if we don’t have them auto delete, it will fill up lots of space over time.

Just to clarify, I don’t use the cache function in Chime_TTS_Say either. Below is my folder setup for reference! Thanks again!!

folders

Currently Chime TTs_URL outputs this:
{'url': None, 'media_content_id': 'media-source://media_source/local/temp/chime_tts/announcements/i6wi4nv7.mp3', 'duration': 1.944, 'success': True}
Is this correct? Do I have something configured incorrectly?
If this is correct, how do I use this with the Play Media service?

I figured it out:
{{ chime_url.media_content_id }} is what I need to use.

I’d like my automation to alert me with voice when sensor is in certain state.
I installed Chime TTS, testing in Developer Services but I have 0 targets.

My speaker is working (fine) via Wyoming Satellite on remote Linux Debian host.

How can I use Chime TTS with Wyoming or simply send mp3 over ssh to play it on remote host when automation triggers?

Hi @Nimrod_Dolev, continued great work on this. I’ve been testing the latest beta 1.1.0-beta6. Looks like the cache issue is resolved - I’ve added a comment on Issue #135. Join and Unjoin also seems to be working well, which is AWESOME. No more 100% volume from a single speaker or echos throughout the house, it’s a dream :slight_smile:

In 1.1.0-beta6, the Announce feature now has some strange behaviour - when in a group it plays only on one speaker and when a single it plays at very low volume. I’ll raise a new issue and attach the debug log there.

Github is giving me grief about my issue (invalid request) twice now. I’ll try later, but debug logs seem like all is OK?

2024-05-22 10:00:00.605 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta6 -----
2024-05-22 10:00:00.606 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-22 10:00:00.658 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.lounge_home_theatre
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.kitchen_sonos
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: media_player.portable_speaker
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_1
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = -500.0
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 500.0
2024-05-22 10:00:00.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: {'entity_id': 'media_player.lounge_home_theatre', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.6, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: {'entity_id': 'media_player.kitchen_sonos', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.6, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: {'entity_id': 'media_player.portable_speaker', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.6, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Someone is at the front door.
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = tts.openai_tts_alloy
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-05-22 10:00:00.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.6
2024-05-22 10:00:00.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-05-22 10:00:00.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = True
2024-05-22 10:00:00.664 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-05-22 10:00:00.670 DEBUG (MainThread) [custom_components.chime_tts]    Cached audio found:
2024-05-22 10:00:00.670 DEBUG (MainThread) [custom_components.chime_tts]      - local_path = "/media/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-05-22 10:00:00.670 DEBUG (MainThread) [custom_components.chime_tts]      - audio_duration = 5.549
2024-05-22 10:00:00.670 DEBUG (MainThread) [custom_components.chime_tts]      - public_path = None
2024-05-22 10:00:00.670 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-05-22 10:00:00.671 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-05-22 10:00:00.672 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Calling media_player.join service for 3 media_player entities...
2024-05-22 10:00:00.672 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Joining 3 media_player entities:
2024-05-22 10:00:00.672 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]   - media_player.lounge_home_theatre
2024-05-22 10:00:00.672 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]   - media_player.kitchen_sonos
2024-05-22 10:00:00.672 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]   - media_player.portable_speaker
2024-05-22 10:00:03.227 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      ...done
2024-05-22 10:00:03.228 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-05-22 10:00:03.238 DEBUG (MainThread) [custom_components.chime_tts] Removing joined entity_ids: ['media_player.lounge_home_theatre', 'media_player.kitchen_sonos', 'media_player.portable_speaker']
2024-05-22 10:00:03.238 DEBUG (MainThread) [custom_components.chime_tts]    1 Standard media player detected:
2024-05-22 10:00:03.239 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.lounge_home_theatre
2024-05-22 10:00:03.239 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-05-22 10:00:03.239 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-05-22 10:00:03.240 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3
2024-05-22 10:00:03.241 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-05-22 10:00:03.243 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.lounge_home_theatre']
2024-05-22 10:00:03.260 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 6.049s for audio playback to complete...
2024-05-22 10:00:06.430 INFO (SyncWorker_7) [homeassistant.components.doods.image_processing] Saving results image to /media/doods/driveway_latest.jpg
2024-05-22 10:00:09.324 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 3 media_players aren't playing...
2024-05-22 10:00:09.325 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.lounge_home_theatre
2024-05-22 10:00:09.325 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.portable_speaker
2024-05-22 10:00:09.527 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.kitchen_sonos
2024-05-22 10:00:09.527 DEBUG (MainThread) [custom_components.chime_tts]  *** Post-Playback Actions ***
2024-05-22 10:00:09.527 DEBUG (MainThread) [custom_components.chime_tts]    - Calling media_player.unjoin service...
2024-05-22 10:00:09.527 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.unjoin: media_player.lounge_home_theatre
2024-05-22 10:00:11.672 DEBUG (MainThread) [custom_components.chime_tts]     ...done
2024-05-22 10:00:11.672 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.unjoin: media_player.kitchen_sonos
2024-05-22 10:00:13.328 DEBUG (MainThread) [custom_components.chime_tts]     ...done
2024-05-22 10:00:13.328 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.unjoin: media_player.portable_speaker
2024-05-22 10:00:14.322 DEBUG (MainThread) [custom_components.chime_tts]     ...done
2024-05-22 10:00:14.322 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 13.66 s -----
2024-05-22 10:00:26.157 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2024-05-22 10:00:26.158 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2024-05-22 10:00:26.159 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta6 -----
2024-05-22 10:00:26.159 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-22 10:00:26.160 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-22 10:00:26.160 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.lounge_home_theatre']
2024-05-22 10:00:26.160 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_1
2024-05-22 10:00:26.160 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = -500.0
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 500.0
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array = [{'entity_id': 'media_player.lounge_home_theatre', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.6, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}]
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Someone is at the front door.
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = tts.openai_tts_alloy
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-05-22 10:00:26.161 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.6
2024-05-22 10:00:26.162 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-05-22 10:00:26.162 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = True
2024-05-22 10:00:26.162 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-05-22 10:00:26.178 DEBUG (MainThread) [custom_components.chime_tts]    Cached audio found:
2024-05-22 10:00:26.178 DEBUG (MainThread) [custom_components.chime_tts]      - local_path = "/media/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-05-22 10:00:26.179 DEBUG (MainThread) [custom_components.chime_tts]      - audio_duration = 5.549
2024-05-22 10:00:26.179 DEBUG (MainThread) [custom_components.chime_tts]      - public_path = None
2024-05-22 10:00:26.179 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-05-22 10:00:26.179 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-05-22 10:00:26.180 WARNING (MainThread) [custom_components.chime_tts] Unable to join speakers. Only 1 media_player supported.
2024-05-22 10:00:26.180 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-05-22 10:00:26.181 DEBUG (MainThread) [custom_components.chime_tts]    1 Sonos media player detected:
2024-05-22 10:00:26.181 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.lounge_home_theatre
2024-05-22 10:00:26.181 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.lounge_home_theatre', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.6, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-22 10:00:26.182 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-05-22 10:00:26.182 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-05-22 10:00:26.182 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3
2024-05-22 10:00:26.182 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-05-22 10:00:26.182 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.lounge_home_theatre']
2024-05-22 10:00:26.182 DEBUG (MainThread) [custom_components.chime_tts]      - extra: {'volume': 0.6}
2024-05-22 10:00:26.190 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 6.049s for audio playback to complete...
2024-05-22 10:00:32.241 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 1 media_player isn't playing...
2024-05-22 10:00:32.241 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.lounge_home_theatre
2024-05-22 10:00:32.241 DEBUG (MainThread) [custom_components.chime_tts]  *** Post-Playback Actions ***
2024-05-22 10:00:32.242 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 6.08 s -----

How do you use Open Ai for the TTS?