nimroddolev / chime_tts

A custom Home Assistant integration to play combined audio files before and/or after text-to-speech (TTS) messages
https://nimroddolev.github.io/chime_tts/
MIT License
179 stars 13 forks source link

Issues playing on Sonos speakers with 1.1.0b4 #121

Closed dimatx closed 3 months ago

dimatx commented 5 months ago

System Health details

System Information

version core-2024.4.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.25-haos
arch x86_64
timezone America/New_York
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4686 Installed Version | 1.34.0 Stage | running Available Repositories | 1475 Downloaded Repositories | 53
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | July 31, 2024 at 8:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | true remote_server | us-east-1-2.ui.nabu.casa certificate_status | ready instance_id | 4d1962f7fd7c473ca4ec4547c83362bf can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.2 -- | -- update_channel | stable supervisor_version | supervisor-2024.04.0 agent_version | 1.6.0 docker_version | 25.0.5 disk_total | 30.8 GB disk_used | 11.7 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Studio Code Server (5.15.0), Terminal & SSH (9.13.0), Duck DNS (1.16.0), AppDaemon (0.16.4), Advanced SSH & Web Terminal (17.2.0), Home Assistant Google Drive Backup (0.112.1), InfluxDB (5.0.0), Victoria Metrics Agent add-on (1.8.19.9), Syncthing (1.19.0)
Dashboards dashboards | 9 -- | -- resources | 19 views | 50 mode | storage
Recorder oldest_recorder_run | April 11, 2024 at 3:24 PM -- | -- current_recorder_run | April 19, 2024 at 12:47 PM database_engine | mysql database_version | 10.8.8

Checklist

Describe the issue

Trying to 1.1.0b4 to see if https://github.com/nimroddolev/chime_tts/issues/113 addressed by echo/out of sync issues, but seeing some issues with playing on my Sonos speakers. Whether I group or not, or use announce or not, the audio plays on just one speaker, but three times instead of once. It doesn't play at all on the other speaker.

Reproduction steps

  1. Create and run Chime TTS Say using the following config:
service: chime_tts.say
metadata: {}
data:
  chime_path: custom_chime_path_1
  message: This is a test message.
  tts_platform: microsoft
  cache: true
  announce: true
  join_players: true
  unjoin_players: true
target:
  entity_id:
    - media_player.kitchen_sonos
    - media_player.his_office_sonos
  1. The output plays three times on one speaker, and doesn't play at all on the second speaker.

Debug logs

2024-04-19 13:12:42.528 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta4 -----
2024-04-19 13:12:42.529 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.kitchen_sonos
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.his_office_sonos
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_1
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-04-19 13:12:42.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: {'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-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: {'entity_id': 'media_player.his_office_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-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = This is a test message.
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = microsoft
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-04-19 13:12:42.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-04-19 13:12:42.536 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-04-19 13:12:42.542 DEBUG (MainThread) [custom_components.chime_tts]    ...no cached audio found
2024-04-19 13:12:42.542 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/config/www/sound/zapsplat_household_doorbell_chime_bell_001_73122.mp3"...
2024-04-19 13:12:42.719 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.513s
2024-04-19 13:12:42.720 DEBUG (MainThread) [custom_components.chime_tts]  - Attempting to retrieve TTS audio from cache...
2024-04-19 13:12:42.729 DEBUG (MainThread) [custom_components.chime_tts]    ...no cached TTS audio found
2024-04-19 13:12:42.729 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-04-19 13:12:42.730 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'microsoft'
2024-04-19 13:12:42.730 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'This is a test message.'
2024-04-19 13:12:42.730 DEBUG (MainThread) [custom_components.chime_tts]     * cache = True
2024-04-19 13:12:42.730 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-04-19 13:12:42.730 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-04-19 13:12:43.301 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 570.0ms
2024-04-19 13:12:43.301 DEBUG (MainThread) [custom_components.chime_tts]  - Saving generated TTS audio to cache...
2024-04-19 13:12:43.476 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem]  - File saved to path: /media/sounds/temp/chime_tts/b0ooi54a.mp3
2024-04-19 13:12:43.476 DEBUG (MainThread) [custom_components.chime_tts]  - Saving data to chime_tts storage:
2024-04-19 13:12:43.476 DEBUG (MainThread) [custom_components.chime_tts]    - key:   "c30da12e265e4c0405246fd77c298aee34f168672af0f2ac58cd869aaf025577"
2024-04-19 13:12:43.476 DEBUG (MainThread) [custom_components.chime_tts]    - value: "{'local_path': '/media/sounds/temp/chime_tts/b0ooi54a.mp3', 'audio_duration': 2.424}"
2024-04-19 13:12:43.505 DEBUG (MainThread) [custom_components.chime_tts]   ...TTS audio saved to cache
2024-04-19 13:12:43.522 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-04-19 13:12:43.800 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem]  - File saved to path: /media/sounds/temp/chime_tts/5quqv0at.mp3
2024-04-19 13:12:43.993 DEBUG (MainThread) [custom_components.chime_tts]  - Saving data to chime_tts storage:
2024-04-19 13:12:43.993 DEBUG (MainThread) [custom_components.chime_tts]    - key:   "1ebbd34f8db06341bdcffeb392ab9b592aabe9ef615ea5c90e17630ca1b7fc95"
2024-04-19 13:12:43.993 DEBUG (MainThread) [custom_components.chime_tts]    - value: "{'local_path': '/media/sounds/temp/chime_tts/5quqv0at.mp3', 'audio_duration': 5.387}"
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]    - audio_duration = 5.387
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]    - local_path = "/media/sounds/temp/chime_tts/5quqv0at.mp3"
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]    - public_path = None
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]    - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/5quqv0at.mp3"
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-04-19 13:12:43.996 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-04-19 13:12:44.007 DEBUG (MainThread) [custom_components.chime_tts]    2 Sonos media players detected:
2024-04-19 13:12:44.008 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.kitchen_sonos
2024-04-19 13:12:44.008 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-04-19 13:12:44.008 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.his_office_sonos
2024-04-19 13:12:44.008 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.his_office_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-04-19 13:12:44.008 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-04-19 13:12:44.008 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-04-19 13:12:44.008 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/5quqv0at.mp3
2024-04-19 13:12:44.009 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-04-19 13:12:44.009 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.his_office_sonos']
2024-04-19 13:12:44.016 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-04-19 13:12:44.016 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-04-19 13:12:44.016 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/5quqv0at.mp3
2024-04-19 13:12:44.016 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-04-19 13:12:44.016 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.his_office_sonos']
2024-04-19 13:12:44.021 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-04-19 13:12:44.021 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-04-19 13:12:44.021 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/5quqv0at.mp3
2024-04-19 13:12:44.021 DEBUG (MainThread) [custom_components.chime_tts]      - announce: True
2024-04-19 13:12:44.021 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.his_office_sonos']
2024-04-19 13:12:44.024 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 5.387s for audio playback to complete...
2024-04-19 13:12:49.415 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 2 media_players aren't playing...
2024-04-19 13:12:49.415 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.kitchen_sonos
2024-04-19 13:12:49.617 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.his_office_sonos
2024-04-19 13:12:49.617 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 7.09 s -----

Diagnostics dump

No response

Legrand5382 commented 5 months ago

Pretty much the same issue also with my 2 Sonos speaker, if I touch the volume then no tts, the volume lower and come back correctly but no speaking, if I don’t touch the volume option then tts will speak correctly but it’s not loud enough.

serotonie commented 5 months ago

Same issue here. It works correctly if announce=False but don't resume the playback, what is pretty annoying :)

dimatx commented 5 months ago

I can't get it to work irrespective of the announce parameter or the volume. Reverted back to stable for now.

HA-TB303 commented 5 months ago

I do have tts, but at a substantial lower volume, almost inaudible. The loud music after the tts is resolved with beta 4.

  - service: chime_tts.say
    target:
      entity_id:
        - media_player.keuken
        - media_player.woonkamer
        - media_player.kantoor
    data:
      tts_playback_speed: 110
      volume_level: 0.5
      message: bla bla
      tts_platform: cloud
      join_players: true
      unjoin_players: true
      announce: true
Flight777 commented 4 months ago

Can confirm same issue, as soon as I put announce on false it works again...

dimatx commented 4 months ago

Curious if others on this thread actually have a Sonos working flawlessly with stable versions. I find that speakers frequently are out of sync with each other. As a band aid, I found that playing a silent clip as a separate service call before the actual announcement, and then calling the service for the actual announcement does help, but it's not rock solid.

nimroddolev commented 4 months ago

Hi everyone.

Thank you all for posting about the issues you've experienced with the joined speakers, Sonos in particular.

I have been working on these issues, but as I don't own any Sonos or other speakers that support being joined, I have been unable to verify the fix - so I ask for your patience and understanding if it might take a bit more back and forth until I can get it right.

I just released a new beta version, v1.1.0-beta5, which I hope addresses these issues.

I would be very appreciative if you could please upgrade to the new version and let me know what your experiences are. When reporting back, please include debug log messages so that I might better understand where the issue/s occur.

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
dimatx commented 4 months ago

Hey @nimroddolev - Appreciate your efforts to get this fixed despite not having test devices. Happy to help as much as I can.

So, Beta 5 is definitely a step in the right direction. Here's what I'm seeing... The audio plays, and is in sync :) However, it appear that it will play at whatever volume the speakers are already at. The volume adjustment does not seem to apply.

There's also a service call timeout error that throws, but functionality does not seem impeded.

Happy to test with other inputs if desired.

My call

service: chime_tts.say
data:
  delay: 300
  final_delay: 100
  volume_level: 0.35
  message: This is a test message. Will the message play in sync???
  tts_platform: microsoft
  chime_path: custom_chime_path_5
  cache: false
  announce: false
  join_players: true
target:
  entity_id:
    - media_player.bedroom_sonos
    - media_player.kitchen_sonos
    - media_player.his_office_sonos
    - media_player.her_office_sonos
    - media_player.gym_sonos
enabled: true
alias: Microsoft TTS

DEBUG log

2024-05-09 15:36:03.937 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta5 -----
2024-05-09 15:36:03.937 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-09 15:36:03.944 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-09 15:36:03.944 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.kitchen_sonos
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.bedroom_sonos
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: media_player.his_office_sonos
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 3: media_player.her_office_sonos
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 4: media_player.gym_sonos
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_5
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 300.0
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 100.0
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: {'entity_id': 'media_player.kitchen_sonos', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.28, 'playback_volume_level': 0.35, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: {'entity_id': 'media_player.bedroom_sonos', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.29, 'playback_volume_level': 0.35, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: {'entity_id': 'media_player.his_office_sonos', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.31, 'playback_volume_level': 0.35, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 3: {'entity_id': 'media_player.her_office_sonos', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.3, 'playback_volume_level': 0.35, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 4: {'entity_id': 'media_player.gym_sonos', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.3, 'playback_volume_level': 0.35, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = This is a test message. Will the message play in sync???
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = microsoft
2024-05-09 15:36:03.945 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-05-09 15:36:03.946 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-05-09 15:36:03.946 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-05-09 15:36:03.946 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-05-09 15:36:03.946 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.35
2024-05-09 15:36:03.946 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-05-09 15:36:03.946 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-05-09 15:36:03.949 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/config/www/sound/new-notification-on-your-device-138695.mp3"...
2024-05-09 15:36:04.130 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 3.527s
2024-05-09 15:36:04.131 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-05-09 15:36:04.131 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'microsoft'
2024-05-09 15:36:04.131 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'This is a test message. Will the message play in sync???'
2024-05-09 15:36:04.131 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-05-09 15:36:04.131 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-05-09 15:36:04.131 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-05-09 15:36:04.729 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 600.0ms
2024-05-09 15:36:04.747 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-09 15:36:05.085 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem]  - File saved to path: /media/sounds/temp/chime_tts/ktfq7bc5.mp3
2024-05-09 15:36:05.257 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-05-09 15:36:05.257 DEBUG (MainThread) [custom_components.chime_tts]    - audio_duration = 8.626
2024-05-09 15:36:05.257 DEBUG (MainThread) [custom_components.chime_tts]    - local_path = "/media/sounds/temp/chime_tts/ktfq7bc5.mp3"
2024-05-09 15:36:05.257 DEBUG (MainThread) [custom_components.chime_tts]    - public_path = None
2024-05-09 15:36:05.257 DEBUG (MainThread) [custom_components.chime_tts]    - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/ktfq7bc5.mp3"
2024-05-09 15:36:05.257 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    - Calling media_player.join service for 5 media_player entities...
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    - Joining 5 media_player entities:
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      - media_player.kitchen_sonos
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      - media_player.bedroom_sonos
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      - media_player.his_office_sonos
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      - media_player.her_office_sonos
2024-05-09 15:36:05.270 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      - media_player.gym_sonos
2024-05-09 15:36:05.285 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]      ...done
2024-05-09 15:36:05.287 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-05-09 15:36:05.299 DEBUG (MainThread) [custom_components.chime_tts] Removing joined entity_ids: ['media_player.kitchen_sonos', 'media_player.bedroom_sonos', 'media_player.his_office_sonos', 'media_player.her_office_sonos', 'media_player.gym_sonos']
2024-05-09 15:36:05.300 DEBUG (MainThread) [custom_components.chime_tts]    1 Standard media player detected:
2024-05-09 15:36:05.300 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.kitchen_sonos
2024-05-09 15:36:05.300 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-05-09 15:36:05.300 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-05-09 15:36:05.300 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/ktfq7bc5.mp3
2024-05-09 15:36:05.300 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.kitchen_sonos']
2024-05-09 15:36:05.301 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 8.726s for audio playback to complete...
2024-05-09 15:36:13.938 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Service call timed out
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 119, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: Service call timed out
2024-05-09 15:36:13.939 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140232673914944] Error handling message: Unknown error (unknown_error) Dima from 192.168.7.103 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 119, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: Service call timed out
nimroddolev commented 4 months ago

Thanks @dimatx for your assistance and the debug log messages 👍

The volume adjustment does not seem to apply

I believe I isolated the volume issue and I released a new beta version with a potential fix, v1.1.0-beta6. Can you please install the new beta and let me know if there's any improvement?

There's also a service call timeout error that throws, but functionality does not seem impeded.

I reviewed the changes over the last couple release and I can't see a likely cause for this issue.

dimatx commented 4 months ago

Thanks @nimroddolev for your diligence with getting this resolved. I will do some testing this weekend, but upon a quick test it does seem there are still issues with setting the volume, but I need to systematically test to give you actionable input as it seemed to have worked sometimes but not every time. At first I thought it was only working when join and unjoin are both true, but then it worked with just join, so I am not sure anymore.

I also found that while b5 and b6 work well with 'announce: false', when 'announce: true', I hear music playing from some but not all speakers.

I'll collect more logs over the weekend and share.

Also, I still get that 'error' after each call, happens each time without exception, but I can't tell any adverse impact to report.

Would be curious to hear from others just to make sure it's not just me.

HA-TB303 commented 4 months ago

I don't know if this will help much:

Beta 1.1.0-beta5

service: chime_tts.say
data:
  message: Dit is een test
  volume_level: 0.3
  chime_path: chirp
  join_players: true
  unjoin_players: true
  announce: false
target:
  entity_id:
    - media_player.kantoor
    - media_player.woonkamer
    - media_player.keuken

Plays on all 3 speakers, but silences music and music does not continue

service: chime_tts.say
data:
  message: Dit is een test
  volume_level: 0.3
  chime_path: chirp
  join_players: true
  unjoin_players: true
  announce: true
target:
  entity_id:
    - media_player.kantoor
    - media_player.woonkamer
    - media_player.keuken

Plays on media_player.keuken only, silences music and music does not continue

If I can test anything else, let me know.

nimroddolev commented 4 months ago

It might also be useful if you could please provide me with the YAML for how you regularly use TTS with your Sonos media players. It's possible i've made some incorrect assumptions early on.

HA-TB303 commented 4 months ago

What yaml do you need?

Automation:

alias: Mailbox notification
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.brievenbus_legen
    from: "off"
    to: "on"
condition: []
action:
  - service: chime_tts.say
    metadata: {}
    data:
      volume_level: 0.35
      chime_path: bells_2
      message: Mail has been delivered.
      tts_platform: cloud
      announce: true
      join_players: true
      unjoin_players: true
      cache: true
    target:
      entity_id:
        - media_player.kantoor
        - media_player.keuken
        - media_player.woonkamer
mode: single
initial_state: true

When I launch this with Chime TTS v1.0.0 it only plays on:

The tts is properly announced on the speakers, but the music level goes very loud right after the tts and then returns to normal.

If I do exactly the same with Chime TTS v1.1.0-beta6 it only plays on:

The music goes loud just a fraction of a second BEFORE the tts, the TTS is properly announced but thereafter the music does NOT return.

HA-TB303 commented 4 months ago

I think the tts issue with the SONOS ERA 100 seems unrelated to Chime tts as that does not work with normal tts either. Probably yet another Sonos bug.

The rest seems to be Chime TTS related.

nimroddolev commented 4 months ago

Thanks @HA-TB303, could you also please provide me with the debug log messages for the associated service calls to chime_tts.say? Also - could you share with me any automations/scripts you might have where you have successfully joined speakers together and paused/resumed music?

HA-TB303 commented 4 months ago

I do not have any automations to join speakers. I use Chime TTS for that.

How to I debug log service calls? I was unable to find any information about it. In the regular logs there is no relevant information.

nimroddolev commented 4 months ago

Apologies, I forgot to include the steps to enable debug logging:

  1. Turn on debug logging for Chime TTS:

    service: logger.set_level
    data:
     custom_components.chime_tts: debug
  2. Call the chime_tts.say service again.

  3. Check your log messages in Home Assistant:

    https://{YOUR_HOME_ASSISTANT_ADDRESS}:8123/config/logs?filter=chime_tts

    and click LOAD FULL LOGS

HA-TB303 commented 4 months ago

Ok, I'll make a log hereafter.

Fot now I have testd this:

alias: Test Sonos Join/unjoin
description: ""
trigger: []
condition: []
action:
  - service: media_player.join
    metadata: {}
    data:
      group_members:
        - media_player.keuken
    target:
      entity_id:
        - media_player.woonkamer
  - service: media_player.play_media
    metadata: {}
    data:
      announce: true
      media_content_type: music
      media_content_id: media-source://tts/cloud?message="Dit is een test"
    target:
      entity_id: media_player.woonkamer
  - service: media_player.unjoin
    metadata: {}
    data: {}
    target:
      entity_id: media_player.woonkamer
mode: single

With really funky results:

It mutes the music media_player.woonkamer, plays tts only on media_player.woonkamer and then resumes music on media_player.keuken.

This buggy Sonos stuff really starts to piss me off. Spends thousands on a proper multiroom setup and it works like crap. Not anybodies fault, but extremely annoying... :(

HA-TB303 commented 4 months ago

ran:

service: chime_tts.say
data:
  message: Dit is een test
  volume_level: 0.3
  chime_path: chirp
  join_players: true
  unjoin_players: true
  announce: true
target:
  entity_id:
    - media_player.kantoor
    - media_player.woonkamer
    - media_player.keuken
2024-05-12 13:07:49.005 WARNING (SyncWorker_0) [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-12 13:56:12.065 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta6 -----
2024-05-12 13:56:12.065 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.keuken
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.woonkamer
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: media_player.kantoor
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = chirp
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: {'entity_id': 'media_player.keuken', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.32, 'playback_volume_level': 0.3, 'group_members_supported': True, 'announce_supported': True, 'is_playing': True}
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: {'entity_id': 'media_player.woonkamer', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.2, 'playback_volume_level': 0.3, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: {'entity_id': 'media_player.kantoor', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.3, 'playback_volume_level': 0.3, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Dit is een test
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = True
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.3
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = True
2024-05-12 13:56:12.069 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = True
2024-05-12 13:56:12.070 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /config/custom_components/chime_tts/mp3s/chirp.mp3
2024-05-12 13:56:12.070 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/custom_components/chime_tts/mp3s/chirp.mp3"...
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 0.395s
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - No `tts_platform` parameter provided. Using 'edge_tts'
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'edge_tts'
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Dit is een test'
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-05-12 13:56:12.153 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-05-12 13:56:12.234 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 80.0ms
2024-05-12 13:56:12.240 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-12 13:56:12.332 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/d_dfbsdv.mp3
2024-05-12 13:56:12.418 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-05-12 13:56:12.418 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 3.125
2024-05-12 13:56:12.418 DEBUG (MainThread) [custom_components.chime_tts] * local_path = "/media/sounds/temp/chime_tts/d_dfbsdv.mp3"
2024-05-12 13:56:12.418 DEBUG (MainThread) [custom_components.chime_tts] * public_path = None
2024-05-12 13:56:12.418 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/d_dfbsdv.mp3"
2024-05-12 13:56:12.418 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-05-12 13:56:12.420 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Decresing media_player.keuken's volume from 0.32 to 0.3
2024-05-12 13:56:12.435 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Increasing media_player.woonkamer's volume from 0.2 to 0.3
2024-05-12 13:56:12.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Calling media_player.join service for 3 media_player entities...
2024-05-12 13:56:12.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Joining 3 media_player entities:
2024-05-12 13:56:12.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - media_player.keuken
2024-05-12 13:56:12.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - media_player.woonkamer
2024-05-12 13:56:12.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - media_player.kantoor
2024-05-12 13:56:14.023 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ...done
2024-05-12 13:56:14.025 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] Removing joined entity_ids: ['media_player.keuken', 'media_player.woonkamer', 'media_player.kantoor']
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] 1 Standard media player detected:
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] - media_player.keuken
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/d_dfbsdv.mp3
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
2024-05-12 13:56:14.029 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.keuken']
2024-05-12 13:56:14.032 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 3.125s for audio playback to complete...
2024-05-12 13:56:17.159 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 3 media_players aren't playing...
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] 𝘅 media_player.keuken - Timed out
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] 𝘅 media_player.woonkamer - Timed out
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] 𝘅 media_player.kantoor - Timed out
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts] - Timed out waiting for playback to complete
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts] - Calling media_player.unjoin service...
2024-05-12 13:56:20.767 DEBUG (MainThread) [custom_components.chime_tts] - media_player.unjoin: media_player.keuken
2024-05-12 13:56:22.871 DEBUG (MainThread) [custom_components.chime_tts] ...done
2024-05-12 13:56:22.871 DEBUG (MainThread) [custom_components.chime_tts] - media_player.unjoin: media_player.woonkamer
2024-05-12 13:56:27.382 DEBUG (MainThread) [custom_components.chime_tts] ...done
2024-05-12 13:56:27.382 DEBUG (MainThread) [custom_components.chime_tts] - media_player.unjoin: media_player.kantoor
2024-05-12 13:56:27.838 DEBUG (MainThread) [custom_components.chime_tts] ...done
2024-05-12 13:56:27.839 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 15.77 s -----
nimroddolev commented 4 months ago

Thank you for the debug logs.

Could you also please tell me what ended up happening? Based on the logs it looks like:

HA-TB303 commented 4 months ago

OK,

media_player.woonkamer (a sonos arc) is playing a radio stream. I then fire:

service: chime_tts.say
data:
  message: "Dit is een test"
  volume_level: 0.4
  chime_path: chirp
  join_players: true
  unjoin_players: true
  announce: true
target:
  entity_id:
    - media_player.kantoor
    - media_player.woonkamer
    - media_player.keuken

What happens then:

  1. The radio stream turns loud, just before the chirp sound
  2. Radio stream goes silent.
  3. Chirp sound is played on the media_player.keuken only
  4. tts is announced on the media_player.keuken only
  5. Radio stream does not turn back on.
HA-TB303 commented 4 months ago

This all worked pretty well on version 1.0.0, just the radio stream turned loud for a short moment just after tts, and then turned back to normal.

It's the beta's that broke it completely.

nimroddolev commented 4 months ago

Hi @HA-TB303,

Please remember that I do not own any Sonos hardware, so in order for me to work on these issues I require both the debug log messages as well as a description of what actually happened.

HA-TB303 commented 4 months ago

Ok, will do next time. The above scenario is the exact same as the log (https://github.com/nimroddolev/chime_tts/issues/121#issuecomment-2106221777) above that. If there is anything else I can test, please let me now.

nimroddolev commented 4 months ago

Thanks you 👍

I think the issue is that when using announce the volume adjustment for Sonos is meant to be done automatically, which is what I implemented previously, however now it is done manually before playing the Chime TTS audio.

Could you please check if using the fade_audio parameter instead of announce makes a difference?

HA-TB303 commented 4 months ago

Hi, sure, but I'm not sure how to try this.

nimroddolev commented 4 months ago

You can use the following YAML:

service: chime_tts.say
data:
  message: "Dit is een test"
  volume_level: 0.4
  chime_path: chirp
  join_players: true
  unjoin_players: true
  fade_audio: true
target:
  entity_id:
    - media_player.kantoor
    - media_player.woonkamer
    - media_player.keuken
HA-TB303 commented 4 months ago

Just did the test. The results are extremely bizar....

  1. Music (radio stream) playing in media_player.woonkamer only.
  2. I launch the service call below
    service: chime_tts.say
    data:
    message: "Dit is een test"
    volume_level: 0.4
    chime_path: chirp
    join_players: true
    unjoin_players: true
    fade_audio: true
    target:
    entity_id:
    - media_player.kantoor
    - media_player.woonkamer
    - media_player.keuken
  3. Music stopped
  4. I hear the chrip sound on media_player.keuken first
  5. I hear the TTS on media_player.keuken
  6. I Hear a chrip sound again on the media_player.keuken
  7. I hear the TTS on media_player.woonkamer
  8. a few seconds later....
  9. I hear a chirp sound on the media_player.kantoor
  10. I hear the TTS on the media_player.kantoor

Music does not continue

2024-05-13 18:13:29.412 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta6 -----
2024-05-13 18:13:29.412 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.keuken
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.woonkamer
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: media_player.kantoor
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = chirp
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: {'entity_id': 'media_player.keuken', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.4, 'playback_volume_level': 0.4, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: {'entity_id': 'media_player.woonkamer', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.2, 'playback_volume_level': 0.4, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: {'entity_id': 'media_player.kantoor', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.4, 'playback_volume_level': 0.4, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Dit is een test
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = True
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.4
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = True
2024-05-13 18:13:29.416 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = True
2024-05-13 18:13:29.417 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /config/custom_components/chime_tts/mp3s/chirp.mp3
2024-05-13 18:13:29.417 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/custom_components/chime_tts/mp3s/chirp.mp3"...
2024-05-13 18:13:29.497 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 0.395s
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - No `tts_platform` parameter provided. Using 'edge_tts'
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'edge_tts'
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Dit is een test'
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-05-13 18:13:29.498 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-05-13 18:13:29.579 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 80.0ms
2024-05-13 18:13:29.585 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-13 18:13:29.672 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/k37btgxj.mp3
2024-05-13 18:13:29.755 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-05-13 18:13:29.755 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 3.125
2024-05-13 18:13:29.755 DEBUG (MainThread) [custom_components.chime_tts] * local_path = "/media/sounds/temp/chime_tts/k37btgxj.mp3"
2024-05-13 18:13:29.755 DEBUG (MainThread) [custom_components.chime_tts] * public_path = None
2024-05-13 18:13:29.755 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/k37btgxj.mp3"
2024-05-13 18:13:29.755 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-05-13 18:13:29.757 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Increasing media_player.woonkamer's volume from 0.2 to 0.4
2024-05-13 18:13:29.769 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Calling media_player.join service for 3 media_player entities...
2024-05-13 18:13:29.769 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Joining 3 media_player entities:
2024-05-13 18:13:29.769 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - media_player.keuken
2024-05-13 18:13:29.769 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - media_player.woonkamer
2024-05-13 18:13:29.769 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - media_player.kantoor
2024-05-13 18:13:31.014 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ...done
2024-05-13 18:13:31.016 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] Removing joined entity_ids: ['media_player.keuken', 'media_player.woonkamer', 'media_player.kantoor']
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] 1 Standard media player detected:
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] - media_player.keuken
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/k37btgxj.mp3
2024-05-13 18:13:31.019 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.keuken']
2024-05-13 18:13:31.021 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 3.125s for audio playback to complete...
2024-05-13 18:13:34.150 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 3 media_players aren't playing...
2024-05-13 18:13:34.751 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.keuken
2024-05-13 18:13:34.751 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.kantoor
2024-05-13 18:13:34.952 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.woonkamer
2024-05-13 18:13:34.952 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-05-13 18:13:34.952 DEBUG (MainThread) [custom_components.chime_tts] - Calling media_player.unjoin service...
2024-05-13 18:13:34.952 DEBUG (MainThread) [custom_components.chime_tts] - media_player.unjoin: media_player.keuken
2024-05-13 18:13:36.416 DEBUG (MainThread) [custom_components.chime_tts] ...done
2024-05-13 18:13:36.416 DEBUG (MainThread) [custom_components.chime_tts] - media_player.unjoin: media_player.woonkamer
2024-05-13 18:13:38.099 DEBUG (MainThread) [custom_components.chime_tts] ...done
2024-05-13 18:13:38.099 DEBUG (MainThread) [custom_components.chime_tts] - media_player.unjoin: media_player.kantoor
2024-05-13 18:13:39.312 DEBUG (MainThread) [custom_components.chime_tts] ...done
2024-05-13 18:13:39.313 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 9.9 s -----
nurse-curtis commented 4 months ago

I can confirm that I have been using v1.0.0 of Chime_tts with 3 Sonos speakers in a stereo pair and single (the rebranded Ikea Symfonisk ones) for a while and it's been quite reliable. I just tried out the latest beta version today before I read this but I couldn't get any output on my speakers so I reverted back to v1.0.0.

I'll play around with the beta and report back, but wanted to "chime" in to at least report that it had been working great with Sonos and I'm happy to help to get this working if I can.

nurse-curtis commented 4 months ago

I'm not sure if this is helpful, but I can certainly take requests. I hope this is a Sonos-releated bug.

service: chime_tts.say
target:
  entity_id:
    - media_player.downstairs_sonos
    - media_player.upstairs_sonos
data:
  chime_path: bells
  message: Testing
  announce: true
  tts_platform: tts.piper
  join_players: false
  unjoin_players: false
  offset: 0
  final_delay: 0

Before chime_tts:

Call chime_tts.say with above parameters:

chime_tts-1.log

service: chime_tts.say
target:
  entity_id:
    - media_player.downstairs_sonos
    - media_player.upstairs_sonos
data:
  chime_path: bells
  message: Testing
  announce: true
  tts_platform: tts.piper
  join_players: true
  unjoin_players: true
  offset: 0
  final_delay: 0

Before chime_tts:

Call chime_tts.say with above parameters:

chime_tts-2.log

nurse-curtis commented 4 months ago

I tried to replicate the first result I got and this time it is different.

service: chime_tts.say
target:
  entity_id:
    - media_player.downstairs_sonos
    - media_player.upstairs_sonos
data:
  chime_path: bells
  message: Testing
  announce: true
  tts_platform: tts.piper
  join_players: false
  unjoin_players: false
  offset: 0
  final_delay: 0

Before chime_tts:

music playing on 'downstairs_sonos' nothing playing on 'upstairs_sonos'

Call chime_tts.say with above parameters:

chime_tts-3.log

nurse-curtis commented 4 months ago

With volume change.

service: chime_tts.say
target:
  entity_id:
    - media_player.downstairs_sonos
    - media_player.upstairs_sonos
data:
  chime_path: bells
  message: Testing
  announce: true
  tts_platform: tts.piper
  join_players: false
  unjoin_players: false
  offset: 0
  final_delay: 0
  volume_level: 0.4

Before chime_tts:

music playing on 'downstairs_sonos' nothing playing on 'upstairs_sonos'

Call chime_tts.say with above parameters:

chime_tts-4.log

HA-TB303 commented 4 months ago

@nimroddolev anything else we can do to help resolve the issue?

nimroddolev commented 4 months ago

Hi everyone. Thank you for your patience, I haven't been able to spend as much time as I would have wanted to work on the integration over the past few weeks.

I am again grateful for your assistance with testing a new version, v1.1.0-beta7. This new beta includes some code rewrites which make use of the Sonos snapshot feature.

I would appreciate your feedback regarding how the new version performs.

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-beta7 from the updated version drop-down list
  6. Restart Home Assistant
sven-pb commented 4 months ago

Many thanks for all the time invested!

With this Update, the say service won't play on my Symfonisk ("Sonos by IKEA') speaker anymore. The entity just disappears in the logs:

Same behaviour is observed when just playing on Symfonisk, the logs then just display no entity (entity_id: [ ]). On chormecast it works perfectly.

In beta7,

2024-05-30 00:28:39.788 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-30 00:28:39.788 DEBUG (MainThread) [custom_components.chime_tts] 2 media players detected:
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] - media_player.loft_tv
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] - media_player.living_room
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.loft_tv']

compare to same action in v1.0.0:

2024-05-30 00:32:38.869 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-30 00:32:38.869 DEBUG (MainThread) [custom_components.chime_tts] 2 Standard media players detected:
2024-05-30 00:32:38.870 DEBUG (MainThread) [custom_components.chime_tts] - media_player.loft_tv
2024-05-30 00:32:38.870 DEBUG (MainThread) [custom_components.chime_tts] - media_player.living_room
2024-05-30 00:32:38.870 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-30 00:32:38.870 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-30 00:32:38.870 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/peluxtxn.mp3
2024-05-30 00:32:38.870 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.loft_tv', 'media_player.living_room']

Full log of calling service in beta7

2024-05-30 00:28:37.312 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-30 00:28:37.316 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta7 -----
2024-05-30 00:28:37.317 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-30 00:28:37.317 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-05-30 00:28:37.317 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.loft_tv
2024-05-30 00:28:37.317 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.living_room
2024-05-30 00:28:37.318 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = ba_dum_tss
2024-05-30 00:28:37.318 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * end_chime_path = bells
2024-05-30 00:28:37.318 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-05-30 00:28:37.318 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-05-30 00:28:37.318 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-05-30 00:28:37.319 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = test message to be announced
2024-05-30 00:28:37.319 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = tts.piper
2024-05-30 00:28:37.319 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-05-30 00:28:37.319 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-05-30 00:28:37.319 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-05-30 00:28:37.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-05-30 00:28:37.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.17
2024-05-30 00:28:37.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-05-30 00:28:37.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-05-30 00:28:37.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-05-30 00:28:37.321 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.loft_tv
2024-05-30 00:28:37.321 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: cast
2024-05-30 00:28:37.321 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.17000000178813934
2024-05-30 00:28:37.322 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.17
2024-05-30 00:28:37.322 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-05-30 00:28:37.322 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False
2024-05-30 00:28:37.322 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False
2024-05-30 00:28:37.323 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.living_room
2024-05-30 00:28:37.323 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-05-30 00:28:37.323 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.1
2024-05-30 00:28:37.323 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.17
2024-05-30 00:28:37.323 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-05-30 00:28:37.324 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-05-30 00:28:37.324 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-05-30 00:28:37.325 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /config/custom_components/chime_tts/mp3s/ba_dum_tss.mp3
2024-05-30 00:28:37.325 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/custom_components/chime_tts/mp3s/ba_dum_tss.mp3"...
2024-05-30 00:28:37.534 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 2.403s
2024-05-30 00:28:37.535 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-05-30 00:28:37.535 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'tts.piper'
2024-05-30 00:28:37.536 DEBUG (MainThread) [custom_components.chime_tts] * message = 'test message to be announced'
2024-05-30 00:28:37.536 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-05-30 00:28:37.536 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-05-30 00:28:37.536 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-05-30 00:28:37.744 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 210.0ms
2024-05-30 00:28:37.786 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /config/custom_components/chime_tts/mp3s/bells.mp3
2024-05-30 00:28:37.786 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/custom_components/chime_tts/mp3s/bells.mp3"...
2024-05-30 00:28:37.976 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 0.944s
2024-05-30 00:28:38.008 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-30 00:28:38.346 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/zs5txlxv.mp3
2024-05-30 00:28:38.570 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-05-30 00:28:38.570 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 6.159
2024-05-30 00:28:38.571 DEBUG (MainThread) [custom_components.chime_tts] * local_path = "/media/sounds/temp/chime_tts/zs5txlxv.mp3"
2024-05-30 00:28:38.571 DEBUG (MainThread) [custom_components.chime_tts] * public_path = None
2024-05-30 00:28:38.571 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/zs5txlxv.mp3"
2024-05-30 00:28:38.571 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-05-30 00:28:38.571 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 1 media player
2024-05-30 00:28:38.716 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Decresing media_player.loft_tv's volume from 0.17000000178813934 to 0.17
2024-05-30 00:28:38.716 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-05-30 00:28:38.716 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.17
2024-05-30 00:28:38.717 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.loft_tv
2024-05-30 00:28:39.751 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.living_room's volume from 0.1 to 0.17
2024-05-30 00:28:39.752 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-05-30 00:28:39.752 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.17
2024-05-30 00:28:39.752 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.living_room
2024-05-30 00:28:39.788 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-30 00:28:39.788 DEBUG (MainThread) [custom_components.chime_tts] 2 media players detected:
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] - media_player.loft_tv
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] - media_player.living_room
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-30 00:28:39.789 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.loft_tv']
2024-05-30 00:28:39.790 DEBUG (MainThread) [custom_components.chime_tts] - announce: False
2024-05-30 00:28:39.790 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-30 00:28:39.790 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/zs5txlxv.mp3
2024-05-30 00:28:39.799 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 6.159s for audio playback to complete...
2024-05-30 00:28:45.964 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 2 media_players aren't playing...
2024-05-30 00:28:45.965 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.living_room
2024-05-30 00:28:46.569 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.loft_tv
2024-05-30 00:28:46.569 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-05-30 00:28:46.569 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Decresing media_player.loft_tv's volume from 0.17000000178813934 to 0.17
2024-05-30 00:28:46.570 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-05-30 00:28:46.570 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.17
2024-05-30 00:28:46.570 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.loft_tv
2024-05-30 00:28:47.602 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Restoring 1 Sonos media player
Legrand5382 commented 4 months ago

For me my Sonos volume change but no tts speaking, then the volume go back to original level. I tried with one speaker and a group and still the same, also tried different setting but TTS won’t speak.

nimroddolev commented 4 months ago

Thanks for the feedback. I think I found and fixed the issue, and released a new version, v1.1.0-beta8. Please upgrade and let me know if it fixes the issue 👍

Legrand5382 commented 4 months ago

I just tried it and for me its the same as beta 7, still not speaking, the volume still go up during music playing then pause, no speaking and return to original music volume and playback.

nimroddolev commented 4 months ago

@Legrand5382 can you please enable debug logging and send me the debug log messages?

Legrand5382 commented 4 months ago

@Legrand5382 can you please enable debug logging and send me the debug log messages?

Sure, will do that when I get back home in a a few minutes 😊

sven-pb commented 4 months ago

Same for me, volume goes down/on mute when TTS is supposed to play.

(Symfonisk entity: media_player.living_room)

log

2024-05-30 21:26:54.134 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-30 21:26:54.139 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta8 -----
2024-05-30 21:26:54.140 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-30 21:26:54.140 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-05-30 21:26:54.141 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.loft_tv
2024-05-30 21:26:54.141 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.living_room
2024-05-30 21:26:54.142 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = ba_dum_tss
2024-05-30 21:26:54.142 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-05-30 21:26:54.142 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-05-30 21:26:54.142 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-05-30 21:26:54.143 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = test message to be announced
2024-05-30 21:26:54.143 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = tts.piper
2024-05-30 21:26:54.143 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-05-30 21:26:54.143 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-05-30 21:26:54.143 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = True
2024-05-30 21:26:54.144 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = True
2024-05-30 21:26:54.144 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.24
2024-05-30 21:26:54.144 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-05-30 21:26:54.145 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-05-30 21:26:54.145 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-05-30 21:26:54.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.loft_tv
2024-05-30 21:26:54.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: cast
2024-05-30 21:26:54.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.23999999463558197
2024-05-30 21:26:54.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.24
2024-05-30 21:26:54.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-05-30 21:26:54.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False
2024-05-30 21:26:54.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False
2024-05-30 21:26:54.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.living_room
2024-05-30 21:26:54.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-05-30 21:26:54.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.25
2024-05-30 21:26:54.148 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.24
2024-05-30 21:26:54.148 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: True
2024-05-30 21:26:54.148 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-05-30 21:26:54.148 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-05-30 21:26:54.149 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-05-30 21:26:54.176 DEBUG (MainThread) [custom_components.chime_tts] ...no cached audio found
2024-05-30 21:26:54.177 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /config/custom_components/chime_tts/mp3s/ba_dum_tss.mp3
2024-05-30 21:26:54.177 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/custom_components/chime_tts/mp3s/ba_dum_tss.mp3"...
2024-05-30 21:26:54.387 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 2.403s
2024-05-30 21:26:54.389 DEBUG (MainThread) [custom_components.chime_tts] - Attempting to retrieve TTS audio from cache...
2024-05-30 21:26:54.395 DEBUG (MainThread) [custom_components.chime_tts] ...no cached TTS audio found
2024-05-30 21:26:54.396 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-05-30 21:26:54.396 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'tts.piper'
2024-05-30 21:26:54.396 DEBUG (MainThread) [custom_components.chime_tts] * message = 'test message to be announced'
2024-05-30 21:26:54.397 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2024-05-30 21:26:54.397 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-05-30 21:26:54.397 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-05-30 21:26:54.606 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 210.0ms
2024-05-30 21:26:54.607 DEBUG (MainThread) [custom_components.chime_tts] - Saving generated TTS audio to cache...
2024-05-30 21:26:54.736 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/uuy5mro8.mp3
2024-05-30 21:26:54.736 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-05-30 21:26:54.736 DEBUG (MainThread) [custom_components.chime_tts] - key: "a66e49785f7075705f2fdb2ebc589dcddcf5f378b73119398ef4c363e05999e4"
2024-05-30 21:26:54.736 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/uuy5mro8.mp3', 'audio_duration': 1.864}"
2024-05-30 21:26:54.744 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio saved to cache
2024-05-30 21:26:54.784 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-05-30 21:26:55.082 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/om94o8_h.mp3
2024-05-30 21:26:55.297 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-05-30 21:26:55.297 DEBUG (MainThread) [custom_components.chime_tts] - key: "f4f0586b2e1316243c67404068a13dba0d691c09f995f9b94cce7c524efdaf6f"
2024-05-30 21:26:55.297 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/om94o8_h.mp3', 'audio_duration': 4.717}"
2024-05-30 21:26:55.303 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-05-30 21:26:55.304 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 4.717
2024-05-30 21:26:55.304 DEBUG (MainThread) [custom_components.chime_tts] * local_path = "/media/sounds/temp/chime_tts/om94o8_h.mp3"
2024-05-30 21:26:55.304 DEBUG (MainThread) [custom_components.chime_tts] * public_path = None
2024-05-30 21:26:55.304 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/om94o8_h.mp3"
2024-05-30 21:26:55.304 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-05-30 21:26:55.305 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Fading out media_player.living_room's volume from 0.25 to 0 over 0.5s
2024-05-30 21:26:55.848 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Pausing 1 media_player
2024-05-30 21:26:55.970 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 1 media_player is paused...
2024-05-30 21:26:56.172 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.living_room
2024-05-30 21:26:56.172 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 1 media player
2024-05-30 21:26:56.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.loft_tv's volume from 0.23999999463558197 to 0.24
2024-05-30 21:26:56.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-05-30 21:26:56.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.24
2024-05-30 21:26:56.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.loft_tv
2024-05-30 21:26:57.421 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-05-30 21:26:57.422 DEBUG (MainThread) [custom_components.chime_tts] 2 media players detected:
2024-05-30 21:26:57.422 DEBUG (MainThread) [custom_components.chime_tts] - media_player.loft_tv
2024-05-30 21:26:57.423 DEBUG (MainThread) [custom_components.chime_tts] - media_player.living_room
2024-05-30 21:26:57.423 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-05-30 21:26:57.423 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.loft_tv']
2024-05-30 21:26:57.423 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
2024-05-30 21:26:57.423 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-05-30 21:26:57.424 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/om94o8_h.mp3
2024-05-30 21:26:57.433 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 4.717s for audio playback to complete...
2024-05-30 21:27:02.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 2 media_players aren't playing...
2024-05-30 21:27:02.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.living_room
2024-05-30 21:27:02.556 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.loft_tv
2024-05-30 21:27:02.557 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-05-30 21:27:02.557 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 1 media_player is paused...
2024-05-30 21:27:02.557 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.living_room
2024-05-30 21:27:02.557 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Setting volume to 0
2024-05-30 21:27:02.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Restoring 1 Sonos media player
2024-05-30 21:27:02.872 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Resuming 1 media_player
2024-05-30 21:27:04.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Fading in media_player.living_room's volume from 0.0 to 0.25 over 0.5s
2024-05-30 21:27:04.895 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.loft_tv's volume from 0.23999999463558197 to 0.24
2024-05-30 21:27:04.896 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data:
2024-05-30 21:27:04.896 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.24
2024-05-30 21:27:04.896 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.loft_tv
2024-05-30 21:27:05.914 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 11.77 s -----
service: chime_tts.say
metadata: {}
data:
  message: test message to be announced
  volume_level: 0.24
  chime_path: ba_dum_tss
  announce: true
  tts_platform: tts.piper
  cache: true
  fade_audio: true
target:
  entity_id:
    - media_player.living_room
    - media_player.loft_tv
Legrand5382 commented 4 months ago

@Legrand5382 can you please enable debug logging and send me the debug log messages?

Here is my log

2024-05-30 14:27:16.969 DEBUG (MainThread) [custom_components.chime_tts.config_flow] ----- Chime TTS Version v1.1.0-beta8 Configuration ----- 2024-05-30 14:28:19.529 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-05-30 14:28:19.529 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta8 ----- 2024-05-30 14:28:19.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-05-30 14:28:19.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids: 2024-05-30 14:28:19.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.speaker_chambre 2024-05-30 14:28:19.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.cuisine 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] chime_path = error 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 100.0 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = Le système d'alarme est activé et les portes sont verrouillées, la maison est sécurisée. 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = True 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] fade_audio = False 2024-05-30 14:28:19.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = 0.73 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] media_players_array: 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.speaker_chambre 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.27 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.73 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.cuisine 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.33 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.73 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True 2024-05-30 14:28:19.533 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-05-30 14:28:19.539 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found: 2024-05-30 14:28:19.539 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/n1oxmtgv.mp3" 2024-05-30 14:28:19.539 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 6.892 2024-05-30 14:28:19.539 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None 2024-05-30 14:28:19.539 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/n1oxmtgv.mp3" 2024-05-30 14:28:19.539 DEBUG (MainThread) [custom_components.chime_tts] Pre-Playback Actions 2024-05-30 14:28:19.540 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 2 media players 2024-05-30 14:28:19.839 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.speaker_chambre's volume from 0.27 to 0.73 2024-05-30 14:28:19.839 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data: 2024-05-30 14:28:19.840 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.73 2024-05-30 14:28:19.840 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.speaker_chambre 2024-05-30 14:28:19.877 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.cuisine's volume from 0.33 to 0.73 2024-05-30 14:28:19.877 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data: 2024-05-30 14:28:19.878 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.73 2024-05-30 14:28:19.878 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.cuisine 2024-05-30 14:28:19.891 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.speaker_chambre, with 1 group member: 2024-05-30 14:28:19.892 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.cuisine 2024-05-30 14:28:20.743 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS playback 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] 1 media player detected: 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] - media_player.speaker_chambre 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data: 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: [] 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] - announce: True 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music 2024-05-30 14:28:20.744 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/n1oxmtgv.mp3 2024-05-30 14:28:20.745 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 6.892s for audio playback to complete... 2024-05-30 14:28:27.638 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 2 media_players aren't playing... 2024-05-30 14:28:27.638 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.speaker_chambre 2024-05-30 14:28:27.840 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.cuisine 2024-05-30 14:28:27.841 DEBUG (MainThread) [custom_components.chime_tts] Post-Playback Actions 2024-05-30 14:28:27.841 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Calling media_player.unjoin service... 2024-05-30 14:28:27.841 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.unjoin: media_player.speaker_chambre 2024-05-30 14:28:28.803 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ...done 2024-05-30 14:28:28.803 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.unjoin: media_player.cuisine 2024-05-30 14:28:29.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ...done 2024-05-30 14:28:29.188 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Restoring 2 Sonos media players 2024-05-30 14:28:31.406 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 11.88 s ----- 2024-05-30 14:42:29.537 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.4.5: Connection timed out for hub 16378309 2024-05-30 14:43:16.533 ERROR (MainThread) [homeassistant.components.synology_dsm.coordinator] Error fetching 192.168.1.28 SynologyDSMCentralUpdateCoordinator data: Error communicating with API: {'api': None, 'code': -1, 'reason': 'Unknown', 'details': 'TimeoutError'} 2024-05-30 14:47:43.527 ERROR (SyncWorker_57) [root] Ical data was modified to avoid compatibility issues (Your calendar server breaks the icalendar standard) This is probably harmless, particularly if not editing events or tasks (error count: 512 - this error is ratelimited) NoneType: None 2024-05-30 14:47:43.528 ERROR (SyncWorker_57) [root] --- +++ @@ -5,7 +5,6 @@ BEGIN:VEVENT DTSTAMP:20240530T184743Z CREATED:20220529T230114Z -DTSTAMP:20220529T230114Z LAST-MODIFIED:20220529T230114Z SEQUENCE:0 SUMMARY:Recyclage 2024-05-30 14:48:46.511 DEBUG (MainThread) [custom_components.chime_tts.config_flow] ----- Chime TTS Version v1.1.0-beta8 Configuration ----- 2024-05-30 14:53:21.828 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-05-30 14:53:21.828 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta8 ----- 2024-05-30 14:53:21.830 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-05-30 14:53:21.830 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids: 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.speaker_chambre 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.cuisine 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] chime_path = error 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 100.0 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = Le système d'alarme est activé et les portes sont verrouillées, la maison est sécurisée. 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-05-30 14:53:21.831 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = True 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] fade_audio = False 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = 0.73 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = True 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = True 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] media_players_array: 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.speaker_chambre 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.27 2024-05-30 14:53:21.832 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.73 2024-05-30 14:53:21.833 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False 2024-05-30 14:53:21.833 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True 2024-05-30 14:53:21.833 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True 2024-05-30 14:53:21.833 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.cuisine 2024-05-30 14:53:21.833 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos 2024-05-30 14:53:21.833 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.33 2024-05-30 14:53:21.834 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.73 2024-05-30 14:53:21.835 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: True 2024-05-30 14:53:21.835 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True 2024-05-30 14:53:21.835 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True 2024-05-30 14:53:21.836 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found: 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/n1oxmtgv.mp3" 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 6.892 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/n1oxmtgv.mp3" 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts] Pre-Playback Actions 2024-05-30 14:53:21.842 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 2 media players 2024-05-30 14:53:22.192 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.speaker_chambre's volume from 0.27 to 0.73 2024-05-30 14:53:22.192 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data: 2024-05-30 14:53:22.192 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.73 2024-05-30 14:53:22.192 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.speaker_chambre 2024-05-30 14:53:22.228 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Increasing media_player.cuisine's volume from 0.33 to 0.73 2024-05-30 14:53:22.228 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Calling media_player.volume_set with data: 2024-05-30 14:53:22.228 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - volume_level: 0.73 2024-05-30 14:53:22.228 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - entity_id: media_player.cuisine 2024-05-30 14:53:22.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.speaker_chambre, with 1 group member: 2024-05-30 14:53:22.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.cuisine 2024-05-30 14:53:23.794 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS playback 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] 1 media player detected: 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] - media_player.speaker_chambre 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data: 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: [] 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] - announce: True 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music 2024-05-30 14:53:23.797 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/n1oxmtgv.mp3 2024-05-30 14:53:23.798 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 6.892s for audio playback to complete... 2024-05-30 14:53:30.691 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 2 media_players aren't playing... 2024-05-30 14:53:30.692 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.speaker_chambre 2024-05-30 14:53:30.894 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.cuisine 2024-05-30 14:53:30.894 DEBUG (MainThread) [custom_components.chime_tts] Post-Playback Actions 2024-05-30 14:53:30.894 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Calling media_player.unjoin service... 2024-05-30 14:53:30.895 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.unjoin: media_player.speaker_chambre 2024-05-30 14:53:32.869 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ...done 2024-05-30 14:53:32.869 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.unjoin: media_player.cuisine 2024-05-30 14:53:33.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ...done 2024-05-30 14:53:33.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Restoring 2 Sonos media players 2024-05-30 14:53:38.283 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 16.45 s ---

dimatx commented 4 months ago

Hey @nimroddolev - Testing out 1.1.0b8 and unable to get my Sonos speakers to work at all with ChimeTTS anymore with the latest. Had to revert to 1.0.0. I'm not setting either announce or unjoin to true because because I find the behavior gets more unpredictable with those options on. Although my preferred setup would be to be true for both of those.

Here are the logs for exact same setup for 1.0.0, and then 1.1.0b8:

Service call:

service: chime_tts.say
data:
  delay: 300
  volume: 0.35
  final_delay: 100
  message: "Just a simple test with Chime TTS v..."
  tts_platform: microsoft
  chime_path: custom_chime_path_5
  cache: true
  announce: false
  join_players: true
  unjoin_players: false
target:
  entity_id:
    - media_player.bedroom_sonos
    - media_player.kitchen_sonos
    - media_player.his_office_sonos
    - media_player.her_office_sonos
    - media_player.gym_sonos

Response for v1.0.0

2024-06-01 09:13:21.133 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.0.0 ----- 2024-06-01 09:13:21.133 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-06-01 09:13:21.194 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ```Media players found: [{'entity_id': 'media_player.kitchen_sonos', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'resume_media_player': False}, {'entity_id': 'media_player.gym_sonos', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'resume_media_player': False}, {'entity_id': 'media_player.bedroom_sonos', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'resume_media_player': False}, {'entity_id': 'media_player.his_office_sonos', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'resume_media_player': False}, {'entity_id': 'media_player.her_office_sonos', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': True, 'announce_supported': True, 'resume_media_player': False}] 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.kitchen_sonos', 'media_player.gym_sonos', 'media_player.bedroom_sonos', 'media_player.his_office_sonos', 'media_player.her_office_sonos'] 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] chime_path = custom_chime_path_5 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 300.0 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 100.0 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = Just a simple test with Chime TTS v1.0 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = microsoft 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = False 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1.0 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = True 2024-06-01 09:13:21.199 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False 2024-06-01 09:13:21.202 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found: 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/bdfa_9tr.mp3" 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 8.314 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/bdfa_9tr.mp3" 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] Pre-Playback Actions 2024-06-01 09:13:21.206 WARNING (MainThread) [custom_components.chime_tts] Unable to join speakers. No supported media_players found. 2024-06-01 09:13:21.206 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS playback 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] 5 Standard media players detected: 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_player.kitchen_sonos 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_player.gym_sonos 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_player.bedroom_sonos 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_player.his_office_sonos 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_player.her_office_sonos 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data: 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music 2024-06-01 09:13:21.210 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/bdfa_9tr.mp3 2024-06-01 09:13:21.211 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.kitchen_sonos', 'media_player.gym_sonos', 'media_player.bedroom_sonos', 'media_player.his_office_sonos', 'media_player.her_office_sonos'] 2024-06-01 09:13:21.211 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 8.414s for audio playback to complete... 2024-06-01 09:13:29.633 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 5 media_players aren't playing... 2024-06-01 09:13:30.237 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.kitchen_sonos 2024-06-01 09:13:30.237 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.bedroom_sonos 2024-06-01 09:13:30.237 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.her_office_sonos 2024-06-01 09:13:30.438 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.gym_sonos 2024-06-01 09:13:30.640 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.his_office_sonos 2024-06-01 09:13:30.640 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 9.45 s -----

Response for v1.1.0

2024-06-01 09:05:23.352 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-06-01 09:05:23.360 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta8 -----
2024-06-01 09:05:23.368 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-06-01 09:05:23.368 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.bedroom_sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.his_office_sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: media_player.gym_sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 3: media_player.kitchen_sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 4: media_player.her_office_sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_chime_path_5
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 300.0
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 100.0
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Just a simple test with Chime TTS v1.1b8
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = microsoft
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.bedroom_sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-01 09:05:23.369 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.22
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.his_office_sonos
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.22
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.gym_sonos
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.22
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.kitchen_sonos
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.26
2024-06-01 09:05:23.370 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - entity_id: media_player.her_office_sonos
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.22
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-06-01 09:05:23.371 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-06-01 09:05:23.374 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts]    Cached audio found:
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts]      - local_path = "/media/sounds/temp/chime_tts/yzsmsf4o.mp3"
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts]      - audio_duration = 8.698
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts]      - public_path = None
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/yzsmsf4o.mp3"
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-06-01 09:05:23.376 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 5 media players
2024-06-01 09:05:23.789 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.bedroom_sonos, with 4 group members:
2024-06-01 09:05:23.789 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.his_office_sonos
2024-06-01 09:05:23.789 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.gym_sonos
2024-06-01 09:05:23.789 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.kitchen_sonos
2024-06-01 09:05:23.789 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]   - media_player.her_office_sonos
2024-06-01 09:05:27.722 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-06-01 09:05:27.736 DEBUG (MainThread) [custom_components.chime_tts]    1 media player detected:
2024-06-01 09:05:27.736 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.bedroom_sonos
2024-06-01 09:05:27.737 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-06-01 09:05:27.737 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: []
2024-06-01 09:05:27.737 DEBUG (MainThread) [custom_components.chime_tts]      - announce: False
2024-06-01 09:05:27.737 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-06-01 09:05:27.737 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/yzsmsf4o.mp3
2024-06-01 09:05:27.737 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 8.798s for audio playback to complete...
2024-06-01 09:05:33.360 ERROR (MainThread) [custom_components.chime_tts] Error calling chime_tts.say service: Service call timed out
2024-06-01 09:05:33.361 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: Service call timed out
2024-06-01 09:05:33.361 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139867489171136] Error handling message: Service call timed out (home_assistant_error) Dima from 192.168.7.100 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0)
nimroddolev commented 4 months ago

Thank you for your feedback regarding beta8 @Legrand5382, @sven-pb & @dimatx and for your continued patience!

I believe I found and fixed the issue in v1.1.0-beta9. Please let me know if it is working.

dimatx commented 4 months ago

Thanks for your effort to fixing this, @nimroddolev . Happy to keep testing.

Beta 9 is better. I am able to get it to work with announce=false. When I use announce=true, only some of the speakers play. But this was true for before, so I don't think it's a regression.

Here are logs for two service calls, first with announce = false, then with announce = true.

For what it's worth, I still get the 'Service call timed out' error in the logs, but it does not seem to indicate whether things will work or not.

2024-06-01 14:09:42.431 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-06-01 14:09:42.431 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta9 -----
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.her_office_sonos
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.bedroom_sonos
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: media_player.gym_sonos
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 3: media_player.his_office_sonos
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 4: media_player.kitchen_sonos
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = custom_chime_path_5
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 300.0
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 100.0
2024-06-01 14:09:42.446 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Announce is false
2024-06-01 14:09:42.447 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = microsoft
2024-06-01 14:09:42.450 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.3
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = True
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = True
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.her_office_sonos
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:09:42.451 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.bedroom_sonos
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.gym_sonos
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:09:42.452 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.his_office_sonos
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.kitchen_sonos
2024-06-01 14:09:42.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:09:42.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:09:42.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:09:42.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:09:42.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:09:42.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:09:42.461 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-06-01 14:09:42.470 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found:
2024-06-01 14:09:42.471 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/f6f_3x8w.mp3"
2024-06-01 14:09:42.471 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.938
2024-06-01 14:09:42.471 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-06-01 14:09:42.471 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/f6f_3x8w.mp3"
2024-06-01 14:09:42.471 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-06-01 14:09:42.471 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 5 media players
2024-06-01 14:09:42.973 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.her_office_sonos, with 4 group members:
2024-06-01 14:09:42.973 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.bedroom_sonos
2024-06-01 14:09:42.973 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.gym_sonos
2024-06-01 14:09:42.973 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.his_office_sonos
2024-06-01 14:09:42.973 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.kitchen_sonos
2024-06-01 14:09:42.983 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] 2 media players detected:
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] - media_player.her_office_sonos
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] - media_player.her_office_sonos
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.her_office_sonos', 'media_player.her_office_sonos']
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] - announce: False
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-06-01 14:09:43.011 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/f6f_3x8w.mp3
2024-06-01 14:09:43.015 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 6.038s for audio playback to complete...
2024-06-01 14:09:49.068 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 5 media_players aren't playing...
2024-06-01 14:09:50.073 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.her_office_sonos
2024-06-01 14:09:50.073 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.gym_sonos
2024-06-01 14:09:50.073 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.kitchen_sonos
2024-06-01 14:09:50.274 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.bedroom_sonos
2024-06-01 14:09:50.475 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.his_office_sonos
2024-06-01 14:09:50.475 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-06-01 14:09:50.476 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Calling media_player.unjoin service...
2024-06-01 14:09:50.476 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.unjoin: media_player.her_office_sonos
2024-06-01 14:09:52.432 ERROR (MainThread) [custom_components.chime_tts] Error calling chime_tts.say service: Service call timed out
2024-06-01 14:09:52.432 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: Service call timed out
2024-06-01 14:09:52.432 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140534673816768] Error handling message: Service call timed out (home_assistant_error) Dima from 192.168.7.103 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0)
2024-06-01 14:10:06.659 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-06-01 14:10:06.659 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta9 -----
2024-06-01 14:10:06.682 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids:
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: media_player.her_office_sonos
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 1: media_player.bedroom_sonos
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 2: media_player.gym_sonos
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 3: media_player.his_office_sonos
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 4: media_player.kitchen_sonos
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = custom_chime_path_5
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 300.0
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 100.0
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Announce is true
2024-06-01 14:10:06.683 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = microsoft
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = True
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.3
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = True
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = True
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.her_office_sonos
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.bedroom_sonos
2024-06-01 14:10:06.684 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.gym_sonos
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.his_office_sonos
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:10:06.685 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - entity_id: media_player.kitchen_sonos
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: sonos
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: 0.3
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: 0.3
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: True
2024-06-01 14:10:06.686 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: True
2024-06-01 14:10:06.693 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-06-01 14:10:06.712 DEBUG (MainThread) [custom_components.chime_tts] ...no cached audio found
2024-06-01 14:10:06.712 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/config/www/sound/new-notification-on-your-device-138695.mp3"...
2024-06-01 14:10:06.936 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 3.527s
2024-06-01 14:10:06.937 DEBUG (MainThread) [custom_components.chime_tts] - Attempting to retrieve TTS audio from cache...
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] ...no cached TTS audio found
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'microsoft'
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Announce is true'
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-06-01 14:10:06.965 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-06-01 14:10:07.586 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 620.0ms
2024-06-01 14:10:07.586 DEBUG (MainThread) [custom_components.chime_tts] - Saving generated TTS audio to cache...
2024-06-01 14:10:07.695 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/p7mcfjdg.mp3
2024-06-01 14:10:07.695 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-06-01 14:10:07.695 DEBUG (MainThread) [custom_components.chime_tts] - key: "fb939df16560646c041d9c8f62d242a810df90b4757b29375d38415dcf40cf23"
2024-06-01 14:10:07.695 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/p7mcfjdg.mp3', 'audio_duration': 2.016}"
2024-06-01 14:10:07.703 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio saved to cache
2024-06-01 14:10:07.717 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-06-01 14:10:08.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/nba1i3fp.mp3
2024-06-01 14:10:08.354 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-06-01 14:10:08.354 DEBUG (MainThread) [custom_components.chime_tts] - key: "b545b37e5ec920a3589432c2dcc04f3387dbe54a10785541fb479ad461926e96"
2024-06-01 14:10:08.354 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/nba1i3fp.mp3', 'audio_duration': 5.842}"
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 5.842
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts] * local_path = "/media/sounds/temp/chime_tts/nba1i3fp.mp3"
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts] * public_path = None
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/nba1i3fp.mp3"
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-06-01 14:10:08.358 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Taking a Sonos snapshot of 5 media players
2024-06-01 14:10:08.766 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Joined speaker leader: media_player.her_office_sonos, with 4 group members:
2024-06-01 14:10:08.766 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.bedroom_sonos
2024-06-01 14:10:08.766 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.gym_sonos
2024-06-01 14:10:08.766 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.his_office_sonos
2024-06-01 14:10:08.766 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - media_player.kitchen_sonos
2024-06-01 14:10:15.719 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] 2 media players detected:
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] - media_player.her_office_sonos
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] - media_player.her_office_sonos
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.her_office_sonos', 'media_player.her_office_sonos']
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-06-01 14:10:15.745 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/nba1i3fp.mp3
2024-06-01 14:10:15.749 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 5.942s for audio playback to complete...
2024-06-01 14:10:16.660 ERROR (MainThread) [custom_components.chime_tts] Error calling chime_tts.say service: Service call timed out
2024-06-01 14:10:16.661 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: Service call timed out
2024-06-01 14:10:16.661 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140534673816768] Error handling message: Service call timed out (home_assistant_error) Dima from 192.168.7.103 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0)
nimroddolev commented 4 months ago

Thank you @dimatx!

  1. I noticed that the joined speaker group "leader" (media_player.her_office_sonos) is included twice in the service call to media_player.play_media. I doubt it causes any issues it has now been fixed for the next update.

  2. The Service call timed out error might be related to the timeout value in your configuration. Could you please check what value you have in your configuration for the integration? Screenshot 2024-06-02 at 9 31 04

  3. With announce set to true you reported that only some of the speakers played. Can you please tell me whether they were playing music at the time you called chime_tts.say? Which Sonos models are they? Is there anything else that you can think of that might be releveant?

HA-TB303 commented 4 months ago

Using beta 9 its better, i just noticed when watching tv (sonos arc) an announcement came in, played on multiple speakers, but after that TV playback continued on multiple speakers (unsynced) Seems like the unjoin didn’t work properly. I have no logs yet. Configuration is unchanged.

nimroddolev commented 3 months ago

Hi @HA-TB303, glad to hear there's an improvement.

Please provide me with debug logs when you can. Do you remember if you included the unjoin_players parameter as well? If not, the speaker group remains joined after Chime TTS completes playback.

dimatx commented 3 months ago

Hey @nimroddolev. My timeout was set to 10 seconds, I have upped it to 60 to see how it behaves. In either case, the timeout does not appear to be tied to any undesirable behavior. In terms of announce, I did not have any playing, but I did just try it with that, and found that behavior is not very predictable, it seemed like the announcement only played on some of the speakers. I can do some more methodical testing later if that'd be helpful. My speakers are: Play:1, Play:3, Beam, 2 x Symfonisk Bookshelf.

The good news that as long as announce = false, things seem to work as expected. So hopefully that will eventually help narrow down the root cause.

nimroddolev commented 3 months ago

Thanks @dimax. It might be possible that having such a short timeout duration may actually have had an impact as once timed out, no post-playback actions would have taken place (like unjoin_players). Now that your timeout setting is longer, please let me know if you see a difference.

I would be appreciative if you could please perform more tests, along with the accompanying debug log messages, as it might shed some light and help me pinpoint what the issues are. I'm interested to know if the speakers that failed to play are always the same ones, or more inconsistent. Maybe the Sonos model / firmware are contributing factors.