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
147 stars 12 forks source link

'Unable to create public URL' after update to v1.0.0 #107

Closed mgoettelman closed 2 months ago

mgoettelman commented 2 months ago

System Health details

System Information

version core-2024.4.1
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.20-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 | 4709 Installed Version | 1.34.0 Stage | running Available Repositories | 1405 Downloaded Repositories | 46
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | August 29, 2024 at 8:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | false remote_server | us-east-1-4.ui.nabu.casa certificate_status | ready instance_id | 1d1a3fd1021140f5b07f0267b46a301c can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.03.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 234.0 GB disk_used | 16.4 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Z-Wave JS UI (3.4.1), Spotify Connect (0.13.0), Advanced SSH & Web Terminal (17.2.0), File editor (5.8.0), Mosquitto broker (6.4.0), RTSP Simple Server Add-on (v0.17.6), eufy-security-ws (1.8.0-2), Home Assistant Google Drive Backup (0.112.1), Fireboard 2 MQTT (3.1.1), Silicon Labs Multiprotocol (2.4.4), Music Assistant BETA (2.0.0b131), Govee to MQTT Bridge (2024.01.24-ea3cd430)
Dashboards dashboards | 7 -- | -- resources | 25 views | 29 mode | storage
Recorder oldest_recorder_run | March 28, 2024 at 12:07 AM -- | -- current_recorder_run | April 5, 2024 at 8:20 PM estimated_db_size | 540.39 MiB database_engine | sqlite database_version | 3.44.2
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

After updating to v1.0.0, all of my 'Chime TTS: Say' actions fail, with logs stating that is is unable to create a public URL and that the mp3 generated is s outside the public folder. My configuration is below, which was not changed since the update

Media folder (default 'local') local Folder path to store downloaded chime audio files /media/sounds/temp/chime_tts/chimes/ Folder path to store tempoary TTS audio mp3 files /media/sounds/temp/chime_tts/ Folder path to save Chime TTS mp3s generated by chime_tts.say_url /www/chime_tts/

I only use Alexa devices via the 'Chime TTS: Say' service. Normal TTS service works fine. I've since reverted back to v0.13 and it again works perfectly. This is my first issue report, please let me know if theres anything else I can provide. Thanks!

Reproduction steps

service: chime_tts.say target: device_id:

Debug logs

2024-04-05 20:47:21.103 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.0.0 -----
2024-04-05 20:47:21.104 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-05 20:47:21.112 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  players found: [{'entity_id': 'media_player.basement_echo', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': False, 'announce_supported': False, 'resume_media_player': False}, {'entity_id': 'media_player.pluto', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': False, 'announce_supported': False, 'resume_media_player': False}]
2024-04-05 20:47:21.114 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-05 20:47:21.116 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.basement_echo', 'media_player.pluto']
2024-04-05 20:47:21.116 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = bells
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 2000.0
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = The big garage door is open
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = cloud
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = True
2024-04-05 20:47:21.117 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1.0
2024-04-05 20:47:21.118 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-04-05 20:47:21.118 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-04-05 20:47:21.118 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-04-05 20:47:21.118 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] --- Audio will be converted to Alexa-friendly format as Alexa speaker/s detected ---
2024-04-05 20:47:21.121 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-04-05 20:47:21.128 DEBUG (MainThread) [custom_components.chime_tts] ...no cached audio found
2024-04-05 20:47:21.128 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "custom_components/chime_tts/mp3s/bells.mp3"...
2024-04-05 20:47:21.232 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 0.944s
2024-04-05 20:47:21.232 DEBUG (MainThread) [custom_components.chime_tts] - Attempting to retrieve TTS audio from cache...
2024-04-05 20:47:21.233 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/media/sounds/temp/chime_tts/hevrt250.mp3"...
2024-04-05 20:47:21.336 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 2.544s
2024-04-05 20:47:21.340 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /www/chime_tts/...
2024-04-05 20:47:21.429 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /www/chime_tts/y5927lk6.mp3
2024-04-05 20:47:21.429 DEBUG (MainThread) [custom_components.chime_tts] - Performing FFmpeg audio conversion...
2024-04-05 20:47:21.429 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Converting audio: "ffmpeg -i /www/chime_tts/y5927lk6.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /www/chime_tts/y5927lk6_converted.mp3"
2024-04-05 20:47:21.530 DEBUG (MainThread) [custom_components.chime_tts] ...FFmpeg audio conversion completed.
2024-04-05 20:47:21.641 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-04-05 20:47:21.641 DEBUG (MainThread) [custom_components.chime_tts] - key: "4b9f78cc3542e79abd57cbaeeb0b69ed770f70c4ab812a6e31a9ee33c92b8dfe"
2024-04-05 20:47:21.641 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'public_path': '/www/chime_tts/y5927lk6.mp3', 'audio_duration': 4.008}"
2024-04-05 20:47:21.646 WARNING (MainThread) [custom_components.chime_tts.helpers.filesystem] Unable to create public URL - File: '/www/chime_tts/y5927lk6.mp3' is outside the public folder.
2024-04-05 20:47:21.646 ERROR (MainThread) [custom_components.chime_tts] async_get_playback_audio_path --> Unable to generate public audio file
2024-04-05 20:47:21.646 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 540.0 ms -----

Diagnostics dump

No response

nimroddolev commented 2 months ago

Hi @mgoettelman, I’m sorry you’ve been experiencing issues with the new version.

Can you please try changing the chime_tts.say_url folder path in the configuration to: /config/www/chime_tts/ ?

mgoettelman commented 2 months ago

Ok, I tried and it seems to generate the file sucessfully but now im getting the "Sorry, I'm having trouble accessing your simon says skill" message on all of my alexa devices. I've tried using the alexa conversion option, toggling announce on/off and always the simon error. FWIW it will play fine on an airplay device. Below is an example of what I'm trying:

service: chime_tts.say metadata: {} data: offset: 450 final_delay: 0 tts_speed: 100 tts_pitch: 0 audio_conversion: Alexa message: "this is a test announcement " tts_platform: cloud announce: true cache: true target: entity_id: media_player.pluto

With debugs below:

2024-04-06 12:01:52.120 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.0.0 ----- 2024-04-06 12:01:52.120 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-04-06 12:01:52.122 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ```Media players found: [{'entity_id': 'media_player.pluto', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': False, 'announce_supported': False, 'resume_media_player': False}] 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.pluto'] 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 450.0 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = this is a test announcement 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-04-06 12:01:52.123 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-04-06 12:01:52.124 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-04-06 12:01:52.124 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = True 2024-04-06 12:01:52.124 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1.0 2024-04-06 12:01:52.124 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-04-06 12:01:52.124 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-04-06 12:01:52.124 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-04-06 12:01:52.127 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found: 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "http://192.168.1.2:8123/local/chime_tts/ejd0k0b6.mp3" 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 2.496 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] Pre-Playback Actions 2024-04-06 12:01:52.137 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS playback 2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected: 2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] - media_player.pluto 2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data: 2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] - message:

Thanks again for the help, really appreciate this integration!

dbullendsl commented 2 months ago

The "simon says" error is essentially a generic error that get's reported if any of several conditions exist. 1) data is not formatted correctly. 2) Alexa's can't access the file thru a secure link, eg. https://yourserver.whatever.com/. Try using the say_url function and see what the resulting URL comes back as.

mgoettelman commented 2 months ago

After downgrading back to v0.13, everything again works properly with no simon error. Below is what works properly on v13

service: chime_tts.say metadata: {} data: chime_path: "" end_chime_path: "" offset: 450 final_delay: 0 tts_playback_speed: 100 volume_level: 1 message: this is a test announcement tts_platform: cloud cache: true announce: true target: entity_id: media_player.pluto

2024-04-06 15:57:34.774 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.13.0 ----- 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters ----- 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] entity_ids = ['media_player.pluto'] 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] cache = True 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] offset = 450.0 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] final_delay = 0.0 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] message = this is a test announcement 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] tts_platform = cloud 2024-04-06 15:57:34.775 DEBUG (MainThread) [custom_components.chime_tts.helpers] tts_playback_speed = 100.0 2024-04-06 15:57:34.776 DEBUG (MainThread) [custom_components.chime_tts.helpers] announce = True 2024-04-06 15:57:34.776 DEBUG (MainThread) [custom_components.chime_tts.helpers] volume_level = 1.0 2024-04-06 15:57:34.776 DEBUG (MainThread) [custom_components.chime_tts.helpers] join_players = False 2024-04-06 15:57:34.776 DEBUG (MainThread) [custom_components.chime_tts.helpers] * unjoin_players = False 2024-04-06 15:57:34.776 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path 2024-04-06 15:57:34.776 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] Using previously generated mp3 saved in cache 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/5sec0ur2.mp3', 'audio_duration': 2.448} 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - Setting 'media_player.pluto' volume level to 1.0 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.pluto", 1.0) 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - Skipped setting volume 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data: 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/5sec0ur2.mp3 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - announce: True 2024-04-06 15:57:34.777 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.pluto'] 2024-04-06 15:57:34.780 DEBUG (MainThread) [custom_components.chime_tts] ...media_player.play_media completed. 2024-04-06 15:57:34.780 DEBUG (MainThread) [custom_components.chime_tts] Waiting 2.448s for audio playback to complete... 2024-04-06 15:57:37.229 DEBUG (MainThread) [custom_components.chime_tts] Returning media_player.pluto's volume level to 1.0 2024-04-06 15:57:37.229 DEBUG (MainThread) [custom_components.chime_tts] - async_set_volume_level("media_player.pluto", 1.0) 2024-04-06 15:57:37.229 DEBUG (MainThread) [custom_components.chime_tts] - Skipped setting volume 2024-04-06 15:57:37.230 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 2455.174 ms -----

It seems that the v0.13 uses the "media_content_id: media-source://media_source/local/sounds/temp/chime_tts/5sec0ur2.mp3" where as v1.0 shows "media_content_id = None"?

mgoettelman commented 2 months ago

And here is when I try the chime_tts.say_url service:

service: chime_tts.say_url metadata: {} data: offset: 450 final_delay: 0 tts_speed: 100 tts_pitch: 0 message: this is a test announcement tts_platform: cloud cache: true audio_conversion: Alexa response_variable: chime_tts

2024-04-06 16:15:00.639 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say URL Called. Version v1.0.0 ----- 2024-04-06 16:15:00.640 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-04-06 16:15:00.640 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-04-06 16:15:00.640 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = [] 2024-04-06 16:15:00.640 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = True 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 450.0 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = this is a test announcement 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = False 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1.0 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-04-06 16:15:00.641 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-04-06 16:15:00.642 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-04-06 16:15:00.642 DEBUG (MainThread) [custom_components.chime_tts] Checking Chime TTS audio cache 2024-04-06 16:15:00.652 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found: 2024-04-06 16:15:00.652 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/5sec0ur2.mp3" 2024-04-06 16:15:00.652 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "http://192.168.1.2:8123/local/chime_tts/5sec0ur2.mp3" 2024-04-06 16:15:00.653 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 2.448 2024-04-06 16:15:00.653 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/5sec0ur2.mp3" 2024-04-06 16:15:00.653 DEBUG (MainThread) [custom_components.chime_tts] Final URL = http://192.168.1.2:8123/local/chime_tts/5sec0ur2.mp3 2024-04-06 16:15:00.653 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say URL Completed in 10.0 ms -----

The public path that is generated "public_path = "http://192.168.1.2:8123/local/chime_tts/5sec0ur2.mp3" is my internal IP address, so I'm sure that cant be correct.

nimroddolev commented 2 months ago

Thanks for the additional debug logs for the different versions and service calls.

It appears you were able to use the chime_tts.say service in v0.13.0 with your Alexa device, which goes against my previous understanding that Alexa media players cannot play audio from the media_player.play_media service, and require a publicly available URL in a service call to notify.alexa_media. This is how Chime TTS handles Alexa media players v1.0.0. I don't own any Alexa hardware so I have had to rely on feedback from users who do.

Additionally, I noticed in your logs for v1.0.0, when calling the chime_tts.say service, that the message value was blank when calling notify.alexa_media instead of the audio's URL:

2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected:
2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] - media_player.pluto
2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data:
2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] - message:
2024-04-06 12:01:52.138 DEBUG (MainThread) [custom_components.chime_tts] - data: {'type': 'tts'}
2024-04-06 12:01:52.139 DEBUG (MainThread) [custom_components.chime_tts] - target: ['media_player.pluto']
2024-04-06 12:01:52.140 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 2.496s for audio playback to complete...

This might be related to a caching issue. Can you please try calling the service again with either a new (uncached) message string or with cache set to false?


Regarding your internal IP being included in the URL from chime_tts.say_url: Perhaps there's an issue with the external URL configured in your Home Assistant instance? You please see your external URL under Settings --> System --> Network --> Home Assistant URL.

mgoettelman commented 2 months ago

Here is the non-cached attempt:

service: chime_tts.say metadata: {} data: offset: 450 final_delay: 0 tts_speed: 100 tts_pitch: 0 message: This is a test announcement tts_platform: cloud audio_conversion: Alexa announce: true target: entity_id: media_player.pluto_old

2024-04-07 06:30:10.450 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.0.0 ----- 2024-04-07 06:30:10.451 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-04-07 06:30:10.453 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ```Media players found: [{'entity_id': 'media_player.pluto_old', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': False, 'announce_supported': False, 'resume_media_player': False}] 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.pluto_old'] 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = False 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 450.0 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = This is a test announcement 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = True 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1.0 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-04-07 06:30:10.454 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-04-07 06:30:10.454 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-04-07 06:30:10.456 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters: 2024-04-07 06:30:10.457 DEBUG (MainThread) [custom_components.chime_tts] tts_platform = 'cloud' 2024-04-07 06:30:10.457 DEBUG (MainThread) [custom_components.chime_tts] message = 'This is a test announcement' 2024-04-07 06:30:10.457 DEBUG (MainThread) [custom_components.chime_tts] cache = False 2024-04-07 06:30:10.457 DEBUG (MainThread) [custom_components.chime_tts] language = None 2024-04-07 06:30:10.457 DEBUG (MainThread) [custom_components.chime_tts] options = {} 2024-04-07 06:30:10.566 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 110.0ms 2024-04-07 06:30:10.567 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /config/www/chime_tts/... 2024-04-07 06:30:10.646 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /config/www/chime_tts/tdqhtncf.mp3 2024-04-07 06:30:10.646 DEBUG (MainThread) [custom_components.chime_tts] - Performing FFmpeg audio conversion... 2024-04-07 06:30:10.646 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Converting audio: "ffmpeg -i /config/www/chime_tts/tdqhtncf.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/tdqhtncf_converted.mp3" 2024-04-07 06:30:10.726 DEBUG (MainThread) [custom_components.chime_tts] ...FFmpeg audio conversion completed. 2024-04-07 06:30:10.834 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage: 2024-04-07 06:30:10.834 DEBUG (MainThread) [custom_components.chime_tts] - key: "936703d40f5027134037f9e39788b64f51c65d43e1e2a34082ae8008338c97ca" 2024-04-07 06:30:10.834 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'public_path': '/config/www/chime_tts/tdqhtncf.mp3', 'audio_duration': 2.496, 'local_path': None}" 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated: 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 2.496 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "http://192.168.1.2:8123/local/chime_tts/tdqhtncf.mp3" 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] Pre-Playback Actions 2024-04-07 06:30:10.839 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS playback 2024-04-07 06:30:10.842 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected: 2024-04-07 06:30:10.843 DEBUG (MainThread) [custom_components.chime_tts] - media_player.pluto_old 2024-04-07 06:30:10.843 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data: 2024-04-07 06:30:10.843 DEBUG (MainThread) [custom_components.chime_tts] - message:

My external URL is set as "Use Home Assistant Cloud" through Nabu Casa. FWIW I had similar "simon" errors when I first started using chime until I set my Alexa Media Player intergration to use my Nabu Casa "***.ui.nabu.casa/" external address.

nimroddolev commented 2 months ago

Thanks again for the debug logs.

In term of the public URL using your IP address instead of the Nabu Casa address: I think there's a chance that the IP address might be stored in the Chime TTS data. Could you please try removing the integration from the integration page (go to: Settings --> Devices & services --> integrations --> Chime TTS --> --> Delete) and then re-add Chime TTS? Make sure to copy any other configuration settings beforehand so you can add them back afterwards.

I still see the same blank message data parameter. Later today I hope to find and resolve the issue and release a new beta with a fix.

mgoettelman commented 2 months ago

Ok, I deleted integration > removed from HACS > restart > add to HACS > restart > added integration:

2024-04-07 07:10:58.283 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.0.0 ----- 2024-04-07 07:10:58.283 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue 2024-04-07 07:10:58.286 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ```Media players found: [{'entity_id': 'media_player.pluto_old', 'should_change_volume': False, 'initial_volume_level': -1, 'group_members_supported': False, 'announce_supported': False, 'resume_media_player': False}] 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters ----- 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] entity_ids = ['media_player.pluto_old'] 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] cache = False 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] offset = 450.0 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] final_delay = 0.0 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] message = this is a test announcement 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_platform = cloud 2024-04-07 07:10:58.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_speed = 100.0 2024-04-07 07:10:58.288 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] tts_pitch = 0 2024-04-07 07:10:58.288 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] announce = True 2024-04-07 07:10:58.288 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] volume_level = -1.0 2024-04-07 07:10:58.289 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] join_players = False 2024-04-07 07:10:58.289 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] unjoin_players = False 2024-04-07 07:10:58.289 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-04-07 07:10:58.294 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters: 2024-04-07 07:10:58.294 DEBUG (MainThread) [custom_components.chime_tts] tts_platform = 'cloud' 2024-04-07 07:10:58.294 DEBUG (MainThread) [custom_components.chime_tts] message = 'this is a test announcement' 2024-04-07 07:10:58.294 DEBUG (MainThread) [custom_components.chime_tts] cache = False 2024-04-07 07:10:58.294 DEBUG (MainThread) [custom_components.chime_tts] language = None 2024-04-07 07:10:58.294 DEBUG (MainThread) [custom_components.chime_tts] options = {} 2024-04-07 07:10:58.406 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 110.0ms 2024-04-07 07:10:58.406 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /config/www/chime_tts/... 2024-04-07 07:10:58.485 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /config/www/chime_tts/7hav02h8.mp3 2024-04-07 07:10:58.485 DEBUG (MainThread) [custom_components.chime_tts] - Performing FFmpeg audio conversion... 2024-04-07 07:10:58.485 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Converting audio: "ffmpeg -i /config/www/chime_tts/7hav02h8.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/7hav02h8_converted.mp3" 2024-04-07 07:10:58.567 DEBUG (MainThread) [custom_components.chime_tts] ...FFmpeg audio conversion completed. 2024-04-07 07:10:58.673 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage: 2024-04-07 07:10:58.673 DEBUG (MainThread) [custom_components.chime_tts] - key: "d75205e6d00c8d8f76a679b38daba320dbae8cbfa43fad19a2ef0b4bdc71644a" 2024-04-07 07:10:58.673 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/5sec0ur2.mp3', 'public_path': '/config/www/chime_tts/7hav02h8.mp3', 'audio_duration': 2.448}" 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated: 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 2.496 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "http://192.168.1.2:8123/local/chime_tts/7hav02h8.mp3" 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] Pre-Playback Actions 2024-04-07 07:10:58.680 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS playback 2024-04-07 07:10:58.683 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected: 2024-04-07 07:10:58.683 DEBUG (MainThread) [custom_components.chime_tts] - media_player.pluto_old 2024-04-07 07:10:58.683 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data: 2024-04-07 07:10:58.683 DEBUG (MainThread) [custom_components.chime_tts] - message:

It doesnt seem to pull my nabu casa address as my public path, instead using the local IP?

nimroddolev commented 2 months ago

I meant for you to remove the integration from the integration page, not to reinstall it.

Please remove the integration from Settings --> Devices & services --> integrations --> Chime TTS --> --> Delete

Screenshot 2024-04-07 at 14 20 47

mgoettelman commented 2 months ago

yes, i did that, plus i reinstalled it

nimroddolev commented 2 months ago

I think I might have found a potential solution: I think you might not have your external address registered in your configuration.yaml file.

Can you please add the following under homeassistant ?

homeassistant:
  external_url: "https://YOUR_UNIQUE_ADDRESS.ui.nabu.casa/"
  internal_url: "http://192.168.X.X:8123/"
mgoettelman commented 2 months ago

YES! Thats it - it works perfectly now. Thank you! No idea why that wasnt specified in my config file

Of note to anyone else with the same issue, I did have to run the Chime TTS: Clear Cache service to get my previously cached automations to work

nimroddolev commented 2 months ago

Glad to hear it’s working for you!