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

I believe this is how to integrate it:

1 Like

Hi,
I am facing the issue using 1.1.0-beta6 version (1.1.0 has the same problem)

Failed to cast media http://192.168.0.2:8123/media/local/sounds/temp/chime_tts/6b_rw1uo.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIwMjBlNzdlYjAzYTE0MmQxYjEwNzcxZTYwNTE3YmQ5NiIsInBhdGgiOiIvbWVkaWEvbG9jYWwvc291bmRzL3RlbXAvY2hpbWVfdHRzLzZiX3J3MXVvLm1wMyIsInBhcmFtcyI6W10sImlhdCI6MTcxNjU1Mzc0MywiZXhwIjoxNzE2NjQwMTQzfQ.QNskD_EAWHr-ZxXPOGpuzY0YQsP8p2gl2tD55avBekk from internal_url (http://192.168.0.2:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

even with

homeassistant:
  internal_url: 'http://192.168.0.2:8123'
  external_url: 'https://my_external_url.net'

Note that external and internal can now be set using the UI in Settings / General / Network

I am trying to cast to a google home device using google_cloud (configured and already used in my setup) tts service

Any piece of advice on how to deal with this problem ?

@jncanches You need the trailing ā€˜/ā€™ on the end of your links.

homeassistant:
  internal_url: 'http://192.168.0.2:8123/'
  external_url: 'https://my_external_url.net/'

Yes, Iā€™m using OpenAI for the TTS, the alloy engine. Itā€™s working fine until I add the Announce.

How exactly do you configure it in Chime TTS:Say? I have the OpenAI TTS integration and can get it to work by other processes.

Will try this. Thnaks

I figured it out.

That makes no difference :sweat_smile:
I wonder what params are used to build the faulty mp3 url
image

The url is http://192.168.0.2:8123/media/local/sounds/temp/chime_tts/1l5msr9p.mp3

http://192.168.0.2:8123 is the internal_url (instead of external one)
/media seems to be the media folder but whatever I set in the ā€œmedia folderā€ it does not change
/local/sounds/temp/chime_tts/ looks like the ā€œFolder path for temporary TTS audio mp3 filesā€ but with a faulty ? /local/ prefix ?

:thinking:

Answering to myself :slight_smile: I changed ā€œFolder path for temporary TTS audio mp3 filesā€ to ā€œ/local/media/ā€¦ā€ and it worked :slight_smile:

2 Likes

Recently I discovered some issue with this integration after using the latest version. It was all working fine on all of my sonos devices but now it doesnā€™t play anything, no chime no message, nothing at all. It seems all fine in the log file, but there is no generated mp3 file on my system.
I had several from the past, deleted them all to see what was happening, but no new files are appearing, Itā€™s driving me and my family nutsā€¦ because I use it for several announcements through the whole house.
This is the log file, hopefully someone can tells me what is wrong

2024-05-31 16:37:51.187 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta8 -----
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.studeerkamer']
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = /config/www/sounds/aankondiging.mp3
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * end_chime_path = /config/www/sounds/bright.mp3
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Dit is het bericht dat ik naar Kasper stuur
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * language = nl
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = google_translate
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-05-31 16:37:51.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.25
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.studeerkamer
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.05
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.25
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-05-31 16:37:51.189 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/config/www/sounds/aankondiging.mp3"...
2024-05-31 16:37:51.293 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 3.345s
2024-05-31 16:37:51.294 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-05-31 16:37:51.294 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'google_translate'
2024-05-31 16:37:51.294 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'Dit is het bericht dat ik naar Kasper stuur'
2024-05-31 16:37:51.294 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-05-31 16:37:51.294 DEBUG (MainThread) [custom_components.chime_tts]     * language = "nl"
2024-05-31 16:37:51.294 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-05-31 16:37:51.720 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 430.0ms
2024-05-31 16:37:51.730 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/config/www/sounds/bright.mp3"...
2024-05-31 16:37:51.831 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 0.637s
2024-05-31 16:37:51.834 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-31 16:37:52.022 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/gifog8tj.mp3
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 7.954
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/media/sounds/temp/chime_tts/gifog8tj.mp3"
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/gifog8tj.mp3"
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-05-31 16:37:52.126 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 1 media player

Hi Kris,

Sorry To hear that youā€™ve been experiencing issues. You are currently running a beta version which is not ready for public release. I am working with a group of Sonos uses and hub to try to address these issues.

I suggest you revert back to the current stable release, v1.0.0:

  1. Open the Chime TTS repository in HACS
  2. Click on the ā‹® button in the top right
  3. Select the ā†» Redownload option
  4. Disable the Show beta versions option (it may take a moment to update the list)
  5. Select version v1.0.0 from the updated version drop-down list
  6. Restart Home Assistant

Hi,

I followed the steps you mentioned, and now everything is working better again, still some issues, but these are fine for the moment. Looking forward to a new stable version with good Sonos support.

Have a great weekend
Kris

Happy Belated Birthday to Chime_TTS! :birthday:

2 Likes

Just ran a few tests on 0.1.0-beta9 on my Sonos Roam.

The good news is, the Announce feature is working when no media is playing on the Sonos. In beta6 there were volume issues but those seem to be resolved.

Testing the Announce feature while media is playing though, still has a volume problem. The chime_tts audio will play over the media as expected, but then the media will increase volume for a couple of seconds before going silent, then playing again at the correct volume.

This is how Iā€™m calling chime_tts:say -

service: chime_tts.say
data:
  message: The cake is a lie.
  chime_path: custom_chime_path_1
  volume_level: 0.6
  tts_platform: tts.openai_tts_alloy
  final_delay: 500
  cache: true
  offset: -500
  announce: true
  join_players: true
  unjoin_players: true
target:
  entity_id: media_player.portable_speaker

Thank you for the feedback @stormshaker.
Could you please also provide me with the debug log messages?

Iā€™ve installed beta11 and did some testing. Good debug messages now, makes it much clearer. So I think what Iā€™m seeing is:

  1. Volume is increased in the Pre-play Actions if current volume is lower (good), but if music is already playing when this happens, it results in about 1-second of loud music before the announcement (bad). I have speakers in most rooms and theyā€™re set at a low volume for background music.
  2. Volume levels should be returned to their previous levels after playback, but speakers stay at the announcement volume (which is loud, the way the announcements should be)
  3. Media should resume after announce (but at the original volume)
  4. Nothing is actually heard if music is playing first. I can only hear announcements if announce: false. I can keep testing when I have a bit more time.

Maybe if the announce volume > current volume, pause media, volume change, announcement, volume return, play media is a better experience?

2024-06-07 09:57:12.939 INFO (MainThread) [homeassistant.components.automation.announce_when_someone_rings_the_doorbell] Announce when someone rings the doorbell: Executing step call service
2024-06-07 09:57:12.940 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-06-07 09:57:13.044 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta11 -----
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.trinas_soundbar
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.garage_sonos
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: media_player.lounge_home_theatre
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 3: media_player.kitchen_sonos
2024-06-07 09:57:13.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_1
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = -500.0
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 500.0
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Someone is at the front door.
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = tts.openai_tts_alloy
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.6
2024-06-07 09:57:13.047 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = True
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.trinas_soundbar
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.6
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.6
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.garage_sonos
2024-06-07 09:57:13.048 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.6
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.6
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.lounge_home_theatre
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.24
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.6
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: True
2024-06-07 09:57:13.049 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-07 09:57:13.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-07 09:57:13.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.kitchen_sonos
2024-06-07 09:57:13.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-07 09:57:13.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.31
2024-06-07 09:57:13.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.6
2024-06-07 09:57:13.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: True
2024-06-07 09:57:13.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-07 09:57:13.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-07 09:57:13.052 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-06-07 09:57:13.055 DEBUG (MainThread) [custom_components.chime_tts]    Cached audio found:
2024-06-07 09:57:13.055 DEBUG (MainThread) [custom_components.chime_tts]      - local_path = "/media/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-06-07 09:57:13.055 DEBUG (MainThread) [custom_components.chime_tts]      - audio_duration = 5.549
2024-06-07 09:57:13.055 DEBUG (MainThread) [custom_components.chime_tts]      - public_path = None
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts] ****************************
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts] ****************************
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.lounge_home_theatre's volume from 0.24 to 0.6
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - volume_level: 0.6
2024-06-07 09:57:13.056 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - entity_id: media_player.lounge_home_theatre
2024-06-07 09:57:14.410 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.kitchen_sonos's volume from 0.31 to 0.6
2024-06-07 09:57:14.410 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-06-07 09:57:14.410 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - volume_level: 0.6
2024-06-07 09:57:14.410 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - entity_id: media_player.kitchen_sonos
2024-06-07 09:57:14.449 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.trinas_soundbar, with 3 group members:
2024-06-07 09:57:14.449 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.garage_sonos
2024-06-07 09:57:14.449 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.lounge_home_theatre
2024-06-07 09:57:14.449 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.kitchen_sonos
2024-06-07 09:57:19.531 DEBUG (MainThread) [custom_components.chime_tts] **************************
2024-06-07 09:57:19.531 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-06-07 09:57:19.531 DEBUG (MainThread) [custom_components.chime_tts] **************************
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]    1 Sonos media player detected:
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.trinas_soundbar
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.trinas_soundbar']
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3
2024-06-07 09:57:19.533 DEBUG (MainThread) [custom_components.chime_tts]      - extra: {'volume': 0.6}
2024-06-07 09:57:19.542 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 6.049s for audio playback to complete...
2024-06-07 09:57:19.921 INFO (MainThread) [homeassistant.components.automation.office_lights_when_motion_is_detected] Office lights when motion is detected: Executing step delay 0:09:30
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 4 media_players aren't playing...
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    āœ” media_player.trinas_soundbar
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    āœ” media_player.garage_sonos
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    āœ” media_player.lounge_home_theatre
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    āœ” media_player.kitchen_sonos
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts] *****************************
2024-06-07 09:57:25.593 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-06-07 09:57:25.594 DEBUG (MainThread) [custom_components.chime_tts] *****************************
2024-06-07 09:57:25.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] The volume level for media_player.lounge_home_theatre is already set to 0.6
2024-06-07 09:57:25.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] The volume level for media_player.kitchen_sonos is already set to 0.6
2024-06-07 09:57:25.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    - Calling media_player.unjoin service...
2024-06-07 09:57:25.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]      - media_player.unjoin 1/4: media_player.garage_sonos
2024-06-07 09:57:27.876 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]      - media_player.unjoin 2/4: media_player.lounge_home_theatre
2024-06-07 09:57:30.087 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]      - media_player.unjoin 3/4: media_player.kitchen_sonos
2024-06-07 09:57:32.276 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]      - media_player.unjoin 4/4: media_player.trinas_soundbar
2024-06-07 09:57:32.379 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 19.33 s -----

Thank you @stormshaker for your feedback!

I have addressed issues #1, #2 & #3 of your last post, but I am not able to test #4.

Could you please upgrade to the new version, v1.1.0-beta12, and let me know if these issues are resolved?

Thanks!

Looks like 1 and 2 and resolved, no more 1-second loud music and the volume is returned back to how it was before playback.

Letā€™s work through 3 a bit more, as it might be me misunderstanding.

When music is playing, and chime_tts:say is called with announce: false, the music is stopped, volume adjusted, announcement played, then volume returned. So the net result is music stopped and announcement delivered. Success :slight_smile: Question: should the speakers be re-joined and music resumed?

If I repeat the same test with announce: true, no announcement is heard. So no chime, no tts message. The music keeps playing throughout, but the ā€˜lounge_home_theatreā€™ speaker was unjoined at the end.

Debug for the second test, with announce:true:

2024-06-08 14:38:04.048 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-06-08 14:38:04.049 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta12 -----
2024-06-08 14:38:04.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-06-08 14:38:04.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-06-08 14:38:04.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.kitchen_sonos
2024-06-08 14:38:04.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.lounge_home_theatre
2024-06-08 14:38:04.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_1
2024-06-08 14:38:04.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-06-08 14:38:04.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = -500.0
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 500.0
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Someone is at the front door.
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = tts.openai_tts_alloy
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-06-08 14:38:04.052 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-06-08 14:38:04.053 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.6
2024-06-08 14:38:04.053 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-06-08 14:38:04.061 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = True
2024-06-08 14:38:04.061 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-06-08 14:38:04.061 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.kitchen_sonos
2024-06-08 14:38:04.061 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-08 14:38:04.061 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.25
2024-06-08 14:38:04.061 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.6
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: True
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.lounge_home_theatre
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.25
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: 0.6
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: True
2024-06-08 14:38:04.062 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-08 14:38:04.063 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-08 14:38:04.063 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts]    Cached audio found:
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts]      - local_path = "/media/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts]      - audio_duration = 5.549
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts]      - public_path = None
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3"
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts] ****************************
2024-06-08 14:38:04.068 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-06-08 14:38:04.069 DEBUG (MainThread) [custom_components.chime_tts] ****************************
2024-06-08 14:38:04.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.kitchen_sonos, with 1 group member:
2024-06-08 14:38:04.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.lounge_home_theatre
2024-06-08 14:38:04.072 DEBUG (MainThread) [custom_components.chime_tts] **************************
2024-06-08 14:38:04.073 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-06-08 14:38:04.073 DEBUG (MainThread) [custom_components.chime_tts] **************************
2024-06-08 14:38:04.074 DEBUG (MainThread) [custom_components.chime_tts]    1 Sonos media player detected:
2024-06-08 14:38:04.074 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.kitchen_sonos
2024-06-08 14:38:04.074 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-06-08 14:38:04.074 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.kitchen_sonos']
2024-06-08 14:38:04.074 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-06-08 14:38:04.075 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-06-08 14:38:04.075 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/7h72jo4y.mp3
2024-06-08 14:38:04.075 DEBUG (MainThread) [custom_components.chime_tts]      - extra: {'volume': 0.6}
2024-06-08 14:38:04.096 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 6.049s for audio playback to complete...
2024-06-08 14:38:10.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 2 media_players aren't playing...
2024-06-08 14:38:13.862 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    š˜… media_player.kitchen_sonos - Timed out. Current state: playing
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    š˜… media_player.lounge_home_theatre - Timed out. Current state: playing
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts]  - Timed out waiting for playback to complete
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts] *****************************
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts] *****************************
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    - Calling media_player.unjoin service...
2024-06-08 14:38:13.863 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]      - media_player.unjoin 1/2: media_player.lounge_home_theatre
2024-06-08 14:38:23.905 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]      - media_player.unjoin 2/2: media_player.kitchen_sonos
2024-06-08 14:38:24.011 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 19.96 s -----

Iā€™m glad to hear the first two issues are resolved.

Regarding issue #3 (music playback is not restored when announce is set to true), I think I understand it differently to you (perhaps Iā€™m the one who misunderstands?):

  • When announce is true it, audio notifications should be played with the currently playing music
  • When announce is false, the currently playing music should be replaced by the audio notification.

So my question is ultimately what is the difference between using announce and not using it? Happy to hear your and othersā€™ thoughts.


Regarding the missing playback when you have announce set to true:

  • Clearly Chime TTS is able to trigger playback (when announce is false) so its another issue.
  • However I see nothing in your debug log messages which indicates what the issue could be, as it all seems correct (besides the messages regarding waiting for the media_players to stop playing - which is a minor bug iā€™ve already fixed for the next version).
  • Can you try the same service call, but set the join_players / unjoin_players parameters to false?

Hi,
need your help!
Not able to complete the configuration.


I suppose it is due to the location of media that is not in the same location of home assistant, but I donā€™t know how to set it.