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

Media file "%s" is not in a local media directory, Caching not working #202

Closed attila-szucs closed 3 weeks ago

attila-szucs commented 1 month ago

System Health details

System Information

version core-2024.10.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/Budapest
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 | 1447 Downloaded Repositories | 33
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 2025. február 25. 01:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | false remote_server | eu-central-1-3.ui.nabu.casa certificate_status | ready instance_id | daf9ede885294d22b4a14e50d8991a7a 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.10.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 234.7 GB disk_used | 32.0 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Advanced SSH & Web Terminal (19.0.0), Paradox Alarm Interface (3.5.0), SQLite Web (4.2.2), TasmoAdmin (0.30.6), Duck DNS (1.18.0), NGINX Home Assistant SSL proxy (3.11.0), EMQX (0.7.1), LMS Lyrion Music Server(Formerly Logitech Media Server) (8.5.2.2), Piper (1.5.2)
Dashboards dashboards | 6 -- | -- resources | 22 views | 14 mode | storage
Recorder oldest_recorder_run | 2023. szeptember 14. 13:37 -- | -- current_recorder_run | 2024. október 17. 14:02 estimated_db_size | 3299.37 MiB database_engine | sqlite database_version | 3.45.3
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

I'm getting this message each time using the chime_tts.say service: "Media file "%s" is not in a local media directory." The audio plays Ok, if I turn off caching. Audio caching is not working. If I turn on cache, Alexa complains about Simon says.. something skill is not found, which happens when the audio file to be played is not reachable. In fact she is right, the audio file does not exists on the passed url.

Reproduction steps

This is the call:

  - target:
      entity_id: media_player.echodot
    data:
      chime_path: /media/sounds/alexa_notification.mp3
      offset: 200
      message: The garage door has closed.
      tts_platform: cloud
      audio_conversion: Alexa
    action: chime_tts.say

This is what I have in configuration.yaml:

homeassistant:
  media_dirs:
    media: /media

This is my Chime_TTS configuration: image

See the 2 debug logs for what's happening.

Debug logs

This is the log with caching off:
2024-10-17 14:17:04.495 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔══════════════════════════════════════╗
2024-10-17 14:17:04.495 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.5 ║
2024-10-17 14:17:04.495 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚══════════════════════════════════════╝
2024-10-17 14:17:04.496 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-10-17 14:17:04.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-17 14:17:04.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-10-17 14:17:04.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-17 14:17:04.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.echodot']
2024-10-17 14:17:04.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = /media/sounds/alexa_notification.mp3
2024-10-17 14:17:04.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-10-17 14:17:04.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 200.0
2024-10-17 14:17:04.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-10-17 14:17:04.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = A garázskapu becsukódott.
2024-10-17 14:17:04.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = cloud
2024-10-17 14:17:04.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-10-17 14:17:04.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-10-17 14:17:04.501 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-10-17 14:17:04.501 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-10-17 14:17:04.501 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-10-17 14:17:04.501 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-10-17 14:17:04.501 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-10-17 14:17:04.504 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * audio_conversion = -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0
2024-10-17 14:17:04.504 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-10-17 14:17:04.504 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.echodot
2024-10-17 14:17:04.505 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: alexa_media
2024-10-17 14:17:04.505 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.6
2024-10-17 14:17:04.505 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-10-17 14:17:04.505 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-10-17 14:17:04.505 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-10-17 14:17:04.506 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-10-17 14:17:04.506 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-10-17 14:17:04.507 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-10-17 14:17:04.507 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-10-17 14:17:04.515 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/media/sounds/alexa_notification.mp3"...
2024-10-17 14:17:04.720 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.229s
2024-10-17 14:17:04.723 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-10-17 14:17:04.723 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'cloud'
2024-10-17 14:17:04.723 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'The garage door has closed.'
2024-10-17 14:17:04.723 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-10-17 14:17:04.723 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-10-17 14:17:04.724 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-10-17 14:17:05.524 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 800.0ms
2024-10-17 14:17:05.554 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to public folder: /config/www/chime_tts/...
2024-10-17 14:17:05.824 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /config/www/chime_tts/635x_65v.mp3
2024-10-17 14:17:05.825 DEBUG (MainThread) [custom_components.chime_tts]   - Performing FFmpeg audio conversion...
2024-10-17 14:17:05.825 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFMpeg operation: "ffmpeg -i /config/www/chime_tts/635x_65v.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/635x_65v_converted.mp3"
2024-10-17 14:17:06.025 DEBUG (MainThread) [custom_components.chime_tts]     ...FFmpeg audio conversion completed.
2024-10-17 14:17:06.251 ERROR (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Media file "%s" is not in a local media directory. See https://www.home-assistant.io/more-info/local-media/setup-media/
2024-10-17 14:17:06.255 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-10-17 14:17:06.255 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 5.16
2024-10-17 14:17:06.255 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = None
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = "https://66428lf4oh9y854slec6zpjb4ss50ong.ui.nabu.casa/local/chime_tts/635x_65v.mp3"
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = None
2024-10-17 14:17:06.256 ERROR (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Media file "%s" is not in a local media directory. See https://www.home-assistant.io/more-info/local-media/setup-media/
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]    1 Alexa media player detected:
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.echodot
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]    Calling notify.alexa_media with data:
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]      - message: <audio src="https://xxx.ui.nabu.casa/local/chime_tts/635x_65v.mp3"/>
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]      - data: {'type': 'tts'}
2024-10-17 14:17:06.256 DEBUG (MainThread) [custom_components.chime_tts]      - target: ['media_player.echodot']
2024-10-17 14:17:06.257 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 5.16s for audio playback to complete...
2024-10-17 14:17:11.419 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-10-17 14:17:11.420 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    ✔ media_player.echodot
2024-10-17 14:17:11.420 DEBUG (MainThread) [custom_components.chime_tts] Removing temporary file:
2024-10-17 14:17:11.420 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Deleting file /config/www/chime_tts/635x_65v.mp3
2024-10-17 14:17:11.422 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-10-17 14:17:11.423 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 6.93 s ────│
2024-10-17 14:17:11.423 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯

This is the log with caching turned on:
2024-10-17 14:11:29.842 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔══════════════════════════════════════╗
2024-10-17 14:11:29.843 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.5 ║
2024-10-17 14:11:29.843 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚══════════════════════════════════════╝
2024-10-17 14:11:29.843 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-10-17 14:11:29.848 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-17 14:11:29.849 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-10-17 14:11:29.849 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-17 14:11:29.849 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.echodot']
2024-10-17 14:11:29.849 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = /media/sounds/alexa_notification.mp3
2024-10-17 14:11:29.849 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = True
2024-10-17 14:11:29.850 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 200.0
2024-10-17 14:11:29.850 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-10-17 14:11:29.850 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message =  The garage door has closed.
2024-10-17 14:11:29.850 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = cloud
2024-10-17 14:11:29.850 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-10-17 14:11:29.851 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-10-17 14:11:29.851 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-10-17 14:11:29.851 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-10-17 14:11:29.851 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-10-17 14:11:29.851 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-10-17 14:11:29.852 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-10-17 14:11:29.852 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * audio_conversion = -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0
2024-10-17 14:11:29.852 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-10-17 14:11:29.852 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.echodot
2024-10-17 14:11:29.852 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: alexa_media
2024-10-17 14:11:29.853 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.6
2024-10-17 14:11:29.854 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-10-17 14:11:29.854 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-10-17 14:11:29.854 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-10-17 14:11:29.855 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-10-17 14:11:29.855 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-10-17 14:11:29.855 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-10-17 14:11:29.855 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-10-17 14:11:29.856 DEBUG (MainThread) [custom_components.chime_tts]  *** Checking Chime TTS audio cache ***
2024-10-17 14:11:29.859 ERROR (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Media file "%s" is not in a local media directory. See https://www.home-assistant.io/more-info/local-media/setup-media/
2024-10-17 14:11:29.859 DEBUG (MainThread) [custom_components.chime_tts]    Cached audio found:
2024-10-17 14:11:29.859 DEBUG (MainThread) [custom_components.chime_tts]      - public_path = "https://xxx.ui.nabu.casa/local/chime_tts/23i03qoc.mp3"
2024-10-17 14:11:29.860 DEBUG (MainThread) [custom_components.chime_tts]      - audio_duration = 5.184
2024-10-17 14:11:29.860 DEBUG (MainThread) [custom_components.chime_tts]      - local_path = None
2024-10-17 14:11:29.860 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id = None
2024-10-17 14:11:29.860 DEBUG (MainThread) [custom_components.chime_tts]    Apply audio conversion
2024-10-17 14:11:29.860 WARNING (MainThread) [custom_components.chime_tts.helpers.helpers] Unable to perform FFmpeg conversion: source file not found on file system: /config/www/chime_tts/23i03qoc.mp3
2024-10-17 14:11:29.860 DEBUG (MainThread) [custom_components.chime_tts]    ...cached audio found
2024-10-17 14:11:29.861 ERROR (MainThread) [custom_components.chime_tts.helpers.media_player_helper] Media file "%s" is not in a local media directory. See https://www.home-assistant.io/more-info/local-media/setup-media/
2024-10-17 14:11:29.861 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-17 14:11:29.861 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-10-17 14:11:29.861 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-17 14:11:29.861 DEBUG (MainThread) [custom_components.chime_tts]    1 Alexa media player detected:
2024-10-17 14:11:29.862 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.echodot
2024-10-17 14:11:29.862 DEBUG (MainThread) [custom_components.chime_tts]    Calling notify.alexa_media with data:
2024-10-17 14:11:29.862 DEBUG (MainThread) [custom_components.chime_tts]      - message: <audio src="https://xxx.ui.nabu.casa/local/chime_tts/23i03qoc.mp3"/>
2024-10-17 14:11:29.862 DEBUG (MainThread) [custom_components.chime_tts]      - data: {'type': 'tts'}
2024-10-17 14:11:29.862 DEBUG (MainThread) [custom_components.chime_tts]      - target: ['media_player.echodot']
2024-10-17 14:11:29.864 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 5.184s for audio playback to complete...
2024-10-17 14:11:35.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-10-17 14:11:35.050 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    ✔ media_player.echodot
2024-10-17 14:11:35.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭──────────────────────────────────────────╮
2024-10-17 14:11:35.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 5.2 s ────│
2024-10-17 14:11:35.051 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰──────────────────────────────────────────╯

Diagnostics dump

No response

nimroddolev commented 1 month ago

I just released a new beta version, v1.1.6-beta1, which hopefully addresses the issues. Can you please upgrade to the beta version and let me know if you're still experiencing the issues?

attila-szucs commented 1 month ago

Thank you sir! I have upgraded to v1.1.6-beta1. The "Media file "%s" is not in a local media directory." message has gone, but caching is still not working. If I turn it on, the same thing is happening. Please see my log below: It still says "Cached audio found", but this is the first run with cache turned on, so the audio file is obviously not there. It shoud be generated by this run.

2024-10-18 08:18:34.140 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗ 2024-10-18 08:18:34.141 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.6-beta1 ║ 2024-10-18 08:18:34.141 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝ 2024-10-18 08:18:34.141 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-10-18 08:18:34.144 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮ 2024-10-18 08:18:34.145 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │ 2024-10-18 08:18:34.145 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯ 2024-10-18 08:18:34.145 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.echodot'] 2024-10-18 08:18:34.145 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] chime_path = /media/sounds/alexa_notification.mp3 2024-10-18 08:18:34.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-10-18 08:18:34.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 200.0 2024-10-18 08:18:34.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-10-18 08:18:34.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = The garage door has closed. 2024-10-18 08:18:34.146 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-10-18 08:18:34.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-10-18 08:18:34.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-10-18 08:18:34.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = False 2024-10-18 08:18:34.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] fade_audio = False 2024-10-18 08:18:34.147 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1 2024-10-18 08:18:34.148 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-10-18 08:18:34.152 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-10-18 08:18:34.152 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] audio_conversion = -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 2024-10-18 08:18:34.152 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] media_players_array: 2024-10-18 08:18:34.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: entity_id: media_player.echodot 2024-10-18 08:18:34.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: alexa_media 2024-10-18 08:18:34.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: -1.0 2024-10-18 08:18:34.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: -1.0 2024-10-18 08:18:34.154 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False 2024-10-18 08:18:34.154 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False 2024-10-18 08:18:34.155 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False 2024-10-18 08:18:34.155 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮ 2024-10-18 08:18:34.155 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │ 2024-10-18 08:18:34.155 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯ 2024-10-18 08:18:34.156 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-10-18 08:18:34.168 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found: 2024-10-18 08:18:34.168 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "https://xxx.ui.nabu.casa/local/chime_tts/23i03qoc.mp3" 2024-10-18 08:18:34.168 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.184 2024-10-18 08:18:34.168 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None 2024-10-18 08:18:34.169 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None 2024-10-18 08:18:34.169 DEBUG (MainThread) [custom_components.chime_tts] Apply audio conversion 2024-10-18 08:18:34.169 WARNING (MainThread) [custom_components.chime_tts.helpers.helpers] Unable to perform FFmpeg conversion: source file not found on file system: /config/www/chime_tts/23i03qoc.mp3 2024-10-18 08:18:34.170 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮ 2024-10-18 08:18:34.170 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │ 2024-10-18 08:18:34.170 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯ 2024-10-18 08:18:34.170 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected: 2024-10-18 08:18:34.170 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot 2024-10-18 08:18:34.171 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data: 2024-10-18 08:18:34.171 DEBUG (MainThread) [custom_components.chime_tts] - message:

nimroddolev commented 1 month ago

I think the issue you're having is the same as another user who also opened a ticket.

Please refer to my response which should hopefully solve the issue for you. Please let me know if this solves your issue 👍

attila-szucs commented 1 month ago

Thanks for your efforts! A new warning has appeared when playing without caching: "RuntimeWarning: coroutine 'save_audio_to_folder' was never awaited". Caching is still no go, more and different errors appearing. Seems the audio file still not generated. Here comes the log:

2024-10-22 08:24:09.385 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ?????????????????????????????????????????????? 2024-10-22 08:24:09.385 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ? Chime TTS Say Called. Version v1.1.6-beta2 ? 2024-10-22 08:24:09.385 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ?????????????????????????????????????????????? 2024-10-22 08:24:09.385 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ?????????????????????? 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ? General Parameters ? 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ?????????????????????? 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.echodot'] 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] chime_path = /media/sounds/alexa_notification.mp3 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 200.0 2024-10-22 08:24:09.387 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = The garage door has closed. 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = False 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] fade_audio = False 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] audio_conversion = -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] media_players_array: 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: entity_id: media_player.echodot 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: alexa_media 2024-10-22 08:24:09.388 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: -1.0 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: -1.0 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ??????????????????? 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ? Preparing Audio ? 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ??????????????????? 2024-10-22 08:24:09.389 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-10-22 08:24:09.392 DEBUG (MainThread) [custom_components.chime_tts] Apply audio conversion 2024-10-22 08:24:09.393 WARNING (MainThread) [custom_components.chime_tts.helpers.helpers] Unable to perform FFmpeg conversion: source file not found on file system: /config/www/chime_tts/23i03qoc.mp3 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts] Using cached audio: 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "https://xxx.ui.nabu.casa/local/chime_tts/23i03qoc.mp3" 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.184 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ?????????????????????? 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ? Chime TTS playback ? 2024-10-22 08:24:09.393 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ?????????????????????? 2024-10-22 08:24:09.394 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected: 2024-10-22 08:24:09.394 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot 2024-10-22 08:24:09.394 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] File not found: /config/www/chime_tts/23i03qoc.mp3 2024-10-22 08:24:09.394 DEBUG (MainThread) [custom_components.chime_tts] Applying Alexa Media Player audio conversion for file: /config/www/chime_tts/23i03qoc.mp3 2024-10-22 08:24:09.394 WARNING (MainThread) [custom_components.chime_tts.helpers.helpers] Unable to perform FFmpeg conversion: source file not found on file system: /config/www/chime_tts/23i03qoc.mp3 2024-10-22 08:24:09.395 ERROR (MainThread) [custom_components.chime_tts.queue_manager] Error processing service call {'function': <function async_setup..async_say_execute at 0x7f3137a80ea0>, 'args': (<ServiceCall chime_tts.say (c:01JASEBB574G23J6YSW34PSEN9): chime_path=/media/sounds/alexa_notification.mp3, offset=200, message=The garage door has closed., tts_platform=cloud, audio_conversion=Alexa, cache=True, entity_id=['media_player.echodot']>, False), 'kwargs': {}, 'future': }: object of type 'bool' has no len() 2024-10-22 08:24:09.396 ERROR (MainThread) [custom_components.chime_tts] Error calling chime_tts.say service: object of type 'bool' has no len() 2024-10-22 08:24:09.397 ERROR (MainThread) [homeassistant.components.automation.garagedoor_closed] Garagedoor closed: Error executing script. Unexpected error for call_service at pos 2: object of type 'bool' has no len() Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 139, in async_say result = await queue.add_to_queue(async_say_execute, timeout, service, is_say_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/queue_manager.py", line 57, in _process_service_call result = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 187, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 304, in async_prepare_media play_result = await async_play_media( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1229, in async_play_media media_service_calls = prepare_media_service_calls(hass, entity_ids, service_data, audio_dict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1343, in prepare_media_service_calls if len(public_file) > 0: ^^^^^^^^^^^^^^^^ TypeError: object of type 'bool' has no len() 2024-10-22 08:24:09.404 ERROR (MainThread) [homeassistant.components.automation.garagedoor_closed] While executing automation automation.garagedoor_closed Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 742, in async_trigger return await self.action_script.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 139, in async_say result = await queue.add_to_queue(async_say_execute, timeout, service, is_say_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/queue_manager.py", line 57, in _process_service_call result = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 187, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 304, in async_prepare_media play_result = await async_play_media( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1229, in async_play_media media_service_calls = prepare_media_service_calls(hass, entity_ids, service_data, audio_dict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1343, in prepare_media_service_calls if len(public_file) > 0: ^^^^^^^^^^^^^^^^ TypeError: object of type 'bool' has no len()

pepe59 commented 1 month ago

Same problem v1.1.6-beta2

Tato chyba pochází z vlastní integrace.

Logger: py.warnings
Zdroj: custom_components/chime_tts/__init__.py:802
integrace: Chime TTS (dokumentace, problémy)
První výskyt: 23:00:05 (1 výskyty)
Naposledy logováno: 23:00:05

/config/custom_components/chime_tts/__init__.py:802: RuntimeWarning: coroutine 'save_audio_to_folder' was never awaited save_audio_to_folder(is_local, is_public, audio_dict, output_audio)
nimroddolev commented 1 month ago

Thank you @attila-szucs and @pepe59 for reporting the RuntimeWarning: coroutine 'save_audio_to_folder' was never awaited issue. I fixed it in v1.1.6-beta3. Can you please upgrade and let me know if the issue is resolved?

pepe59 commented 1 month ago

Yes, I can confirm that the error is removed in v1.1.6-beta3. Thank you.

nimroddolev commented 1 month ago

Excellent, thank you @pepe59.

@attila-szucs - can you please let me know if v1.1.6-beta3 fixes your issues with caching and generating new mp3 files?

attila-szucs commented 1 month ago

Thank you @nimroddolev. Yes, the RuntimeWarning has disappeared. Works perfectly without caching turned on. Caching is still problematic. It still believes that the file is already there, but it isn't. However the debug message notices it at one point with a "File not found" but goes on to use that non existent file. So, If I turn caching on, I get this:

`2024-10-25 19:08:40.570 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗ 2024-10-25 19:08:40.570 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.6-beta3 ║ 2024-10-25 19:08:40.571 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝ 2024-10-25 19:08:40.571 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-10-25 19:08:40.573 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮ 2024-10-25 19:08:40.574 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │ 2024-10-25 19:08:40.574 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯ 2024-10-25 19:08:40.574 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.echodot'] 2024-10-25 19:08:40.574 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] chime_path = /media/sounds/alexa_notification.mp3 2024-10-25 19:08:40.574 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-10-25 19:08:40.575 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 200.0 2024-10-25 19:08:40.575 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-10-25 19:08:40.575 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = The garage door has closed. 2024-10-25 19:08:40.575 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-10-25 19:08:40.575 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-10-25 19:08:40.576 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-10-25 19:08:40.576 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = False 2024-10-25 19:08:40.576 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] fade_audio = False 2024-10-25 19:08:40.576 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1 2024-10-25 19:08:40.576 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-10-25 19:08:40.576 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-10-25 19:08:40.580 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] audio_conversion = -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 2024-10-25 19:08:40.580 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] media_players_array: 2024-10-25 19:08:40.581 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: entity_id: media_player.echodot 2024-10-25 19:08:40.581 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: alexa_media 2024-10-25 19:08:40.581 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: -1.0 2024-10-25 19:08:40.581 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: -1.0 2024-10-25 19:08:40.582 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False 2024-10-25 19:08:40.582 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False 2024-10-25 19:08:40.582 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False 2024-10-25 19:08:40.582 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮ 2024-10-25 19:08:40.582 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │ 2024-10-25 19:08:40.583 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯ 2024-10-25 19:08:40.583 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-10-25 19:08:40.591 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/23i03qoc.mp3' 2024-10-25 19:08:40.592 DEBUG (MainThread) [custom_components.chime_tts] Using cached audio: 2024-10-25 19:08:40.592 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "https://xxx.ui.nabu.casa/local/chime_tts/23i03qoc.mp3" 2024-10-25 19:08:40.592 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.184 2024-10-25 19:08:40.592 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None 2024-10-25 19:08:40.592 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None 2024-10-25 19:08:40.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮ 2024-10-25 19:08:40.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │ 2024-10-25 19:08:40.593 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯ 2024-10-25 19:08:40.593 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected: 2024-10-25 19:08:40.593 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot 2024-10-25 19:08:40.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/23i03qoc.mp3' 2024-10-25 19:08:40.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File not found: /config/www/chime_tts/23i03qoc.mp3 2024-10-25 19:08:40.594 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/23i03qoc.mp3' 2024-10-25 19:08:40.594 DEBUG (MainThread) [custom_components.chime_tts] Applying Alexa Media Player audio conversion for file: /config/www/chime_tts/23i03qoc.mp3 2024-10-25 19:08:40.594 WARNING (MainThread) [custom_components.chime_tts.helpers.helpers] Unable to perform FFmpeg conversion: source file not found on file system: /config/www/chime_tts/23i03qoc.mp3 2024-10-25 19:08:40.595 ERROR (MainThread) [custom_components.chime_tts.queue_manager] Error processing service call {'function': <function async_setup..async_say_execute at 0x7f7f1ae24ea0>, 'args': (<ServiceCall chime_tts.say (c:01JB2ADMZQQ33HH99XPYP465A3): chime_path=/media/sounds/alexa_notification.mp3, offset=200, message=The garage door has closed., tts_platform=cloud, audio_conversion=Alexa, cache=True, entity_id=['media_player.echodot']>, False), 'kwargs': {}, 'future': }: object of type 'bool' has no len() 2024-10-25 19:08:40.597 ERROR (MainThread) [custom_components.chime_tts] Error calling chime_tts.say service: object of type 'bool' has no len() 2024-10-25 19:08:40.598 ERROR (MainThread) [homeassistant.components.automation.garazskapu_bezarult] Garázskapu bezárult: Error executing script. Unexpected error for call_service at pos 2: object of type 'bool' has no len() Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 139, in async_say result = await queue.add_to_queue(async_say_execute, timeout, service, is_say_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/queue_manager.py", line 57, in _process_service_call result = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 187, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 307, in async_prepare_media play_result = await async_play_media( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1231, in async_play_media media_service_calls = prepare_media_service_calls(hass, entity_ids, service_data, audio_dict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1345, in prepare_media_service_calls if len(public_file) > 0: ^^^^^^^^^^^^^^^^ TypeError: object of type 'bool' has no len() 2024-10-25 19:08:40.611 ERROR (MainThread) [homeassistant.components.automation.garazskapu_bezarult] While executing automation automation.garazskapu_bezarult Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 742, in async_trigger return await self.action_script.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 139, in async_say result = await queue.add_to_queue(async_say_execute, timeout, service, is_say_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/queue_manager.py", line 57, in _process_service_call result = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 187, in async_say_execute return await async_prepare_media(hass, params, options, media_players_array, is_say_url, start_time) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 307, in async_prepare_media play_result = await async_play_media( ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1231, in async_play_media media_service_calls = prepare_media_service_calls(hass, entity_ids, service_data, audio_dict) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/chime_tts/init.py", line 1345, in prepare_media_service_calls if len(public_file) > 0: ^^^^^^^^^^^^^^^^ TypeError: object of type 'bool' has no len()



``` `
nimroddolev commented 4 weeks ago

I have released a new beta, v1.1.6-beta4, which fixes the blocking call and hopefully the issue of the missing cached file.

attila-szucs commented 4 weeks ago

Thanks! Works much better! No warning or error messages. The first call with caching turned on, produces the infamous "simon says" message. This time the file is generated and it is present at the correct location, but still comes the "simon says" message. From the second call on, it works fine. See the 2 logs below (1st, 2nd call):

2024-10-29 08:43:39.490 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-10-29 08:43:39.491 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.6-beta4 ║
2024-10-29 08:43:39.491 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-10-29 08:43:39.491 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-10-29 08:43:39.496 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-29 08:43:39.496 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-10-29 08:43:39.496 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-29 08:43:39.496 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.echodot']
2024-10-29 08:43:39.497 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = /media/sounds/alexa_notification.mp3
2024-10-29 08:43:39.497 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-10-29 08:43:39.497 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 200.0
2024-10-29 08:43:39.497 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-10-29 08:43:39.497 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Végzett a szárítógép.
2024-10-29 08:43:39.497 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = cloud
2024-10-29 08:43:39.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-10-29 08:43:39.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-10-29 08:43:39.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-10-29 08:43:39.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-10-29 08:43:39.498 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-10-29 08:43:39.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-10-29 08:43:39.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-10-29 08:43:39.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-10-29 08:43:39.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: entity_id: media_player.echodot
2024-10-29 08:43:39.499 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: alexa_media
2024-10-29 08:43:39.500 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: -1.0
2024-10-29 08:43:39.501 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: -1.0
2024-10-29 08:43:39.502 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-10-29 08:43:39.502 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False
2024-10-29 08:43:39.502 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False
2024-10-29 08:43:39.502 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-10-29 08:43:39.502 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-10-29 08:43:39.503 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-10-29 08:43:39.503 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-10-29 08:43:39.511 DEBUG (MainThread) [custom_components.chime_tts] ...no cached audio found
2024-10-29 08:43:39.524 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/media/sounds/alexa_notification.mp3"...
2024-10-29 08:43:39.738 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 2.229s
2024-10-29 08:43:39.739 DEBUG (MainThread) [custom_components.chime_tts] - Attempting to retrieve TTS audio from cache...
2024-10-29 08:43:39.742 DEBUG (MainThread) [custom_components.chime_tts] ...no cached TTS audio found
2024-10-29 08:43:39.746 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-10-29 08:43:39.746 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'cloud'
2024-10-29 08:43:39.746 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Végzett a szárítógép.'
2024-10-29 08:43:39.746 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-10-29 08:43:39.746 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-10-29 08:43:39.746 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-10-29 08:43:40.253 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 510.0ms
2024-10-29 08:43:40.253 DEBUG (MainThread) [custom_components.chime_tts] - Saving generated TTS audio to cache...
2024-10-29 08:43:40.399 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /media/sounds/temp/chime_tts/w2sj3bv3.mp3
2024-10-29 08:43:40.400 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-10-29 08:43:40.400 DEBUG (MainThread) [custom_components.chime_tts] - key: "9aab8c57c1dab6fd4d27d796d5d94138e23f2d41333a12d1bc8b27362457a31a"
2024-10-29 08:43:40.400 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/w2sj3bv3.mp3', 'audio_duration': 2.568}"
2024-10-29 08:43:40.404 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio saved to cache
2024-10-29 08:43:40.431 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to public folder: /config/www/chime_tts/...
2024-10-29 08:43:40.688 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /config/www/chime_tts/5y6ioe2m.mp3
2024-10-29 08:43:40.901 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-29 08:43:40.901 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-10-29 08:43:40.901 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 4.997
2024-10-29 08:43:40.901 DEBUG (MainThread) [custom_components.chime_tts] * local_path = None
2024-10-29 08:43:40.902 DEBUG (MainThread) [custom_components.chime_tts] * public_path = "https://xxx.ui.nabu.casa/local/chime_tts/5y6ioe2m.mp3"
2024-10-29 08:43:40.902 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = None
2024-10-29 08:43:40.908 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-29 08:43:40.908 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-10-29 08:43:40.908 DEBUG (MainThread) [custom_components.chime_tts] - key: "081f4b69f3e5897d920c4c9cb185de4185672a5e8b112d7e8e2a5ea34616a4f3"
2024-10-29 08:43:40.909 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'public_path': 'https://xxx.ui.nabu.casa/local/chime_tts/5y6ioe2m.mp3', 'audio_duration': 4.997}"
2024-10-29 08:43:40.913 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-29 08:43:40.914 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-10-29 08:43:40.914 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-29 08:43:40.914 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected:
2024-10-29 08:43:40.914 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot
2024-10-29 08:43:40.914 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-29 08:43:41.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File failed compatibility requirements: /config/www/chime_tts/5y6ioe2m.mp3
2024-10-29 08:43:41.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-29 08:43:41.001 DEBUG (MainThread) [custom_components.chime_tts] Applying Alexa Media Player audio conversion for file: /config/www/chime_tts/5y6ioe2m.mp3
2024-10-29 08:43:41.090 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File failed compatibility requirements: /config/www/chime_tts/5y6ioe2m.mp3
2024-10-29 08:43:41.091 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFmpeg operation: "ffmpeg -i /config/www/chime_tts/5y6ioe2m.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/5y6ioe2m_converted.mp3"
2024-10-29 08:43:41.298 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data:
2024-10-29 08:43:41.298 DEBUG (MainThread) [custom_components.chime_tts] - message: <audio src='/config/www/chime_tts/5y6ioe2m.mp3'/>
2024-10-29 08:43:41.298 DEBUG (MainThread) [custom_components.chime_tts] - data: {'type': 'tts'}
2024-10-29 08:43:41.298 DEBUG (MainThread) [custom_components.chime_tts] - target: ['media_player.echodot']
2024-10-29 08:43:41.299 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 4.997s for audio playback to complete...
2024-10-29 08:43:46.298 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 1 media_player isn't playing...
2024-10-29 08:43:46.298 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.echodot
2024-10-29 08:43:46.299 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭──────────────────────────────────────────╮
2024-10-29 08:43:46.299 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 6.8 s ────│
2024-10-29 08:43:46.299 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰──────────────────────────────────────────╯

Second call, works fine:

2024-10-29 08:49:39.649 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-10-29 08:49:39.650 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.6-beta4 ║
2024-10-29 08:49:39.650 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-10-29 08:49:39.650 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-10-29 08:49:39.655 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-29 08:49:39.656 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-10-29 08:49:39.656 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-29 08:49:39.656 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.echodot']
2024-10-29 08:49:39.657 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = /media/sounds/alexa_notification.mp3
2024-10-29 08:49:39.657 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-10-29 08:49:39.657 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 200.0
2024-10-29 08:49:39.657 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-10-29 08:49:39.658 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Végzett a szárítógép.
2024-10-29 08:49:39.658 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = cloud
2024-10-29 08:49:39.658 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-10-29 08:49:39.658 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-10-29 08:49:39.658 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-10-29 08:49:39.659 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-10-29 08:49:39.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-10-29 08:49:39.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-10-29 08:49:39.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-10-29 08:49:39.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-10-29 08:49:39.660 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: entity_id: media_player.echodot
2024-10-29 08:49:39.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: alexa_media
2024-10-29 08:49:39.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: -1.0
2024-10-29 08:49:39.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: -1.0
2024-10-29 08:49:39.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-10-29 08:49:39.661 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False
2024-10-29 08:49:39.662 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False
2024-10-29 08:49:39.662 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-10-29 08:49:39.662 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-10-29 08:49:39.662 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-10-29 08:49:39.662 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-10-29 08:49:39.671 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-29 08:49:39.680 DEBUG (MainThread) [custom_components.chime_tts] Using cached audio:
2024-10-29 08:49:39.680 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "https://xxx.ui.nabu.casa/local/chime_tts/5y6ioe2m.mp3"
2024-10-29 08:49:39.680 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 4.997
2024-10-29 08:49:39.681 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None
2024-10-29 08:49:39.681 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None
2024-10-29 08:49:39.681 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-29 08:49:39.681 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-10-29 08:49:39.681 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-29 08:49:39.681 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected:
2024-10-29 08:49:39.682 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot
2024-10-29 08:49:39.682 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-29 08:49:39.775 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data:
2024-10-29 08:49:39.775 DEBUG (MainThread) [custom_components.chime_tts] - message: <audio src='https://xxx.ui.nabu.casa/local/chime_tts/5y6ioe2m.mp3'/>
2024-10-29 08:49:39.775 DEBUG (MainThread) [custom_components.chime_tts] - data: {'type': 'tts'}
2024-10-29 08:49:39.775 DEBUG (MainThread) [custom_components.chime_tts] - target: ['media_player.echodot']
2024-10-29 08:49:39.776 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 4.997s for audio playback to complete...
2024-10-29 08:49:44.776 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 1 media_player isn't playing...
2024-10-29 08:49:44.776 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.echodot
2024-10-29 08:49:44.776 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-10-29 08:49:44.776 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 5.12 s ────│
2024-10-29 08:49:44.776 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯
nimroddolev commented 4 weeks ago

That's great, thanks for spotting that. I just released a new beta, v1.1.6-beta5 which hopefully fixes the issue. Could you please upgrade and let me know if it's now resolved?

attila-szucs commented 3 weeks ago

Great, thanks! Now everything works fine in my environment. Cleared cache, checked if the files are deleted. Yes they are. First and following calls work fine. I have only one warning message "Unable to generate local audio filepath" at the first call, but the file is correctly generated and played Ok. Here is the log from the first call with the warning:

2024-10-30 09:07:00.718 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-10-30 09:07:00.719 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.6-beta5 ║
2024-10-30 09:07:00.719 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-10-30 09:07:00.719 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-10-30 09:07:00.725 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-30 09:07:00.725 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-10-30 09:07:00.725 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-30 09:07:00.726 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.echodot']
2024-10-30 09:07:00.726 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = /media/sounds/alexa_notification.mp3
2024-10-30 09:07:00.726 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-10-30 09:07:00.726 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 200.0
2024-10-30 09:07:00.726 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-10-30 09:07:00.727 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Végzett a szárítógép.
2024-10-30 09:07:00.727 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = cloud
2024-10-30 09:07:00.727 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-10-30 09:07:00.727 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-10-30 09:07:00.727 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-10-30 09:07:00.728 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = False
2024-10-30 09:07:00.728 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-10-30 09:07:00.728 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-10-30 09:07:00.728 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-10-30 09:07:00.728 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array:
2024-10-30 09:07:00.729 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - 0: entity_id: media_player.echodot
2024-10-30 09:07:00.729 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] platform: alexa_media
2024-10-30 09:07:00.729 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] initial volume: -1.0
2024-10-30 09:07:00.729 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] target volume: -1.0
2024-10-30 09:07:00.729 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] now playing: False
2024-10-30 09:07:00.730 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join supported: False
2024-10-30 09:07:00.730 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce supported: False
2024-10-30 09:07:00.730 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-10-30 09:07:00.730 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-10-30 09:07:00.730 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-10-30 09:07:00.731 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-10-30 09:07:00.744 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/5y6ioe2m.mp3'
2024-10-30 09:07:00.748 DEBUG (MainThread) [custom_components.chime_tts] No cached audio found on filesystem
2024-10-30 09:07:00.765 DEBUG (MainThread) [custom_components.chime_tts] ...no cached audio found
2024-10-30 09:07:00.772 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/media/sounds/alexa_notification.mp3"...
2024-10-30 09:07:00.965 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 2.229s
2024-10-30 09:07:00.966 DEBUG (MainThread) [custom_components.chime_tts] - Attempting to retrieve TTS audio from cache...
2024-10-30 09:07:00.971 WARNING (MainThread) [custom_components.chime_tts] Unable to generate local audio filepath
2024-10-30 09:07:00.973 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-10-30 09:07:00.973 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'cloud'
2024-10-30 09:07:00.973 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Végzett a szárítógép.'
2024-10-30 09:07:00.973 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-10-30 09:07:00.973 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-10-30 09:07:00.973 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-10-30 09:07:01.474 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 500.0ms
2024-10-30 09:07:01.513 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to public folder: /config/www/chime_tts/...
2024-10-30 09:07:01.788 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /config/www/chime_tts/nqdh7p7w.mp3
2024-10-30 09:07:01.998 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/nqdh7p7w.mp3'
2024-10-30 09:07:01.998 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-10-30 09:07:01.998 DEBUG (MainThread) [custom_components.chime_tts] * audio_duration = 4.997
2024-10-30 09:07:01.998 DEBUG (MainThread) [custom_components.chime_tts] * local_path = None
2024-10-30 09:07:01.998 DEBUG (MainThread) [custom_components.chime_tts] * public_path = "https://xxx.ui.nabu.casa/local/chime_tts/nqdh7p7w.mp3"
2024-10-30 09:07:01.998 DEBUG (MainThread) [custom_components.chime_tts] * media_content_id = None
2024-10-30 09:07:02.004 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/nqdh7p7w.mp3'
2024-10-30 09:07:02.004 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-10-30 09:07:02.004 DEBUG (MainThread) [custom_components.chime_tts] - key: "081f4b69f3e5897d920c4c9cb185de4185672a5e8b112d7e8e2a5ea34616a4f3"
2024-10-30 09:07:02.004 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'public_path': 'https://xxx.ui.nabu.casa/local/chime_tts/nqdh7p7w.mp3', 'audio_duration': 4.997}"
2024-10-30 09:07:02.008 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-10-30 09:07:02.008 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-10-30 09:07:02.008 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-10-30 09:07:02.008 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected:
2024-10-30 09:07:02.009 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot
2024-10-30 09:07:02.009 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/nqdh7p7w.mp3'
2024-10-30 09:07:02.096 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File is not Alexa Media Player compatibile: /config/www/chime_tts/nqdh7p7w.mp3
2024-10-30 09:07:02.097 DEBUG (MainThread) [custom_components.chime_tts] Applying Alexa Media Player audio conversion for file: https://xxx.ui.nabu.casa/local/chime_tts/nqdh7p7w.mp3
2024-10-30 09:07:02.097 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local file path for external URL is '/config/www/chime_tts/nqdh7p7w.mp3'
2024-10-30 09:07:02.183 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File is not Alexa Media Player compatibile: /config/www/chime_tts/nqdh7p7w.mp3
2024-10-30 09:07:02.184 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFmpeg operation: "ffmpeg -i /config/www/chime_tts/nqdh7p7w.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/nqdh7p7w_converted.mp3"
2024-10-30 09:07:02.429 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data:
2024-10-30 09:07:02.429 DEBUG (MainThread) [custom_components.chime_tts] - message: <audio src='https://xxx.ui.nabu.casa/local/chime_tts/nqdh7p7w.mp3'/>
2024-10-30 09:07:02.429 DEBUG (MainThread) [custom_components.chime_tts] - data: {'type': 'tts'}
2024-10-30 09:07:02.429 DEBUG (MainThread) [custom_components.chime_tts] - target: ['media_player.echodot']
2024-10-30 09:07:02.430 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 4.997s for audio playback to complete...
2024-10-30 09:07:07.430 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] - Waiting until 1 media_player isn't playing...
2024-10-30 09:07:07.430 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper] ✔ media_player.echodot
2024-10-30 09:07:07.430 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-10-30 09:07:07.431 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 6.71 s ────│
2024-10-30 09:07:07.431 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯
nimroddolev commented 3 weeks ago

Hi @attila-szucs,

I'm glad it's now working for you 👍 I have made a small fix to handle the warning log message better, and will add it to the upcoming stable release.

attila-szucs commented 3 weeks ago

Great, Thank you!