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
196 stars 14 forks source link

Sonos Beam und Arc didn't switch back to TV source/input after notification #187

Closed akwak2015 closed 1 month ago

akwak2015 commented 2 months ago

System Health details

System Information

version core-2024.9.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.46-haos
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 5000 Installed Version | 2.0.1 Stage | running Available Repositories | 1415 Downloaded Repositories | 55
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 12. September 2025 um 02:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | false remote_connected | false alexa_enabled | true google_enabled | true remote_server | eu-central-1-6.ui.nabu.casa certificate_status | ready instance_id | 525cd806ee744cec8b7163ccff9bcac9 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.09.1 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 30.8 GB disk_used | 24.6 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | Studio Code Server (5.15.0), MQTT Explorer (browser-1.0.3), Home Assistant Google Drive Backup (0.112.1), TasmoAdmin (0.30.5), Samba share (12.3.2), Advanced SSH & Web Terminal (19.0.0), go2rtc (1.9.4), ESPHome (2024.8.3)
Dashboards dashboards | 8 -- | -- resources | 40 views | 54 mode | storage
MercedesME 2020 api_endpoint_reachable | ok -- | -- websocket_connection_state | connected cars_connected | 1 version | v0.18.1
Recorder oldest_recorder_run | 9. September 2024 um 04:03 -- | -- current_recorder_run | 17. September 2024 um 16:27 estimated_db_size | 3155.77 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

After playing a notification, the sonos Box didn't change back to the previously used source/input

Reproduction steps

Start the action:

chime_tts.say
data:
  chime_path: bells
  message: "Test "
  tts_platform: cloud
target:
  entity_id: media_player.schlafzimmer

Debug logs

2024-09-18 11:08:32.879 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.3 -----
2024-09-18 11:08:32.879 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-09-18 11:08:32.880 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.3 -----
2024-09-18 11:08:32.880 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-09-18 11:08:32.880 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.schlafzimmer']
2024-09-18 11:08:32.880 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = bells
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Test 
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = cloud
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-09-18 11:08:32.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.schlafzimmer
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: sonos
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.16
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: True
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: True
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: True
2024-09-18 11:08:32.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /config/custom_components/chime_tts/mp3s/bells.mp3
2024-09-18 11:08:32.883 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/config/custom_components/chime_tts/mp3s/bells.mp3"...
2024-09-18 11:08:33.166 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 0.944s
2024-09-18 11:08:33.171 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-09-18 11:08:33.171 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'cloud'
2024-09-18 11:08:33.171 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'Test '
2024-09-18 11:08:33.172 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-09-18 11:08:33.172 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-09-18 11:08:33.172 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-09-18 11:08:33.688 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 520.0ms
2024-09-18 11:08:33.693 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-09-18 11:08:33.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/jathap6a.mp3
2024-09-18 11:08:34.193 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-09-18 11:08:34.193 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 2.882
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/media/sounds/temp/chime_tts/jathap6a.mp3"
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/jathap6a.mp3"
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts] ****************************
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts] ****************************
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts] **************************
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-09-18 11:08:34.194 DEBUG (MainThread) [custom_components.chime_tts] **************************
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]    1 Sonos media player detected:
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.schlafzimmer
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.schlafzimmer']
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]      - announce: False
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/jathap6a.mp3
2024-09-18 11:08:34.195 DEBUG (MainThread) [custom_components.chime_tts]      - extra: {'volume': 100}
2024-09-18 11:08:34.198 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 2.882s for audio playback to complete...
2024-09-18 11:08:37.087 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-09-18 11:08:37.711 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    ✔ media_player.schlafzimmer
2024-09-18 11:08:37.712 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 4.83 s -----

Diagnostics dump

home-assistant_chime_tts_2024-09-18T09-14-31.855Z.log home-assistant_sonos_2024-09-18T09-14-23.563Z.log

akwak2015 commented 2 months ago

bevore notification: image after notification: image

nimroddolev commented 2 months ago

Hi @akwak2015, have you tried setting the announce parameter to true?

akwak2015 commented 2 months ago

Thank you! I will try it and report if this is the way to go.

nimroddolev commented 1 month ago

I am closing this issue. Please reopen it if you are still experiencing the problem.