Giter Club home page Giter Club logo

chime_tts's Introduction

Chime TTS

hacs_badge version Community Forum

Chime TTS is a custom Home Assistant integration that eliminates the audio lag between playing a chime/notification sound effect before a TTS audio notification.

If you find Chime TTS useful, consider showing your support: Buy Me A Coffee


What is Chime TTS?

Chime TTS is a custom Home Assistant integration that locally combines TTS audio and sound effects into seamless audio for playback in a single service call, eliminating the lag. Chime TTS includes a suite of options to further customize the audio.

The Problem:

Latency is introduced between the notification chime and the TTS audio

The Solution:

Chime TTS removes the latency between the notification chime and the TTS audio

Chime TTS solves this issue by stitching the audio files together as a single file locally on your Home Assistant device, and played to your speakers in a single event, eliminating any lag.


Features

Chime TTS offers various features that enhance TTS audio playback experience:

  • No lag or timing issues: Precise timing between audio files without cloud TTS delays.
  • Customizable audio cues: Play preset or custom audio before and after TTS messages.
  • Flexible TTS platform selection: Supports various TTS platform integrations.
  • Easy service invocation: Use the chime_tts.say and chime_tts.say_url services in automations and scripts.
  • Set media player volume: Notifications can be played at a defined volume and restored after playback.
  • Restore previous audio: Chime TTS supports pausing and resuming currently playing audio beyond the media player platforms supported by Home Assistant (eg: HomePods).
  • Mix and match TTS platforms: Combine TTS audio using multiple TTS platforms within the same audio announcement.
  • Configurable TTS speed: Set the TTS audio speed anywhere from 1-500%.
  • Configurable TTS pitch: Set the pitch for TTS audio, allowing for more customization.
  • Support for FFmpeg arguments: Apply FFmpeg jobs to the generated audio, or specific jobs to specific chimes and TTS audio segments.
  • Configurable delay: Set custom delays between chimes & TTS audio.
  • Configurable overlay: Set custom overlay durations between chimes & TTS audio.
  • Caching: Cache audio for faster playback.
  • Speaker Groups: Group speakers for simultaneous playback (on supported platforms).

Quick Start

Follow these easy steps to get started with Chime TTS:

  1. Installation - Quickly install Chime TTS via HACS or manually.
  2. Add the Integration - Add Chime TTS to your Home Assistant instance.

How Do I Use It?

Services

Chime TTS adds 4 new services to your Home Assistant instance: chime_tts.say, chime_tts.say_url, chime_tts.replay and chime_tts.clear_cache. Discover how you can use these services and the features they offer:


Configuration & Documentation

For configuration, examples and documentation check out the official Chime TTS site.

Support and Discussion

For questions, suggestions, and community discussion about Chime TTS, visit our Community Forum.


chime_tts's People

Contributors

dependabot[bot] avatar jkpe avatar jonalbr avatar jschlyter avatar kaizersoje avatar nimroddolev avatar noxhirsch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chime_tts's Issues

chime_tts.say - Error when cache option is enabled.

System Health details

System Information

version core-2024.4.0
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 Australia/Perth
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4604
Installed Version 1.34.0
Stage running
Available Repositories 1403
Downloaded Repositories 32
Home Assistant Cloud
logged_in true
subscription_expiration June 30, 2024 at 8:00 AM
relayer_connected true
relayer_region ap-southeast-1
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled true
remote_server ap-southeast-1-1.ui.nabu.casa
certificate_status ready
instance_id 8dda903fdfef472c96b8ec807a70c988
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 30.8 GB
disk_used 12.4 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.10.0), File editor (5.8.0), Spotify Connect (0.13.0), Mosquitto broker (6.4.0), Zigbee2MQTT (1.36.1-1), Node-RED (17.0.11), Matter Server (5.5.1), eufy-security-ws (1.8.0-2), ESPHome (2024.3.1), Assist Microphone (2.2.3), Samba share (12.3.1), openWakeWord (1.10.0), snapcast-server (dev), Music Assistant BETA (2.0.0b129), PS5 MQTT (1.3.3)
Dashboards
dashboards 4
resources 17
views 25
mode storage
Recorder
oldest_recorder_run March 28, 2024 at 2:44 AM
current_recorder_run April 4, 2024 at 10:03 AM
estimated_db_size 363.66 MiB
database_engine sqlite
database_version 3.44.2
Spotify
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

When using the chime_tts.say service I get an error if I enable the cache option, but no error if I disable the cache option.

Reproduction steps

This service call succeeds and audio plays:

service: chime_tts.say
target:
  entity_id: media_player.homepod_mini
data:
  chime_path: bright
  offset: 450
  final_delay: 0
  tts_speed: 100
  tts_pitch: 0
  volume_level: 0.7
  message: Test audio message
  tts_platform: cloud

This service call fails:

service: chime_tts.say
target:
  entity_id: media_player.homepod_mini
data:
  chime_path: bright
  offset: 450
  final_delay: 0
  tts_speed: 100
  tts_pitch: 0
  volume_level: 0.7
  message: Test audio message
  tts_platform: cloud
  cache: true

The only difference is the cache option is enabled.

Debug logs

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/chime_tts/__init__.py:1267
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:13:46 AM (6 occurrences)
Last logged: 10:43:24 AM

[139794035877184] Error handling message: Unknown error (unknown_error) Rhys from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 794, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1650, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 506, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 536, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 504, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 733, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 696, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2542, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2579, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 116, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    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 138, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 716, in async_get_playback_audio_path
    audio_dict = await async_get_cached_audio_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1287, in async_get_cached_audio_data
    audio_dict = await async_retrieve_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1267, in async_retrieve_data
    return _data[DATA_STORAGE_KEY].get(key, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'



Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:504
First occurred: 10:13:46 AM (6 occurrences)
Last logged: 10:43:24 AM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 504, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 733, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 696, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2542, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2579, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 116, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    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 138, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 716, in async_get_playback_audio_path
    audio_dict = await async_get_cached_audio_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1287, in async_get_cached_audio_data
    audio_dict = await async_retrieve_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1267, in async_retrieve_data
    return _data[DATA_STORAGE_KEY].get(key, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'


Logger: homeassistant.core
Source: core.py:2558
First occurred: 10:30:01 AM (2 occurrences)
Last logged: 10:30:18 AM

Error executing service: <ServiceCall media_player.play_media (c:01HTKF1TGSRDF9HSNM07X2MSD0): entity_id=['media_player.homepod_mini'], extra=, media_type=music, media_id=media-source://media_source/local/casita_media/sounds/temp/chime_tts/ij5fk91i.mp3>
Error executing service: <ServiceCall media_player.play_media (c:01HTKF2B5SYXMWSA6MRXAQX2HQ): entity_id=['media_player.homepod_mini'], extra=, media_type=music, media_id=media-source://media_source/local/casita_media/sounds/temp/chime_tts/icb2kvpz.mp3>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2558, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2579, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/media_player.py", line 346, in async_play_media
    await self.atv.stream.stream_file(media_id)
  File "/usr/local/lib/python3.12/site-packages/pyatv/core/facade.py", line 371, in stream_file
    await self.relay("stream_file")(
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/raop/__init__.py", line 360, in stream_file
    audio_file = await open_source(
                 ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/raop/audio_source.py", line 729, in open_source
    return await InternetSource.open(source, sample_rate, channels, sample_size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/raop/audio_source.py", line 597, in open
    stream_generator = await loop.run_in_executor(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miniaudio.py", line 1268, in stream_any
    raise DecodeError("failed to init decoder", result)
miniaudio.DecodeError: ('failed to init decoder', -1)


This error originated from a custom integration.

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/__init__.py:304
integration: Chime TTS (documentation, issues)
First occurred: 10:13:07 AM (1 occurrences)
Last logged: 10:13:07 AM

Timed out waiting for playback to complete

Diagnostics dump

home-assistant_chime_tts_2024-04-04T02-18-27.999Z.log

When targeting HomePod - volume increases before pausing media

System Health details

System Information

version | core-2023.8.2
host_os | Home Assistant OS 10.4

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

HomePod volume increased as soon as the service call executed, but before the currently playing media paused.

Reproduction steps

  1. Target a HomePod
  2. Call the chime_tts.say service, setting the volume to something different from the current setting.
  3. Observe
    ...

Debug logs

NA

Diagnostics dump

No response

TTS not playing.

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

It only plays the opening and closing chimes without the message.
Here is the code that I use:

service: chime_tts.say data: chime_path: mp3_path_placeholder-classical end_chime_path: mp3_path_placeholder-classical delay: 450 final_delay: 0 message: Test announcement. tts_platform: google_translate tts_playback_speed: 100 volume_level: 1 language: en tld: com target: entity_id: media_player.master_bedroom_speaker

Here is the full log:
2023-11-14 12:39:43.022 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration chime_tts which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-11-14 12:44:11.271 WARNING (MainThread) [custom_components.chime_tts] - Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected 2023-11-14 12:44:11.272 WARNING (MainThread) [custom_components.chime_tts] Unable to generate TTS audio

Home Assistant
Core - 2023.11.2
Supervisor - 2023.11.0
Operating System - 11.1
Frontend - 20231030.2
Chime TTS Version - v0.8.0

Describe the solution you'd like

I would like to hear both the chimes and the message together.

Describe alternatives you've considered

None.

Additional context

None.

Occasionally getting Message YAML parsing errors

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'm using v0.13.1-beta3

Now, every ~20 times or so, it's fairly infrequent (it's happened 7 times now), the text converted into speech goes something like this:
"type: chime path: media/notify.mp3, audio_conversion: "-filter:a volume=0.8", message: (and then the actual message too)"

Logger: custom_components.chime_tts.helpers
Source: custom_components/chime_tts/helpers.py:162
Integration: Chime TTS ([documentation](https://www.github.com/nimroddolev/chime_tts/wiki), [issues](https://github.com/nimroddolev/chime_tts/issues))
First occurred: February 6, 2024 at 11:42:38 PM (7 occurrences)
Last logged: 12:45:02 PM

Message YAML parsing error at line 1, column 206: while parsing a flow mapping in "<unicode string>", line 1, column 93: ... sion': '-filter:a volume=0.8'}, {'type': 'tts', 'message': 'At t ... ^ expected ',' or '}', but got '<scalar>' in "<unicode string>", line 1, column 206: ... s out, whispers, "Goodnight, I\'ll keep the date."', 'delay': -800}] ^

Since posting about my last issue, I've switched to using OpenAI's TTS instead of Google. Here's the latest service call:

service: chime_tts.say
data:
  tts_platform: openai_tts
  cache: true
  message:
    - type: chime
      path: |
        {% if (not say.startswith("-")) %} 
          {% if states['input_boolean.dog_mode'].state == 'on' %}
          media/ding-sound.mp3
          {% else %} 
          media/notify.mp3
          {% endif %}
        {% endif %}
      audio_conversion: "-filter:a volume=0.8"
    - type: tts
      message: "{{ say }}"
      delay: -800
target:
  entity_id: media_player.minis_linked
enabled: true
alias: "Call a service 'Chime TTS: Say' on Minis Linked - OpenAI"

Any thoughts or things to try?
It usually works; unfortunately, it's not clearly reproducible.

Describe the solution you'd like

Not getting those errors :)

Describe alternatives you've considered

I'm using the ability to overlap the chime and the voice mp3s, so using the simpler features might fix this.

Additional context

FYI, it just happened with chime_tts.say_url also.

Default Settings

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I had a problem recently where ChimeTTS was playing a chime, then didn't speak anything. The problem ending up being that I hadn't set a TTS Platform.

This happened because I was using a template in the message, so when I entered that in, it replaced the the UI view with a YAML view, and so I simply forgot to set it.

Describe the solution you'd like

I think it would be good to have some default settings for the integration. For example, TTS platform. Maybe it would make sense for other settings to be defaults as well. The platform though may be a good start.

Describe alternatives you've considered

In the future, I probably won't forget to specify it.

Additional context

No response

Repository issue templates not working

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

There are two templates in .github for bugs. This stops github from showing the template. Only 'feature request' shows.

Describe the solution you'd like

Ability to open anything other than a feature request

Describe alternatives you've considered

Putting bug reports into the feature request template

Additional context

why is this field mandatory?

Tried chime and it doesn't work for ESP Muse as target device

System Health details

System Information

version core-2023.9.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 6.1.21-v8
arch aarch64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4942
Installed Version 1.32.1
Stage running
Available Repositories 1288
Downloaded Repositories 8
AccuWeather
can_reach_server ok
remaining_requests 23
Home Assistant Cloud
logged_in true
subscription_expiration October 2, 2023 at 7: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-8.ui.nabu.casa
certificate_status ready
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 10.5
update_channel stable
supervisor_version supervisor-2023.09.2
agent_version 1.5.1
docker_version 23.0.6
disk_total 229.2 GB
disk_used 13.5 GB
healthy true
supported true
board yellow
supervisor_api ok
version_api ok
installed_addons File editor (5.6.0), Advanced SSH & Web Terminal (15.0.8), Home Assistant Google Drive Backup (0.111.1), Mosquitto broker (6.3.1), Z-Wave JS (0.1.90), Network UPS Tools (0.12.1), SQLite Web (3.9.3), JupyterLab (0.12.0), Piper (1.3.2), Airthings (1.2.0), ESPHome (2023.8.3), AWNET to HASS (1.0.1)
Dashboards
dashboards 2
resources 2
views 2
mode storage
Recorder
oldest_recorder_run September 11, 2023 at 9:23 PM
current_recorder_run September 22, 2023 at 9:38 PM
estimated_db_size 147.96 MiB
database_engine sqlite
database_version 3.41.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Using Choose Device to select the ESP Muse or choosing area doesn't work but choosing Entity ESP Muse does work

Using developer tools to call service with piper tts

Reproduction steps

...

Debug logs

No debug information that I could find for Chime

Diagnostics dump

No response

Release V0.11.0 appears to break selection of voice with Piper

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I haven't had time to dig into this problem, but using my working scripts and calling chime_tts.play_url in the developer's tools trying to pass a parameter voice: en_US_xxxxxx no longer works.

I'll try to get to this asap. Sticking with v0.10.2 for now

Describe the solution you'd like

working selection of voice

Describe alternatives you've considered

none

Additional context

none

Help with Custom sounds

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'm trying to understand how to use custom sounds for the chime but I'm a novice and I just don't know how to create the correct file path. I keep getting this 'Custom 1' file path invalid

A full walkthrough would be very helpful

Describe the solution you'd like

to be able to add custom sounds for the chime

Describe alternatives you've considered

.

Additional context

.

ChimeTTSQueueManager.queue_processor' was never awaited handle

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 5000
Installed Version 1.34.0
Stage running
Available Repositories 1408
Downloaded Repositories 26
Home Assistant Cloud
logged_in true
subscription_expiration January 31, 2025 at 7:00 PM
relayer_connected true
relayer_region us-east-1
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled false
remote_server us-east-1-0.ui.nabu.casa
certificate_status ready
instance_id a034c9ee5fdd455e8fb11e2b33f4502a
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.04.0
agent_version 1.6.0
docker_version 24.0.7
disk_total 38.7 GB
disk_used 29.9 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.4.0), Terminal & SSH (9.10.0), MariaDB (2.6.1), Log Viewer (0.17.0), File editor (5.8.0), ESPHome (2024.3.1), chrony (3.0.1), Z-Wave JS UI (3.4.2), rtlamr2mqtt (2.3.4), Frigate Proxy (1.4), Home Assistant Google Drive Backup (0.112.1), Matter Server (5.5.1), InfluxDB (5.0.0)
Dashboards
dashboards 3
resources 8
views 14
mode storage
Recorder
oldest_recorder_run March 14, 2024 at 9:02 PM
current_recorder_run April 10, 2024 at 9:03 AM
estimated_db_size 1260.27 MiB
database_engine mysql
database_version 10.6.12
Victor Smart-Kill
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I enabled debug logging the other day and checked it out this morning (after updating to 1.1.0-beta1). Here are the errors/warnings.

There are a few different warnings and one error here.
The error may an error with the HomePod.

I tested using the ChimeTTS service just now and it worked fine to two homepods, but I know automation runs earlier today were not working.
Prior to testing the ChimeTTS service I used the HomeAssistant Say/media player service to test if that worked - maybe doing that got something working? After this the automation I checked worked too.

Reproduction steps

I'm not sure.

Debug logs

Logger: py.warnings
Source: runner.py:189
First occurred: 9:03:36 AM (1 occurrences)
Last logged: 9:03:36 AM

/usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited handle = None # Needed to break cycles when an exception occurs.
Logger: homeassistant.core
Source: core.py:2559
First occurred: 10:54:21 AM (1 occurrences)
Last logged: 10:54:21 AM

Error executing service: <ServiceCall media_player.play_media (c:01HV4811K9VS5RGHGYEG6VZ6B4): announce=True, entity_id=['media_player.kitchen_homepod'], extra=, media_type=music, media_id=media-source://media_source/local/sounds/temp/chime_tts/smayp6wm.mp3>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2559, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/media_player.py", line 346, in async_play_media
    await self.atv.stream.stream_file(media_id)
  File "/usr/local/lib/python3.12/site-packages/pyatv/core/facade.py", line 371, in stream_file
    await self.relay("stream_file")(
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/raop/__init__.py", line 360, in stream_file
    audio_file = await open_source(
                 ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/raop/audio_source.py", line 729, in open_source
    return await InternetSource.open(source, sample_rate, channels, sample_size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyatv/protocols/raop/audio_source.py", line 597, in open
    stream_generator = await loop.run_in_executor(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miniaudio.py", line 1268, in stream_any
    raise DecodeError("failed to init decoder", result)
miniaudio.DecodeError: ('failed to init decoder', -1)
This error originated from a custom integration.

Logger: custom_components.chime_tts.helpers.media_player
Source: custom_components/chime_tts/helpers/media_player.py:368
integration: Chime TTS (documentation, issues)
First occurred: 10:44:09 AM (2 occurrences)
Last logged: 12:04:46 PM

Unable to set media_player.kitchen_homepod's volume to 0.35: RTSP/1.0 method SET_PARAMETER failed with code 455: Method Not Valid In This State
This error originated from a custom integration.

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/__init__.py:305
integration: Chime TTS (documentation, issues)
First occurred: 9:18:43 AM (5 occurrences)
Last logged: 12:48:32 PM

Timed out waiting for playback to complete


### Diagnostics dump

_No response_

chime_tts.say service call sometimes gets stuck, requiring a restart of Home Assistant

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

My main notify script is occasionally getting stuck on the chime_tts.say call. This happened a few times with the v0.12.1-beta5, but after you released v0.13, I thought maybe it was fixed since it hasn't happened in v0.13 until today.

Unfortunately, I don't see any errors in the logs.
And trying to enable debug logging after the fact and calling it again, also generates nothing in the logs.
edit: I wasn't clicking on Show Full Logs (sorry) - when this happens again, I'll get you the logs

I've just added this to my home assistant startup scripts, so hopefully I can capture more useful info when it happens again:

service: logger.set_level
data:
  custom_components.chime_tts: debug

Here's the service call I'm using that gets stuck:

service: chime_tts.say
data:
  tts_platform: google_translate
  cache: true
  message:
    - type: chime
      path: |
        {% if (not say.startswith("-")) %} 
          {% if states['input_boolean.dog_mode'].state == 'on' %}
          media/ding-sound.mp3
          {% else %} 
          media/notify.mp3
          {% endif %}
        {% endif %}
      audio_conversion: "-filter:a volume=0.8"
    - type: tts
      message: "{{ say }}"
      delay: -800
      tld: com.au
      tts_playback_speed: 110
target:
  entity_id: media_player.minis_linked

Describe the solution you'd like

My notify script (which is set to Queued) gets stuck on chime_tts.say, it would be great if chime_tss.say timed out at least.

Restarting Home Assistant fixes the problem, at least for a while.

Describe alternatives you've considered

I could switch to the default tts script:

service: tts.cloud_say
data:
  message: "{{ say }}"
  entity_id: media_player.minis_linked
alias: Default TTS - Backup

Additional context

Thanks so much for creating this Integration. It's very powerful. I'm sorry there's another problem.

Let me know how I can help or things you'd like me to try.

v0.11.0 not playing custom chime sounds, only tts

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

After updating from v0.10.2 to v0.11.0 no custom chime sound is played any longer; tts message consists of the spoken text only. Did not change any setting or path. HA log entry is similar "could not play file None", do not remember exactly.

Preset sounds are played, only custom sounds do not work.

Went back to v0.10.2 and all is fine again.

Describe the solution you'd like

Custom sounds should be played.

Describe alternatives you've considered

went back to previous version, all is fine again.

Additional context

image

Add an option for executing timeout

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

My chime_tts runs, and it generates the cache file, but it stops because of error

 Service call to chime_tts.say timed out after 15 seconds.

Describe the solution you'd like

Because of the machine which I'm running homeassistant isn't powerful enough

I notice in the source code, the 15 second timeout is constant

result = await asyncio.wait_for(task, 15)

maybe can provide a property timeout in options to overwrite the default 15 seconds

Describe alternatives you've considered

Not applicable

Additional context

Not applicable

Unable to use the TTS Service

System Health details

System Information

version core-2024.4.2
installation_type Home Assistant Core
dev false
hassio false
docker false
user homeassistant
virtualenv true
python_version 3.12.2
os_name Linux
os_version 6.6.16-v7+
arch armv7l
timezone Europe/Amsterdam
config_dir /home/homeassistant/.homeassistant
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4970
Installed Version 1.34.0
Stage running
Available Repositories 1408
Downloaded Repositories 95
HACS Data ok
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Dashboards
dashboards 9
resources 69
views 51
mode storage
Recorder
oldest_recorder_run 5 april 2024 om 11:41
current_recorder_run 15 april 2024 om 09:49
estimated_db_size 1993.14 MiB
database_engine postgresql
database_version 13.11
Spotify
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Unable to play sound, getting error on API.

Reproduction steps

  1. Run the chime_tts service
  2. error occurs and check the logs

...

Debug logs

Logger: homeassistant.components.websocket_api.http.connection
Bron: custom_components/chime_tts/__init__.py:611
integratie: Home Assistant WebSocket API (documentatie, problemen)
Eerst voorgekomen: 09:51:54 (3 gebeurtenissen)
Laatst gelogd: 09:56:55

[858543016] Error handling message: Unknown error (unknown_error) Bram from 127.0.0.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/websocket_api/commands.py", line 794, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1713, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 457, in async_run
    await self._async_step(log_exceptions=False)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 509, in _async_step
    self._handle_exception(
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 539, in _handle_exception
    raise exception
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 507, in _async_step
    await getattr(self, handler)()
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/homeassistant/.homeassistant/custom_components/chime_tts/__init__.py", line 116, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/homeassistant/.homeassistant/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    result = await asyncio.wait_for(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/home/homeassistant/.homeassistant/custom_components/chime_tts/__init__.py", line 138, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/homeassistant/.homeassistant/custom_components/chime_tts/__init__.py", line 756, in async_get_playback_audio_path
    output_audio = await async_process_segments(hass,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/homeassistant/.homeassistant/custom_components/chime_tts/__init__.py", line 948, in async_process_segments
    tts_audio = await async_request_tts_audio(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/homeassistant/.homeassistant/custom_components/chime_tts/__init__.py", line 611, in async_request_tts_audio
    audio = AudioSegment.from_file(file)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/pydub/audio_segment.py", line 728, in from_file
    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.12/site-packages/pydub/utils.py", line 279, in mediainfo_json
    info = json.loads(output)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


##############################################################
##############################################################
##############################################################

Logger: custom_components.chime_tts
Bron: custom_components/chime_tts/__init__.py:1051
integratie: Chime TTS (documentatie, problemen)
Eerst voorgekomen: 09:56:54 (1 gebeurtenissen)
Laatst gelogd: 09:56:54

Unable to extract audio from file: "[Errno 2] No such file or directory: 'custom_components/chime_tts/mp3s/bells.mp3'"

Diagnostics dump

No response

Feature Request: Parameter for 'Pause'/'Play' media before/after TTS announcement to improve behavior with HomePods

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Hi,
with HomePods, the announce parameter is currently unsupported. But what works great (at least for me) as a workaround is a small script that checks before sending the TTS media if the current state of the media_player/HomePod is “playing”. In that case, it just sends the TTS media as usually but calls service: media_player.media_play right after that, which resumes what was playing before.

Additionally, as I think was already mentioned in a different issue, with HomePods the volume level gets adjusted, before the current media stops. I solve this by calling service: media_player.media_pause before calling chime_tts. However, if I do it, it leaves a rather long period where nothing is played as chime_tts is (as expected) processing a bit before playing. If the 'pause' call were done by chime_tts after processing is complete, it would improve that behavior.

Kind regards,
Jonas

Describe the solution you'd like

Add a parameter which, if enabled, does what I described above.

Describe alternatives you've considered

Just continuing using an additional script with chime tts.

Additional context

My script for reference:

alias: ChimeTTS Homepods
fields:
  media_player_entity:
    name: Entity ID of HomePod
    description: Provide entity of HomePod
    example: media_player.arbeitszimmer
    required: true
    selector:
      entity:
        include_entities:
          - media_player.kuche
          - media_player.schlafzimmer
          - media_player.arbeitszimmer
  message:
    name: Message
    description: The message content
    example: Das ist eine Benachrichtigung
    required: true
    selector:
      text: null
  volume_level:
    name: Volume
    description: Set volume level in percent
    example: "35"
    default: 35
    selector:
      number:
        max: 100
        min: 1
        step: 1
        mode: slider
        unit_of_measurement: "%"
sequence:
  - if:
      - condition: template
        value_template: "{{ is_state(media_player_entity, \"playing\") }}"
    then:
      - service: media_player.media_pause
        target:
          entity_id:
            - "{{ media_player_entity }}"
        data: {}
        enabled: true
      - service: chime_tts.say
        data:
          chime_path: bright
          offset: 450
          final_delay: 0
          message: "{{ message }}"
          tts_platform: edge_tts
          language: de-DE-ConradNeural
          volume_level: "{{ volume_level / 100 }}"
        target:
          entity_id: "{{ media_player_entity }}"
      - service: media_player.media_play
        metadata: {}
        data: {}
        target:
          entity_id: "{{ media_player_entity }}"
    else:
      - service: chime_tts.say
        data:
          chime_path: bright
          offset: 450
          final_delay: 0
          message: "{{ message }}"
          tts_platform: edge_tts
          language: de-DE-ConradNeural
          volume_level: "{{ volume_level / 100 }}"
        target:
          entity_id: "{{ media_player_entity }}"
mode: single

TTS/Chime echos when using Sonos speakers

System Health details

[`## System Information

version core-2024.4.2
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 5000
Installed Version 1.34.0
Stage running
Available Repositories 1413
Downloaded Repositories 63
Home Assistant Cloud
logged_in false
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.04.0
agent_version 1.6.0
docker_version 24.0.7
disk_total 30.8 GB
disk_used 21.2 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Studio Code Server (5.15.0), Advanced SSH & Web Terminal (17.2.0), Grafana (9.2.1), InfluxDB (5.0.0), zabbix-agent2 (1.4), ESPHome (2024.3.2)
Husqvarna Automower
can_reach_server ok
Dashboards
dashboards 19
resources 49
views 97
mode storage
Recorder
oldest_recorder_run April 5, 2024 at 15:11
current_recorder_run April 11, 2024 at 17:00
estimated_db_size 3857.73 MiB
database_engine sqlite
database_version 3.44.2
`](url)

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

When attempting to speak to a grouped set of Sonos speakers using the yaml in 'reproduction steps' section, the audio is played at different times / out of sync:

As seem here from geekofweek it seems the order in which grouping, setting announce and volume is important when using Sonos speakers:
home-assistant/core#93136 (comment)

Reproduction steps

This causes the out of sync audio/TTS:


 - service: chime_tts.say
    data:
      chime_path: www/media/beep.mp3
      delay: 10
      announce: false
      final_delay: 0
      tts_playback_speed: 100
      message: Vehicle entering driveway.
      tts_platform: google_cloud
      join_players: true
      cache: true
    enabled: true
    target:
      entity_id:
        - media_player.lounge_sonos`
        - media_player.kitchen_sonos`
        - media_player.diningroom_sonos`

If i manually join/group players and set volume before executing chimeTTS with the following, the audio is played in sync across all speakers as it should:


- service: media_player.volume_set
  metadata: {}
  data:
    volume_level: 0.45
  target:
    entity_id:
      - media_player.lounge_sonos
      - media_player.diningroom_sonos
      - media_player.kitchen_sonos

- service: media_player.join
  data:
    group_members:
      - media_player.kitchen_sonos
      - media_player.diningroom_sonos
  target:
    entity_id:
      - media_player.lounge_sonos
 
- service: chime_tts.say
  data:
    chime_path: www/media/beep.mp3
    delay: 10
    announce: false
    final_delay: 0
    tts_playback_speed: 100
    message: Vehicle entering driveway.
    tts_platform: google_cloud
    join_players: false
    cache: true
  enabled: true
  target:
    entity_id:
      - media_player.lounge_sonos

Would it be possible to allow the order of grouping / setting volume / announce setting to be modified ?

Debug logs

N/A

Diagnostics dump

No response

2024.4: Gender is no longer an option for Nabu Casa Voice

System Health details

--

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

HA 2024.4 threw a warning that for the Nabu Casa voice, the "gender" option is deprecated. You now need to use the "voice" option. Please update chime to use the new "voice" option.

Reproduction steps

  1. Install HA 2024.4
  2. Call ChimeTTS with the Nabu casa voice
  3. See a warning pop up
    ...

Debug logs

--

Diagnostics dump

No response

cloud_say TTS platform not working

System Health details

System Information

version core-2023.8.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.4
os_name Linux
os_version 6.1.39
arch x86_64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4809
Installed Version 1.32.1
Stage running
Available Repositories 1269
Downloaded Repositories 15
Home Assistant Cloud
logged_in true
subscription_expiration September 14, 2023 at 7: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
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 10.4
update_channel stable
supervisor_version supervisor-2023.08.1
agent_version 1.5.1
docker_version 23.0.6
disk_total 234.0 GB
disk_used 8.7 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Samba share (10.0.2), eufy-security-ws (1.6.2), PS5 MQTT (1.3.1), Terminal & SSH (9.7.1), Tailscale (0.11.1)
Dashboards
dashboards 6
resources 5
views 24
mode storage
Recorder
oldest_recorder_run June 26, 2023 at 1:57 PM
current_recorder_run August 18, 2023 at 6:52 AM
estimated_db_size 3457.08 MiB
database_engine mysql
database_version 10.11.5

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

When using cloud_say as a TTS platform, I get the error below. The chime plays, just no message TTS. The build in TTS service for cloud_say works just fine on its own.

"tts_platform": "cloud_say",
"message": "Testing.",
"chime_path": "custom_components/chime_tts/mp3s/mario_coin.mp3"

Reproduction steps

  1. Call service with above data parameters

...

Debug logs

2023-08-18 07:03:55.784 WARNING (MainThread) [custom_components.chime_tts] - Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected
2023-08-18 07:03:55.785 WARNING (MainThread) [custom_components.chime_tts] Unable to generate TTS audio
2023-08-18 07:04:05.245 WARNING (MainThread) [custom_components.chime_tts] - Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected
2023-08-18 07:04:05.248 WARNING (MainThread) [custom_components.chime_tts] Unable to generate TTS audio
2023-08-18 07:04:46.792 WARNING (MainThread) [custom_components.chime_tts] - Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected
2023-08-18 07:04:46.794 WARNING (MainThread) [custom_components.chime_tts] Unable to generate TTS audio
2023-08-18 07:08:16.185 WARNING (MainThread) [custom_components.chime_tts] - Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected
2023-08-18 07:08:16.187 WARNING (MainThread) [custom_components.chime_tts] Unable to generate TTS audio

Diagnostics dump

No response

Set volume for each device when calling multiple devices

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'd like to use Chime to group notifications but I need my players to play at different volumes (some are in bedrooms).

Describe the solution you'd like

It would be great if we could set the player volume per player via some sort of optional field.

Describe alternatives you've considered

Calling Chime multiple times with different volumes, unfortunately this means some speakers will be out of sync.

Additional context

None

chime_tts.say_url default save folder doesn't seem to exist, but works with modifications

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'm using v0.13.1-beta3

chime_tts.say_url is set to write to the folder:
/www/chime_tts/

But this wasn't working for me.
I looked for the output files but couldn't find them. I don't think they were being saved?

I tried editing the configuration, but that wasn't saving for me (a separate issue).

1
So I modified:
/config/custom_components/chime_tts/const.py
with this change:

WWW_PATH_DEFAULT = "/media/chime_tts/"
# WWW_PATH_DEFAULT = "/www/chime_tts/"

image

After a restart of Home Assistant, the chime_tts configuration was now changed and would write to a folder that exists (I manually created the chime_tts folder in media).

2
Then I used a template in a variable (below) to change the output URL from:
chime_tts.url: http://192.168.1.5:8123/media/chime_tts/afx_uhze.mp3
to:
fixedurl: media-source://media_source/local/chime_tts/afx_uhze.mp3

Which made it work!

Here are the scripts all together:

  - service: chime_tts.say_url
    data:
      tts_platform: openai_tts
      cache: true
      message:
        - type: chime
          path: "{{chimefile}}"
          audio_conversion: "-filter:a volume=0.8"
        - type: tts
          message: "{{say}}"
          delay: -800
          tld: com.au
          tts_playback_speed: 110
    response_variable: chime_tts

(removed a step where I fade my music to a low volume)

  - variables:
      fixedurl: >-
        {{chime_tts.url|replace('http://192.168.1.5:8123/media/','media-source://media_source/local/')}}

  - service: media_player.play_media
    data:
      media_content_id: "{{fixedurl}}"
      media_content_type: music
    target:
      entity_id:
        - media_player.minis_linked
    alias: Play URL on Minis

It's working for me now, but I'm not sure why the default settings were not (nor why I couldn't change settings with the Configuration dialog)

I saw someone else was having a problem with say_url, so I thought I'd also share my experience.

Home Assistant log: Invalid Authentication from Sonos Roam

System Health details

System Information

version core-2024.4.2
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 aarch64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1399
Downloaded Repositories 20
HACS Data ok
AccuWeather
can_reach_server ok
remaining_requests 19
Home Assistant Cloud
logged_in true
subscription_expiration March 5, 2025 at 6: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-8.ui.nabu.casa
certificate_status ready
instance_id aa0b917ef61c4654a670573e45e1e118
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.04.0
agent_version 1.6.0
docker_version 24.0.7
disk_total 234.7 GB
disk_used 9.5 GB
healthy true
supported true
board odroid-m1
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.10.0), File editor (5.8.0), Matter Server (5.5.1), ESPHome (2024.3.2), Studio Code Server (5.15.0), MariaDB (2.6.1), Samba share (12.3.1), Mosquitto broker (6.4.0)
Dashboards
dashboards 7
resources 14
views 12
mode storage
Recorder
oldest_recorder_run April 5, 2024 at 7:58 PM
current_recorder_run April 9, 2024 at 7:42 PM
estimated_db_size 264.77 MiB
database_engine mysql
database_version 10.6.12

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I have started getting the following log warning message. It seems to be fairly random and often. I don't have any automations using Chime TTS that coincide with these warnings. I initially thought it was a permissions problem with the indicated path in the URL, but opening up the permissions doesn't seem to resolve the warning messages,

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:138
integration: HTTP (documentation, issues)
First occurred: 2:11:41 PM (1 occurrences)
Last logged: 2:11:41 PM

Login attempt or request with invalid authentication from SonosZP.attlocal.net (192.168.1.198). Requested URL: '/media/local/sounds/temp/chime_tts/ayqpvcsz.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIwOGUwOTlkNTAyYmI0NzYzODNmZTdlNzlhMGE3OGVhYSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvc291bmRzL3RlbXAvY2hpbWVfdHRzL2F5cXB2Y3N6Lm1wMyIsInBhcmFtcyI6W10sImlhdCI6MTcxMjU5MzMxNiwiZXhwIjoxNzEyNjc5NzE2fQ.JkLxAseJdnzG6ymLRQbnWSnAlgQSvuBavHlI3LYCWXU'. (Linux UPnP/1.0 Sonos/78.1-52020 (ZPS27))

Reproduction steps

...

Debug logs

2024-04-10 14:40:16.481 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration chime_tts which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:16.484 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration teamtracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:16.487 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration webrtc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:16.489 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration tapo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:16.492 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:16.494 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration meross_cloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:16.497 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration scheduler which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-04-10 14:40:26.797 WARNING (MainThread) [custom_components.meross_cloud] Skip MQTT cert validation option set to: True
2024-04-10 14:40:27.140 WARNING (MainThread) [custom_components.meross_cloud] 
===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.6.1
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Marian Light (msl430) - OnlineStatus.ONLINE
- Smart Ambient Light (msl430) - OnlineStatus.ONLINE
===============================
2024-04-10 14:40:33.177 WARNING (MainThread) [meross_iot.manager] Found a new device Marian Light (msl430, HW 4.0.0, FW 4.2.6, class: msl430:4.0.0:4.2.6) that has become online while we were offline.
2024-04-10 14:40:33.179 WARNING (MainThread) [meross_iot.manager] Found a new device Smart Ambient Light (msl430, HW 4.0.0, FW 4.2.6, class: msl430:4.0.0:4.2.6) that has become online while we were offline.
2024-04-10 14:40:37.198 DEBUG (ImportExecutor_0) [custom_components.chime_tts.queue_manager] Queue reset
2024-04-10 14:40:37.206 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Queue reset
2024-04-10 14:40:37.208 INFO (MainThread) [custom_components.chime_tts] The Chime TTS integration is set up.
2024-04-10 14:40:37.210 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1989: RuntimeWarning: coroutine 'ChimeTTSQueueManager.queue_processor' was never awaited
  handle = None  # Needed to break cycles when an exception occurs.

2024-04-10 14:40:37.213 DEBUG (MainThread) [custom_components.chime_tts] Chime TTS Configuration Values:
2024-04-10 14:40:37.213 DEBUG (MainThread) [custom_components.chime_tts]  - queue_timeout: 60
2024-04-10 14:40:37.213 DEBUG (MainThread) [custom_components.chime_tts]  - tts_platform_key: ''
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]  - offset: 0
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]  - temp_chimes_path: '/media/sounds/temp/chime_tts/chimes/'
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]  - temp_path: '/media/sounds/temp/chime_tts/'
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]  - www_path: '/www/chime_tts/'
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]  - media_dir: 'local'
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]  - custom_paths:
2024-04-10 14:40:37.214 DEBUG (MainThread) [custom_components.chime_tts]    - custom_chime_path_1: '/media/sounds/announcement-sound-4-21464.mp3'
2024-04-10 14:40:37.215 DEBUG (MainThread) [custom_components.chime_tts]    - custom_chime_path_2: '/media/sounds/grandfathers-clock-1-ding-dong-14356.mp3'
2024-04-10 14:40:37.215 DEBUG (MainThread) [custom_components.chime_tts]    - custom_chime_path_3: '/media/sounds/header-39344.mp3'
2024-04-10 14:40:37.215 DEBUG (MainThread) [custom_components.chime_tts]    - custom_chime_path_4: 
2024-04-10 14:40:37.215 DEBUG (MainThread) [custom_components.chime_tts]    - custom_chime_path_5: 
2024-04-10 14:40:42.613 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-04-10 14:40:44.109 WARNING (MainThread) [homeassistant.components.light] Entity None (<class 'custom_components.meross_cloud.light.LightEntityWrapper'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 19> and color modes, please create a bug report at https://github.com/albertogeniola/meross-homeassistant and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
2024-04-10 14:40:44.110 WARNING (MainThread) [homeassistant.components.light] None (<class 'custom_components.meross_cloud.light.LightEntityWrapper'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/albertogeniola/meross-homeassistant
2024-04-10 14:40:44.116 WARNING (MainThread) [homeassistant.components.light] Entity None (<class 'custom_components.meross_cloud.light.LightEntityWrapper'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 19> and color modes, please create a bug report at https://github.com/albertogeniola/meross-homeassistant and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
2024-04-10 14:40:44.116 WARNING (MainThread) [homeassistant.components.light] None (<class 'custom_components.meross_cloud.light.LightEntityWrapper'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/albertogeniola/meross-homeassistant
2024-04-10 14:40:49.395 ERROR (bellows.thread_0) [bellows.uart] CRC error in frame b'f5de2c83fc7e1644ecc5f67e' (b'c5f6' != b'ad45')
2024-04-10 14:40:49.663 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from SonosZP.attlocal.net (192.168.1.198). Requested URL: '/media/local/sounds/temp/chime_tts/ayqpvcsz.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIwOGUwOTlkNTAyYmI0NzYzODNmZTdlNzlhMGE3OGVhYSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvc291bmRzL3RlbXAvY2hpbWVfdHRzL2F5cXB2Y3N6Lm1wMyIsInBhcmFtcyI6W10sImlhdCI6MTcxMjU5MzMxNiwiZXhwIjoxNzEyNjc5NzE2fQ.JkLxAseJdnzG6ymLRQbnWSnAlgQSvuBavHlI3LYCWXU'. (Linux UPnP/1.0 Sonos/78.1-52020 (ZPS27))
2024-04-10 14:40:56.821 WARNING (MainThread) [zigpy.application] Zigbee channel 20 utilization is 80.38%!
2024-04-10 14:40:56.821 WARNING (MainThread) [zigpy.application] If you are having problems joining new devices, are missing sensor updates, or have issues keeping devices joined, ensure your coordinator is away from interference sources such as USB 3.0 devices, SSDs, WiFi routers, etc.
2024-04-10 14:40:58.331 WARNING (MainThread) [homeassistant.components.homekit] The bridge Home Assistant Bridge has entity camera.living_room. For best performance, and to prevent unexpected unavailability, create and pair a separate HomeKit instance in accessory mode for this entity
2024-04-10 14:40:58.431 WARNING (MainThread) [homeassistant.components.homekit] The bridge Home Assistant Bridge has entity media_player.lg_webos_tv_oled65c2pua. For best performance, and to prevent unexpected unavailability, create and pair a separate HomeKit instance in accessory mode for this entity

Diagnostics dump

NA

Add support for custom TTS agent

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

I want to use the chime_tts.say with custom tts service, and not one of the provided tts platform

Describe alternatives you've considered

My alternative is using only one of the provided TTS platforms instead of the one I'm currently using

Additional context

No

Stops functioning after service call queuing issue

System Health details

System Information

version core-2024.4.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.25-haos
arch x86_64
timezone America/Edmonton
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1398
Downloaded Repositories 4
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.2
update_channel stable
supervisor_version supervisor-2024.04.0
agent_version 1.6.0
docker_version 25.0.5
disk_total 30.8 GB
disk_used 4.0 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Duck DNS (1.16.0), NGINX Home Assistant SSL proxy (3.9.0), File editor (5.8.0), Mosquitto broker (6.4.0), Zigbee2MQTT (1.36.1-1), Terminal & SSH (9.13.0), Ring-MQTT with Video Streaming (5.6.3)
Dashboards
dashboards 3
resources 0
views 1
mode storage
Recorder
oldest_recorder_run April 8, 2024 at 2:09 AM
current_recorder_run April 16, 2024 at 5:02 PM
estimated_db_size 42.77 MiB
database_engine sqlite
database_version 3.44.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I am using the latest beta v1.1.0-beta2

I have several automations running that make use of ChimeTTS. Some of them are set to run in parallel, and it is possible that multiple automations will make a call to Chime at the same time. As a result it is possible they will get queued. After a while it seems that Chime gets into a deadlock state where any new requests to the service are added to a queue (Adding service call to queue in the logs are added), and are never processed. Further calls to ChimeTTS just result in more calls being added to the queue according to the logs. It has been difficult to reproduce this.

When it does reach the deadlock state I can confirm that sending an MP3 to my speaker group still works fine, and making a call to my TTS service (microsoft) directly to play sound over my speakers also works correctly, it is just services through chime that stop processing requests. Reloading the Chime integration doesn't seem to fix it, I need to do a full restart of home assistant to get it out of this state. Only then will it return to working normally and playing sound over the speakers.

It might be related to caching, I have caching enabled for all my calls to the service, and when it happened this time, I changed one of my chime MP3's and ran the clear cache service. The next time I tried to call ChimeTTS it failed.

Reproduction steps

  1. Use ChimeTTS in various automations, some set to run in parallel
  2. At some point subsequent calls to the ChimeTTS service stop resulting in any sound being generated
  3. The logs shows "Adding service call to queue"
  4. Calls to the Media Player Service still work
  5. Call to the TTS Service still work
  6. A restart of HA is needed to fix the issue

Debug logs

2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta2 -----
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.announcement_speakers_group']
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = custom_chime_path_3
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = -700.0
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Upper Rear Door was left open
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = True
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-04-17 14:41:31.315 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-04-17 14:41:31.316 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-04-17 14:41:31.322 DEBUG (MainThread) [custom_components.chime_tts] ...no cached audio found
2024-04-17 14:41:31.322 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "/media/bong.mp3"...
2024-04-17 14:41:31.431 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 3.291s
2024-04-17 14:41:31.432 DEBUG (MainThread) [custom_components.chime_tts] - Attempting to retrieve TTS audio from cache...
2024-04-17 14:41:31.434 DEBUG (MainThread) [custom_components.chime_tts] ...no cached TTS audio found
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] - Using default TTS platform: 'microsoft'
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'microsoft'
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Upper Rear Door was left open'
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts] * cache = True
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-04-17 14:41:31.435 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-04-17 14:41:32.137 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 700.0ms
2024-04-17 14:41:32.138 DEBUG (MainThread) [custom_components.chime_tts] - Saving generated TTS audio to cache...
2024-04-17 14:41:32.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /media/sounds/temp/chime_tts/sketoz3p.mp3
2024-04-17 14:41:32.213 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-04-17 14:41:32.213 DEBUG (MainThread) [custom_components.chime_tts] - key: "69cc0da640b971191674070309573098b07656fbe2ea2fa62d1b7e82456cd7f4"
2024-04-17 14:41:32.213 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/sketoz3p.mp3', 'audio_duration': 2.832}"
2024-04-17 14:41:32.214 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio saved to cache
2024-04-17 14:41:32.220 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Performing overlay of -700.0ms
2024-04-17 14:41:32.229 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-04-17 14:41:32.375 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /media/sounds/temp/chime_tts/anbq1khi.mp3
2024-04-17 14:41:32.488 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-04-17 14:41:32.488 DEBUG (MainThread) [custom_components.chime_tts] - key: "bf03d9f0408b1d39335c8494148b8ac577599fd8b37c65e0fad248361f4ae5fd"
2024-04-17 14:41:32.488 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'local_path': '/media/sounds/temp/chime_tts/anbq1khi.mp3', 'audio_duration': 5.423}"
2024-04-17 14:41:32.489 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-04-17 14:41:32.489 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.423
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/anbq1khi.mp3"
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/anbq1khi.mp3"
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] 1 Standard media player detected:
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - media_player.announcement_speakers_group
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/anbq1khi.mp3
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.announcement_speakers_group']
2024-04-17 14:41:32.490 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 5.423s for audio playback to complete...
2024-04-17 14:41:37.916 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player isn't playing...
2024-04-17 14:41:38.318 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.announcement_speakers_group
2024-04-17 14:41:38.318 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 7.0 s -----
2024-04-17 14:42:08.319 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta2 -----
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.announcement_speakers_group']
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = custom_chime_path_3
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = -700.0
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Upper Rear Door was left open
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = True
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-04-17 14:42:08.320 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found:
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/anbq1khi.mp3"
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.423
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/anbq1khi.mp3"
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] 1 Standard media player detected:
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - media_player.announcement_speakers_group
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/anbq1khi.mp3
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - announce: True
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.announcement_speakers_group']
2024-04-17 14:42:08.323 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 5.423s for audio playback to complete...
2024-04-17 14:42:13.749 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player isn't playing...
2024-04-17 14:42:14.150 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.announcement_speakers_group
2024-04-17 14:42:14.151 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 5.83 s -----
2024-04-17 14:42:20.811 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta2 -----
2024-04-17 14:42:20.812 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-17 14:42:36.799 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta2 -----
2024-04-17 14:42:36.799 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-17 14:42:55.361 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta2 -----
2024-04-17 14:42:55.361 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue

Diagnostics dump

No response

Unknown source directory

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Is it possible that the source destination can be defined? so that I determine the location myself. since I have problems with it (see error).

And Yes I've tried solutions provided in other issues, but without luck.

How my config looks like:

homeassistant:
  packages: !include_dir_named packages
  media_dirs:
    media: "/media"
  allowlist_external_dirs:
    - "/media"

media_source:

I didn't had media_source before, but adding didn't solve the issue.

the error:

2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts] Service call #0 was added to the queue.
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts] Executing queued job #0
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * entity_ids = ['media_player.woonkamer']
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * hass = <HomeAssistant RUNNING>
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * chime_path = custom_components/chime_tts/mp3s/bells.mp3
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * end_chime_path = custom_components/chime_tts/mp3s/tada.mp3
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * delay = 450.0
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * message = Hello world!
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * tts_platform = google_translate
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * tts_playback_speed = 125.0
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * volume_level = 0.75
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * join_players = True
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * cache = True
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * announce = True
2023-10-07 11:15:45.857 DEBUG (MainThread) [custom_components.chime_tts]  * language = 'en' (for Google Translate) or 'en-US' (for Nabu Casa Cloud TTS)
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  * tld = com.uk
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  * gender = 'male' or 'female'
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-10-07 11:15:45.858 WARNING (MainThread) [custom_components.chime_tts] Media player "media_player.woonkamer" does not support changing volume levels
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - async_get_cached_audio_data('664d943ff487deb55f72a4bd8868bc0759173ad53182d3831c3a1c0fa4081bae')
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving key/value from chime_tts storage:
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]    - key: 664d943ff487deb55f72a4bd8868bc0759173ad53182d3831c3a1c0fa4081bae
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]    - value: {'audio_path': '/media/sounds/temp/chime_tts/94gjf6ns.mp3', 'audio_duration': 3.717}
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - Cached audio data found
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts] Using previously generated mp3 saved in cache
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/94gjf6ns.mp3', 'audio_duration': 3.717}
2023-10-07 11:15:45.858 WARNING (MainThread) [custom_components.chime_tts] No media_player found supporting joint playback.
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - media_content_type: music
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/94gjf6ns.mp3
2023-10-07 11:15:45.858 DEBUG (MainThread) [custom_components.chime_tts]  - announce: True
2023-10-07 11:15:45.859 DEBUG (MainThread) [custom_components.chime_tts]  - entity_id: ['media_player.woonkamer']
2023-10-07 11:15:45.859 WARNING (MainThread) [custom_components.chime_tts] An error occurred: Unknown source directory.
2023-10-07 11:15:45.860 DEBUG (MainThread) [custom_components.chime_tts] Waiting 3.717s for audio playback to complete...
2023-10-07 11:15:49.578 DEBUG (MainThread) [custom_components.chime_tts] Waiting 0.1s for final_delay to complete...
2023-10-07 11:15:49.679 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 3821.796 ms -----
2023-10-07 11:15:49.679 DEBUG (MainThread) [custom_components.chime_tts] Removing current queued service call.
2023-10-07 11:15:49.679 DEBUG (MainThread) [custom_components.chime_tts] Queue emptied. Reinitializing values.

my test:

service: chime_tts.say
data:
  chime_path: custom_components/chime_tts/mp3s/bells.mp3
  end_chime_path: custom_components/chime_tts/mp3s/tada.mp3
  delay: 450
  final_delay: 100
  message: Hello world!
  tts_platform: google_translate
  tts_playback_speed: 125
  volume_level: 0.75
  join_players: true
  cache: true
  announce: true
  language: "'en' (for Google Translate) or 'en-US' (for Nabu Casa Cloud TTS)"
  tld: com.uk
  gender: "'male' or 'female'"
target:
  entity_id: media_player.woonkamer

Describe the solution you'd like

that I'm able to set the source destination myself.

Describe alternatives you've considered

n/a

Additional context

n/a

Path for local media seems to use path name instead of virtual folder

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

This is my configuration

homeassistant:
  media_dirs:
    local: "/srv/homeassistant/media"
    sounds: "/home/homeassistant/media/sounds"

This is what chime_tts is trying to play

2023-12-03 01:09:43.144 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-12-03 01:09:43.144 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-12-03 01:09:43.144 DEBUG (MainThread) [custom_components.chime_tts]  - async_get_cached_audio_data('d1a2e30255739b81a89327b1d3adf66fb28f8631ffed391cb013e78e2ca774c4')
2023-12-03 01:09:43.144 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving key/value from chime_tts storage:
2023-12-03 01:09:43.144 DEBUG (MainThread) [custom_components.chime_tts]    - key: d1a2e30255739b81a89327b1d3adf66fb28f8631ffed391cb013e78e2ca774c4
2023-12-03 01:09:43.144 DEBUG (MainThread) [custom_components.chime_tts]    - value: {'audio_path': '/srv/homeassistant/srv/homeassistant/media/sounds/temp/chime_tts/k1liomfx.mp3', 'audio_duration': 7.778}
2023-12-03 01:09:43.145 DEBUG (MainThread) [custom_components.chime_tts]  - Cached audio data found
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts] Using previously generated mp3 saved in cache
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - audio_dict = {'audio_path': '/srv/homeassistant/srv/homeassistant/media/sounds/temp/chime_tts/k1liomfx.mp3', 'audio_duration': 7.778}
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - Setting 'media_player.bedroom' volume level to 1.0
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - async_set_volume_level("media_player.bedroom", 1.0)
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - Skipped setting volume
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - media_content_type: music
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/k1liomfx.mp3
2023-12-03 01:09:43.146 DEBUG (MainThread) [custom_components.chime_tts]  - entity_id: ['media_player.bedroom']
2023-12-03 01:09:43.349 DEBUG (MainThread) [custom_components.chime_tts] ...media_player.play_media completed.
2023-12-03 01:09:43.349 DEBUG (MainThread) [custom_components.chime_tts] Waiting 7.778s for audio playback to complete...
2023-12-03 01:09:51.131 DEBUG (MainThread) [custom_components.chime_tts] Returning media_player.bedroom's volume level to 1.0
2023-12-03 01:09:51.131 DEBUG (MainThread) [custom_components.chime_tts]  - async_set_volume_level("media_player.bedroom", 1.0)
2023-12-03 01:09:51.131 DEBUG (MainThread) [custom_components.chime_tts]  - Skipped setting volume
2023-12-03 01:09:51.133 DEBUG (MainThread) [custom_components.chime_tts] Final URL = http://10.0.0.37:8123/srv/homeassistant/srv/homeassistant/media/sounds/temp/chime_tts/k1liomfx.mp3
2023-12-03 01:09:51.133 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 7990.084000000001 ms -----
2023-12-03 01:09:51.134 DEBUG (MainThread) [custom_components.chime_tts] Removing current queued service call.
2023-12-03 01:09:51.134 DEBUG (MainThread) [custom_components.chime_tts] Queue emptied. Reinitializing values.

Describe the solution you'd like

Pretty sure the final url should be

http://10.0.0.37:8123/media/sounds/temp/chime_tts/k1liomfx.mp3

instead of

http://10.0.0.37:8123/srv/homeassistant/srv/homeassistant/media/sounds/temp/chime_tts/k1liomfx.mp3

Believe this was working in previous version

Describe alternatives you've considered

change media folders

Additional context

n/a

Volume_set feature not supported although it is

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'm using chime_tts to speak on a Google Nest Mini and each time I call the say service, I get the following warning:
2023-10-17 22:29:01.780 WARNING (MainThread) [custom_components.chime_tts] Media player "media_player.entree" does not support changing volume levels

when in fact when looking at the media player attributes, I do have the VOLUME_SET feature supported.
{'device_class': 'speaker', 'friendly_name': 'Google Nest Entrée', 'supported_features': <MediaPlayerEntityFeature.PAUSE|VOLUME_SET|VOLUME_MUTE|TURN_ON|TURN_OFF|PLAY_MEDIA|STOP|PLAY|BROWSE_MEDIA: 152461>}

Describe the solution you'd like

The volume setting capability seems to be defined using the media_vol_level attribute and seems not accurate.
The warning message should only be triggered when the initial volume reset option is used when calling the say service.

Describe alternatives you've considered

have a different check between media volume capability (with the annouce option) and volume_set capability.

Additional context

none

Volume after TTS

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

When tts is ready, the music volume will first increase and then return to the original level. Can I also go to the original level immediately after the TTS?

Describe the solution you'd like

Goto original level whitout delay

Describe alternatives you've considered

Final Delay -400

Additional context

service: chime_tts.say
metadata: {}
data:
tts_speed: 100
tts_pitch: 0
message: Dit i s een test!
tts_platform: tts.google_nl_nl
language: nl
gender: female
volume_level: 0.2
announce: true
offset: 0
target:
entity_id: media_player.office

Unable to perform FFmpeg conversion: source file not found on file system

System Health details

System Information

version core-2024.4.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.25-haos
arch x86_64
timezone Europe/Budapest
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4996
Installed Version 1.34.0
Stage running
Available Repositories 1405
Downloaded Repositories 31
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
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.2
update_channel stable
supervisor_version supervisor-2024.04.0
agent_version 1.6.0
docker_version 25.0.5
disk_total 234.7 GB
disk_used 25.8 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Advanced SSH & Web Terminal (17.2.0), Paradox Alarm Interface (3.4.0), SQLite Web (4.1.2), TasmoAdmin (0.30.0), Duck DNS (1.16.0), NGINX Home Assistant SSL proxy (3.9.0), ZigStar TI CC2652P/P7 FW Flasher (0.4.0), EMQX (0.5.0), LMS (Formerly Logitech Media Server) (8.4.0.0)
Dashboards
dashboards 6
resources 21
views 13
mode storage
Recorder
oldest_recorder_run 2023. március 10. 12:30
current_recorder_run 2024. április 12. 17:50
estimated_db_size 2939.66 MiB
database_engine sqlite
database_version 3.44.2
Spotify
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I'm using Chime_TTS with an Alexa media player speaker and using cached mode. I'm getting these warning messages after each message: "Unable to perform FFmpeg conversion: source file not found on file system: https://REDACTED.ui.nabu.casa/local/chime_tts/83kmvf3i.mp3". Everything works fine, the chime and the message plays Ok. The referred file in the warning message is actually there and accessible at the referred url.

Reproduction steps

  1. Call chime_tts.say

...

Debug logs

2024-04-13 11:39:57.206 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta2 -----
2024-04-13 11:39:57.207 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-13 11:39:57.210 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-13 11:39:57.211 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.echodot']
2024-04-13 11:39:57.211 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = media/sounds/alexa_notification.mp3
2024-04-13 11:39:57.211 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = True
2024-04-13 11:39:57.211 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 200.0
2024-04-13 11:39:57.211 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-04-13 11:39:57.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = REDACTED
2024-04-13 11:39:57.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = cloud
2024-04-13 11:39:57.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-04-13 11:39:57.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-04-13 11:39:57.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-04-13 11:39:57.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = -1
2024-04-13 11:39:57.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-04-13 11:39:57.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-04-13 11:39:57.213 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-13 11:39:57.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] --- Audio will be converted to Alexa-friendly format as Alexa speaker/s detected ---
2024-04-13 11:39:57.216 DEBUG (MainThread) [custom_components.chime_tts] *** Checking Chime TTS audio cache ***
2024-04-13 11:39:57.226 DEBUG (MainThread) [custom_components.chime_tts] Cached audio found:
2024-04-13 11:39:57.226 DEBUG (MainThread) [custom_components.chime_tts] - public_path = "https://REDACTED.ui.nabu.casa/local/chime_tts/83kmvf3i.mp3"
2024-04-13 11:39:57.226 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 5.04
2024-04-13 11:39:57.227 DEBUG (MainThread) [custom_components.chime_tts] - local_path = None
2024-04-13 11:39:57.227 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = None
2024-04-13 11:39:57.227 DEBUG (MainThread) [custom_components.chime_tts] Apply audio conversion
2024-04-13 11:39:57.228 WARNING (MainThread) [custom_components.chime_tts.helpers.helpers] Unable to perform FFmpeg conversion: source file not found on file system: https://REDACTED.ui.nabu.casa/local/chime_tts/83kmvf3i.mp3
2024-04-13 11:39:57.228 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-04-13 11:39:57.228 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-04-13 11:39:57.229 DEBUG (MainThread) [custom_components.chime_tts] 1 Alexa media player detected:
2024-04-13 11:39:57.230 DEBUG (MainThread) [custom_components.chime_tts] - media_player.echodot
2024-04-13 11:39:57.230 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data:
2024-04-13 11:39:57.230 DEBUG (MainThread) [custom_components.chime_tts] - message: <audio src="https://REDACTED.ui.nabu.casa/local/chime_tts/83kmvf3i.mp3"/>
2024-04-13 11:39:57.231 DEBUG (MainThread) [custom_components.chime_tts] - data: {'type': 'tts'}
2024-04-13 11:39:57.231 DEBUG (MainThread) [custom_components.chime_tts] - target: ['media_player.echodot']
2024-04-13 11:39:57.232 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 5.04s for audio playback to complete...
2024-04-13 11:40:02.277 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player isn't playing...
2024-04-13 11:40:02.277 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.echodot
2024-04-13 11:40:02.277 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 5.07 s -----

Diagnostics dump

No response

chime_tts.say plays wrong/older messages

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Calling chime_tts.say with tts.piper seems to pick older audio files at random for the media_player. Independent of cache being enabled or disabled. I use Hello world in the example below, but as the message changes it seems to grab historical mp3 at random.

service: chime_tts.say
target:
  entity_id: media_player.living_room
data:
  chime_path: bright
  end_chime_path: bright
  delay: 450
  final_delay: 0
  tts_playback_speed: 100
  volume_level: 0.2
  message: Hello world
  tts_platform: tts.piper
  announce: true

Describe the solution you'd like

The specified message to be played.

Describe alternatives you've considered

I have tried clearing cache; no luck there.

Additional context

N/A

How to call from pyscript?

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I can't figure out how to call the chime_tts.say service from within pyscript. I'm not getting any errors, but I'm also not getting any audio from the media_player. Specifically, I don't think I'm indicating the target/entity_id properly. Here is what I've tried:

    service.call("chime_tts", "say",
            data={
            'target':"media_player.entrywalltablet",
            'chime_path':"custom_chime_path_2",
            'end_chime_path':'',
            'offset':'0',
            'final_delay':'0',
            'tts_playback_speed':'100',
            'volume_level':'1',
            'message':"Not Ready",
            'tts_platform':"google_translate",
            'gender':"female",
            'announce':'true'})

This is the yaml in Developer->Services that does work (produces audio):

service: chime_tts.say
target:
  entity_id: media_player.entrywalltablet
data:
  chime_path: custom_chime_path_2
  end_chime_path: ""
  offset: -300
  final_delay: 0
  tts_playback_speed: 100
  volume_level: 1
  message: hello world
  tts_platform: google_translate
  gender: female
  announce: true

Any idea how to make the call from pyscript?

Describe the solution you'd like

I need help with the pyscript call.

Describe alternatives you've considered

I also tried

service.call("chime_tts", "say",
        data={
        'entity_id':"media_player.entrywalltablet",
        'chime_path':"custom_chime_path_2",
        'end_chime_path':'',
        'offset':'0',
        'final_delay':'0',
        'tts_playback_speed':'100',
        'volume_level':'1',
        'message':"Not Ready",
        'tts_platform':"google_translate",
        'gender':"female",
        'announce':'true'})

Additional context

I'm not getting any related errors in the system log.

Pause/resume Spotify media_player before/after Chime TTS notification

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

This feature request is based on the comment made by @dbullendsl.

When the announce parameter is enabled, Spotify media_players paused before Chime TTS notifications, however they are not resumed once the notification ends.

Spotify media_players can only play audio from Spotify and cannot play arbitrary files (neither local files nor remote URLs) - so they cannot currently be used as a media_player for Chime TTS notification playback. However, it would be useful to have them be paused/resume before/after Chime TTS notification playback.

My idea is to include them in the list of target media_players sent to the chime_tts.say service, and have Chime TTS identify them as Spotify media_players and handle the pause/resume (when announce is true).

Describe the solution you'd like

Spotify media_players should automatically resume playback once the notification from Chime TTS is complete.

Failure to readjust volume on Alexas after playing output from chime_tts:say

System Health details

System Information

version core-2024.2.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 6.1.74-haos
arch x86_64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4800
Installed Version 1.34.0
Stage running
Available Repositories 1398
Downloaded Repositories 35
AccuWeather
can_reach_server ok
remaining_requests 17
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.5
update_channel stable
supervisor_version supervisor-2024.02.0
agent_version 1.6.0
docker_version 24.0.7
disk_total 457.7 GB
disk_used 17.1 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Duck DNS (1.15.0), File editor (5.8.0), Studio Code Server (5.15.0), Advanced SSH & Web Terminal (17.1.1), Samba Backup (5.2.0), Z-Wave JS (0.4.4), Mosquitto broker (6.4.0), ESPHome (2024.2.0), Zigbee2MQTT (1.35.3-1), Piper (1.4.0), Whisper (1.0.2)
keymaster
zwave_integration zwave_js
network_status on
Dashboards
dashboards 4
resources 22
views 45
mode storage
Recorder
oldest_recorder_run February 19, 2024 at 11:41 PM
current_recorder_run February 24, 2024 at 8:57 AM
estimated_db_size 753.38 MiB
database_engine sqlite
database_version 3.44.2
Sonoff
version 3.6.0 (8dd8af9)
cloud_online 0 / 1
local_online 1 / 1
debug failed to load:
Spotify
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Alexa devices do not return to prior playback levels after playing output chime_tts:say if the devices were already playing from another source, ie Spotify.

It appears from the log that the call waits for the Alexa to return from Playing to not playing, but if the devices have been playing prior to the announcement they remain in playing mode and never signal the end of the announcement.

What I did in the past using the chime_tts:say_url call which returned the URL and the duration of the announcement. I'd wait a period equal to the duration+2 seconds and then issue a set volume command.

Reproduction steps

  1. play something on the target device like Spotify at volume level .2
  2. observe device volume level and that it's in state playing
  3. run chime_tts:say with a test announcement at volume level .4
  4. observe device is still in state playing with volume level .4
    ...

Debug logs

024-02-24 09:01:42.042 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.13.1-beta13 -----
2024-02-24 09:01:42.042 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-02-24 09:01:42.055 DEBUG (MainThread) [custom_components.chime_tts.helpers] ``` is_say_url = False
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters -----
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * entity_ids = ['media_player.kitchen_echo_show']
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * cache = False
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * offset = 200.0
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * final_delay = 0.0
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * message = This is a test
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * tts_platform = tts.piper
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * tts_playback_speed = 100.0
2024-02-24 09:01:42.056 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * announce = False
2024-02-24 09:01:42.057 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * volume_level = 0.4
2024-02-24 09:01:42.057 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * join_players = False
2024-02-24 09:01:42.057 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * unjoin_players = False
2024-02-24 09:01:42.057 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * audio_conversion = -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0
2024-02-24 09:01:42.058 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- TTS-Specific Params -----
2024-02-24 09:01:42.058 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * voice = en_US-lessac-medium
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'tts.piper'
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'This is a test'
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]     * tts_playback_speed = 100.0
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]     * language = 'None'
2024-02-24 09:01:42.059 DEBUG (MainThread) [custom_components.chime_tts]     * options = {'voice': 'en_US-lessac-medium'}
2024-02-24 09:01:42.908 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio completed in 849.121 ms
2024-02-24 09:01:42.908 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /config/www/chime_tts/...
2024-02-24 09:01:42.959 DEBUG (MainThread) [custom_components.chime_tts.helpers]  - File saved to path: /config/www/chime_tts/p_iso113.mp3
2024-02-24 09:01:42.959 DEBUG (MainThread) [custom_components.chime_tts]   - Performing FFmpeg audio conversion...
2024-02-24 09:01:43.041 DEBUG (MainThread) [custom_components.chime_tts]     ...FFmpeg audio conversion completed.
2024-02-24 09:01:43.046 DEBUG (MainThread) [custom_components.chime_tts]  - Saving data to chime_tts storage:
2024-02-24 09:01:43.047 DEBUG (MainThread) [custom_components.chime_tts]    - key:   "3c2a551ff3ac09369100066fc1b8c8a4ef31cdf7fd8e532ba502a3706208f10b"
2024-02-24 09:01:43.047 DEBUG (MainThread) [custom_components.chime_tts]    - value: "{'public_path': '/config/www/chime_tts/p_iso113.mp3', 'audio_duration': 1.152}"
2024-02-24 09:01:43.048 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated: {'audio_duration': 1.152, 'local_path': None, 'public_path': 'https://davebhome.duckdns.org:443/local/chime_tts/p_iso113.mp3'}
2024-02-24 09:01:43.048 DEBUG (MainThread) [custom_components.chime_tts]  - Setting 'media_player.kitchen_echo_show' volume level to 0.4
2024-02-24 09:01:43.049 DEBUG (MainThread) [custom_components.chime_tts]  - 1 Alexa media player detected. Calling `notify.alexa_media` service
2024-02-24 09:01:43.049 DEBUG (MainThread) [custom_components.chime_tts] Calling notify.alexa_media with data:
2024-02-24 09:01:43.049 DEBUG (MainThread) [custom_components.chime_tts]  - message: <audio src="https://davebhome.duckdns.org:443/local/chime_tts/p_iso113.mp3"/>
2024-02-24 09:01:43.049 DEBUG (MainThread) [custom_components.chime_tts]  - data: {'type': 'tts'}
2024-02-24 09:01:43.049 DEBUG (MainThread) [custom_components.chime_tts]  - target: ['media_player.kitchen_echo_show']
2024-02-24 09:01:43.049 DEBUG (MainThread) [custom_components.chime_tts] Waiting 1.152s for audio playback to complete...
2024-02-24 09:01:44.202 DEBUG (MainThread) [custom_components.chime_tts.helpers]  - Waiting until media_player.kitchen_echo_show is no longer = playing...
2024-02-24 09:01:54.446 WARNING (MainThread) [custom_components.chime_tts.helpers]  - Timed out waiting for media_player.kitchen_echo_show's state to change from playing
2024-02-24 09:01:54.446 WARNING (MainThread) [custom_components.chime_tts] Timed out waiting for playback to complete
2024-02-24 09:01:54.446 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 12390.992 ms -----


### Diagnostics dump

_No response_

No information about setting up local directories

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

It's incredibly frustrating setting this extension. It has some prerequisites that are not stated anywhere in wiki/readme, or i was unable to find them. In my setup it just doesn't work and digging through the logs to find out what is wrong and having to dig through the sourcecode to find out what it wants is suboptimal

Describe the solution you'd like

  • Mention that ffmpeg is needed
  • Mention how to setup the media_dirs and/or allow use of non-default ones.
  • Document how to use custom chimes from media_dirs and/or local filesystem.

Describe alternatives you've considered

Not using the addon at all.

Additional context

No additional context.

Problem with chime_tts:play_url

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

using the say_url function doesn't appear to work. I only have access to Amazon echos and only get an output that says "sorry can't access your simon says..."

First I'm running HassOS on an Intel mini PC

Here's what I'm doing. Execute a script that takes an input for the message and calls the chime_tts:say_url service then sends the output to the echos:

Here's the script and trace.


alias: aa chime
sequence:
  - service: chime_tts.say_url
    data:
      chime_path: bells
      tts_platform: google_translate
      message: "{{message}}"
    response_variable: chime_tts
    enabled: true
  - service: notify.alexa_media
    data:
      message: |
        <audio src='{{chime_tts.url}}'/>
      target:
        - media_player.kitchen_echo_show
        - media_player.office_echo_dot
      data:
        type: tts
mode: single
fields:
  message:
    selector:
      text: null
    name: message


Executed: December 14, 2023 at 10:52:45 AM
Result:
params:
  domain: chime_tts
  service: say_url
  service_data:
    chime_path: bells
    tts_platform: google_translate
    message: Testing Amazon Echo output
  target: {}
running_script: false

Executed: December 14, 2023 at 10:52:45 AM
Result:
params:
  domain: notify
  service: alexa_media
  service_data:
    message: <audio src='https://[myserver.url]/local/chime_tts/x0ekdd_7.mp3'/>
    target:
      - media_player.kitchen_echo_show
      - media_player.office_echo_dot
    data:
      type: tts
  target: {}
running_script: false

and here's the log:


2023-12-14 10:46:31.381 INFO (MainThread) [homeassistant.components.script.aa_chime] aa chime: Running script sequence
2023-12-14 10:46:31.381 INFO (MainThread) [homeassistant.components.script.aa_chime] aa chime: Executing step call service
2023-12-14 10:46:31.382 DEBUG (MainThread) [custom_components.chime_tts] Calling chime_tts.say_url...
2023-12-14 10:46:31.382 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.10.1 -----
2023-12-14 10:46:31.382 DEBUG (MainThread) [custom_components.chime_tts] Service call #0 was added to the queue.
2023-12-14 10:46:31.382 DEBUG (MainThread) [custom_components.chime_tts] Executing queued job #0
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts] ----- General Parameters -----
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * entity_ids = []
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * hass = <HomeAssistant RUNNING>
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * chime_path = custom_components/chime_tts/mp3s/bells.mp3
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * end_chime_path = 
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * cache = False
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * delay = 450.0
2023-12-14 10:46:31.383 DEBUG (MainThread) [custom_components.chime_tts]  * message = Testing Amazon Echo output
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  * tts_platform = google_translate
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  * tts_playback_speed = 100.0
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  * announce = False
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  * volume_level = -1.0
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  * join_players = False
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  * unjoin_players = False
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts] ----- TTS-Specific Params -----
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts] -------------------------------
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("custom_components/chime_tts/mp3s/bells.mp3", 0, audio)
2023-12-14 10:46:31.384 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/bells.mp3"...
2023-12-14 10:46:31.475 DEBUG (MainThread) [custom_components.chime_tts]    - ...audio with duration 0.944s retrieved successfully
2023-12-14 10:46:31.475 DEBUG (MainThread) [custom_components.chime_tts] async_request_tts_audio(hass, tts_platform = google_translate, message = Testing Amazon Echo output, tts_playback_speed = 100.0, cache = False, language = None)
2023-12-14 10:46:31.475 DEBUG (MainThread) [custom_components.chime_tts]  - Generating TTS audio...
2023-12-14 10:46:32.008 DEBUG (MainThread) [custom_components.chime_tts]  - ...TTS audio completed in 533.045 ms
2023-12-14 10:46:32.010 DEBUG (MainThread) [custom_components.chime_tts]  - Final audio created:
2023-12-14 10:46:32.010 DEBUG (MainThread) [custom_components.chime_tts]    - Duration = 3.698s
2023-12-14 10:46:32.010 DEBUG (MainThread) [custom_components.chime_tts] new_audio_folder = /www/chime_tts/
2023-12-14 10:46:32.010 DEBUG (MainThread) [custom_components.chime_tts] Audio folder exists: /www/chime_tts/
2023-12-14 10:46:32.010 DEBUG (MainThread) [custom_components.chime_tts]  - Creating mp3 file...
2023-12-14 10:46:32.010 DEBUG (MainThread) [custom_components.chime_tts]    - Filepath = '/www/chime_tts/9m11150t.mp3'
2023-12-14 10:46:32.079 DEBUG (MainThread) [custom_components.chime_tts]    - Non-relative filepath = '/www/chime_tts/9m11150t.mp3'
2023-12-14 10:46:32.079 DEBUG (MainThread) [custom_components.chime_tts]    - File saved successfully
2023-12-14 10:46:32.079 DEBUG (MainThread) [custom_components.chime_tts]  - audio_dict = {'audio_path': '/www/chime_tts/9m11150t.mp3', 'audio_duration': 3.698}
2023-12-14 10:46:32.079 DEBUG (MainThread) [custom_components.chime_tts] Saving to chime_tts storage:
2023-12-14 10:46:32.079 DEBUG (MainThread) [custom_components.chime_tts]  - key:   "5e4d304a4875a6bb88f69a6e3ed3a06cee39b720bb9b8eaadedd7d2045177056"
2023-12-14 10:46:32.079 DEBUG (MainThread) [custom_components.chime_tts]  - value: "{'audio_path': '/www/chime_tts/9m11150t.mp3', 'audio_duration': 3.698}"
2023-12-14 10:46:32.082 DEBUG (MainThread) [custom_components.chime_tts] Final URL = https://[myhass.url]/local/chime_tts/9m11150t.mp3
2023-12-14 10:46:32.082 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 699.518 ms -----
2023-12-14 10:46:32.083 DEBUG (MainThread) [custom_components.chime_tts] Removing current queued service call.
2023-12-14 10:46:32.083 DEBUG (MainThread) [custom_components.chime_tts] Queue emptied. Reinitializing values.
2023-12-14 10:46:32.083 INFO (MainThread) [homeassistant.components.script.aa_chime] aa chime: Executing step call service

so far what I've done

  1. I have several scripts and automations that output text and prerecorded .mp3 to amazon echos - no problems
  2. made sure that the local media directory is pointing to /media - ok
  3. looked for the .mp3 sounds in custom_components/mp3s - ok
  4. looked for the www/chime_tts folder - doesn't exist
  5. created the www/chime_tts folder - problem persists
  6. looked for creation of output .mp3 files - none seen - why?

I ssh into the server and found there is no folder /www/chime_tts, I've tried directly accessing the URL on the server and get a 404 error
I manually created the /www/chime_tts folder and nothing is written there
I looked for any new mp3s that were created and found none.

Describe the solution you'd like

locate the issues

Describe alternatives you've considered

stick with my existing solutions

Additional context

none

KeyError: 'public_path'

System Health details

System Information

version core-2024.2.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 6.1.74-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 5000
Installed Version 1.34.0
Stage running
Available Repositories 1408
Downloaded Repositories 26
Home Assistant Cloud
logged_in true
subscription_expiration January 31, 2025 at 7:00 PM
relayer_connected true
relayer_region us-east-1
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled false
remote_server us-east-1-0.ui.nabu.casa
certificate_status ready
instance_id a034c9ee5fdd455e8fb11e2b33f4502a
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.5
update_channel stable
supervisor_version supervisor-2024.02.1
agent_version 1.6.0
docker_version 24.0.7
disk_total 38.7 GB
disk_used 28.7 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.4.0), Terminal & SSH (9.9.0), MariaDB (2.6.1), Log Viewer (0.17.0), File editor (5.8.0), ESPHome (2024.2.1), chrony (3.0.1), Z-Wave JS UI (3.4.0), rtlamr2mqtt (2.3.4), Frigate Proxy (1.4), Home Assistant Google Drive Backup (0.112.1), Matter Server (5.3.0), InfluxDB (5.0.0)
Dashboards
dashboards 2
resources 8
views 13
mode storage
Recorder
oldest_recorder_run January 31, 2024 at 2:36 PM
current_recorder_run February 28, 2024 at 7:07 PM
estimated_db_size 1427.77 MiB
database_engine mysql
database_version 10.6.12
Victor Smart-Kill
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I know over here: #81 after the first release with that feature, things were working fine. Must have been a subsequent release where something broke?

Reproduction steps

service: chime_tts.say
target:
  entity_id: media_player.kitchen_homepod
data:
  chime_path: chord
  delay: 50
  tts_playback_speed: 150
  volume_level: 0.35
  message: Front door
  tts_platform: cloud
  cache: true
  announce: true
  gender: female
  force_announce: true

Debug logs

2024-02-29 07:00:01.728 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.13.1-beta13 -----
2024-02-29 07:00:01.729 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-02-29 07:00:01.800 DEBUG (MainThread) [custom_components.chime_tts.helpers]  is_say_url = False
2024-02-29 07:00:01.801 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters -----
2024-02-29 07:00:01.801 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * entity_ids = ['media_player.kitchen_homepod']
2024-02-29 07:00:01.801 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * chime_path = chord
2024-02-29 07:00:01.801 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * cache = True
2024-02-29 07:00:01.801 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * offset = 50.0
2024-02-29 07:00:01.801 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * final_delay = 0.0
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * message = Front door
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * tts_platform = cloud
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * tts_playback_speed = 150.0
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * announce = True
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * volume_level = 0.35
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * join_players = False
2024-02-29 07:00:01.802 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * unjoin_players = False
2024-02-29 07:00:01.803 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- TTS-Specific Params -----
2024-02-29 07:00:01.803 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * gender = female
2024-02-29 07:00:01.804 DEBUG (MainThread) [custom_components.chime_tts]  - Attempting to retrieve previously cached audio...
2024-02-29 07:00:01.823 ERROR (MainThread) [homeassistant.components.automation.front_door_announce_open] Front door - announce open: Error executing script. Unexpected error for call_service at pos 4: 'public_path'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 112, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    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 134, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 642, in async_get_playback_audio_path
    audio_dict = await async_get_cached_audio_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1250, in async_get_cached_audio_data
    is_public = helpers.file_exists_in_directory(path, '/www') or helpers.file_exists_in_directory(_data[PUBLIC_PATH_KEY])
                                                                                                   ~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'public_path'
2024-02-29 07:00:01.837 ERROR (MainThread) [homeassistant.components.automation.front_door_announce_open] While executing automation automation.front_door_announce_open
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 666, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1600, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 435, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 487, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 512, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 112, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    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 134, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 642, in async_get_playback_audio_path
    audio_dict = await async_get_cached_audio_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1250, in async_get_cached_audio_data
    is_public = helpers.file_exists_in_directory(path, '/www') or helpers.file_exists_in_directory(_data[PUBLIC_PATH_KEY])
                                                                                                   ~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'public_path'
2024-02-29 07:00:02.353 WARNING (MainThread) [asyncio] socket.send() raised exception.
2024-02-29 07:00:02.356 ERROR (MainThread) [pyintesishome] <class 'ConnectionResetError'> Exception. ('Connection lost',) / Connection lost
2024-02-29 07:00:30.165 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.13.1-beta13 -----
2024-02-29 07:00:30.166 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-02-29 07:00:30.168 DEBUG (MainThread) [custom_components.chime_tts.helpers] ``` is_say_url = False
2024-02-29 07:00:30.169 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters -----
2024-02-29 07:00:30.169 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * entity_ids = ['media_player.kitchen_homepod']
2024-02-29 07:00:30.169 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * chime_path = chord
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * cache = True
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * offset = 50.0
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * final_delay = 0.0
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * message = Front door
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * tts_platform = cloud
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * tts_playback_speed = 150.0
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * announce = True
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * volume_level = 0.35
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * join_players = False
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * unjoin_players = False
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- TTS-Specific Params -----
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts.helpers]  * gender = female
2024-02-29 07:00:30.170 DEBUG (MainThread) [custom_components.chime_tts]  - Attempting to retrieve previously cached audio...
2024-02-29 07:00:30.184 ERROR (MainThread) [homeassistant.components.automation.front_door_announce_open] Front door - announce open: Error executing script. Unexpected error for call_service at pos 4: 'public_path'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 112, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    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 134, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 642, in async_get_playback_audio_path
    audio_dict = await async_get_cached_audio_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1250, in async_get_cached_audio_data
    is_public = helpers.file_exists_in_directory(path, '/www') or helpers.file_exists_in_directory(_data[PUBLIC_PATH_KEY])
                                                                                                   ~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'public_path'
2024-02-29 07:00:30.189 ERROR (MainThread) [homeassistant.components.automation.front_door_announce_open] While executing automation automation.front_door_announce_open
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 666, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1600, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 435, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 487, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 512, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 112, in async_say
    result = await queue.add_to_queue(async_say_execute, service, is_say_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/queue_manager.py", line 33, in async_process_queue
    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 134, in async_say_execute
    audio_dict = await async_get_playback_audio_path(params, options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 642, in async_get_playback_audio_path
    audio_dict = await async_get_cached_audio_data(hass, filepath_hash)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chime_tts/__init__.py", line 1250, in async_get_cached_audio_data
    is_public = helpers.file_exists_in_directory(path, '/www') or helpers.file_exists_in_directory(_data[PUBLIC_PATH_KEY])
                                                                                                   ~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'public_path'

Diagnostics dump

No response

Announce does not work for 2 different radiostations (2 different Sonos devices)

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I have 2 Sonos devices where each is playing another radio station. After using chimeTSS they both plays the same radio station. I bound the system and unbound the afterwards so both set to true. Also announce is set to true.
This is my piece of code

service: chime_tts.say
data:
  chime_path: mp3_path_placeholder-whistle
  end_chime_path: mp3_path_placeholder-bright
  delay: 450
  final_delay: 0
  tts_playback_speed: 100
  volume_level: 0.25
  message: Tjoep is vertrokken bij Henrioulle
  tts_platform: google_translate
  gender: female
  join_players: true
  unjoin_players: true
  announce: true
target:
  entity_id:
    - media_player.sonoskitchen
    - media_player.sonosmove

Describe the solution you'd like

I would like to have the sonos systems play the radiostation that was playing before the message was send.

Describe alternatives you've considered

Not applicable

Additional context

Not applicable

clear_cache not deleting all files

System Health details

## System Information

version | core-2024.2.1
-- | --
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.12.1
os_name | Linux
os_version | 6.1.74-haos
arch | x86_64
timezone | America/Chicago
config_dir | /config

<details><summary>Home Assistant Community Store</summary>

GitHub API | ok
-- | --
GitHub Content | ok
GitHub Web | ok
GitHub API Calls Remaining | 4800
Installed Version | 1.34.0
Stage | running
Available Repositories | 1394
Downloaded Repositories | 35

</details>

<details><summary>AccuWeather</summary>

can_reach_server | ok
-- | --
remaining_requests | 49

</details>

<details><summary>Home Assistant Cloud</summary>

logged_in | false
-- | --
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok

</details>

<details><summary>Home Assistant Supervisor</summary>

host_os | Home Assistant OS 11.5
-- | --
update_channel | stable
supervisor_version | supervisor-2024.01.1
agent_version | 1.6.0
docker_version | 24.0.7
disk_total | 457.7 GB
disk_used | 18.0 GB
healthy | true
supported | true
board | generic-x86-64
supervisor_api | ok
version_api | ok
installed_addons | Duck DNS (1.15.0), File editor (5.8.0), Studio Code Server (5.15.0), Advanced SSH & Web Terminal (17.1.0), Samba Backup (5.2.0), Z-Wave JS (0.4.4), Mosquitto broker (6.4.0), ESPHome (2023.12.9), Zigbee2MQTT (1.35.3-1), Piper (1.4.0), Whisper (1.0.2)

</details>

<details><summary>keymaster</summary>

zwave_integration | zwave_js
-- | --
network_status | on

</details>

<details><summary>Dashboards</summary>

dashboards | 4
-- | --
resources | 22
views | 45
mode | storage

</details>

<details><summary>Recorder</summary>

oldest_recorder_run | February 4, 2024 at 9:13 PM
-- | --
current_recorder_run | February 13, 2024 at 2:36 PM
estimated_db_size | 716.93 MiB
database_engine | sqlite
database_version | 3.44.2

</details>

<details><summary>Sonoff</summary>

version | 3.5.4 (a4a8c5f)
-- | --
cloud_online | 0 / 1
local_online | 1 / 1
debug | failed to load: 

</details>

<details><summary>Spotify</summary>

api_endpoint_reachable | ok
-- | --

</details>

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

When running the Clear_Cache cleanup only one old mp3 is being deleted from the caching location.

Would like the service call to completely clear the cache.

Reproduction steps

  1. multiple files in /config/tts/chime_tts
  2. service call with all options selected
  3. after which only one file has been deleted

Before running clear_cache
before

After running clear_cache
after

Only the most recent file has been removed.

Debug logs

-02-13 14:36:59.664 WARNING (MainThread) [homeassistant.components.humidifier.const] SUPPORT_MODES was used from vesync, this is a deprecated constant which will be removed in HA Core 2025.1. Use HumidifierEntityFeature.MODES instead, please create a bug report at https://github.com/vlebourl/custom_vesync
2024-02-13 14:36:59.668 INFO (MainThread) [homeassistant.setup] Setup of domain mobile_app took 0.9 seconds
2024-02-13 14:36:59.686 INFO (MainThread) [homeassistant.components.sensor] Setting up feedparser.sensor
2024-02-13 14:36:59.690 DEBUG (MainThread) [custom_components.chime_tts] queue_timeout = 60
2024-02-13 14:36:59.690 DEBUG (MainThread) [custom_components.chime_tts] temp_chimes_path = /media/sounds/temp/chime_tts/chimes/
2024-02-13 14:36:59.690 DEBUG (MainThread) [custom_components.chime_tts] temp_path = /media/sounds/temp/chime_tts/
2024-02-13 14:36:59.690 DEBUG (MainThread) [custom_components.chime_tts] www_path = /config/www/chime_tts/
2024-02-13 14:36:59.690 DEBUG (MainThread) [custom_components.chime_tts] media_dir = local
2024-02-13 14:36:59.690 DEBUG (MainThread) [custom_components.chime_tts] custom_paths = {'custom_chime_path_1': '/media/sounds/temp/private_chimes/House-bell-sound-effect.mp3', 'custom_chime_path_2': '/media/sounds/temp/private_chimes/lg_signal.mp3', 'custom_chime_path_3': '/media/sounds/temp/private_chimes/ding_dong.mp3', 'custom_chime_path_4': '/config/www/mp3/War-horn-sound.mp3', 'custom_chime_path_5': ''}
2024-02-13 14:36:59.696 INFO (MainThread) [zwave_js_server] Connected to Home 3998009061 (Server 1.34.0, Driver 12.4.3, Using Schema 34)

2024-02-13 14:39:08.953 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor HOMESERVER HOMESERVER_storage_total_disk_count, sending update
2024-02-13 14:39:16.895 INFO (MainThread) [homeassistant.components.automation.clear_chime_tts_path] Clear Chime_TTS Path: Running automation actions
2024-02-13 14:39:16.895 INFO (MainThread) [homeassistant.components.automation.clear_chime_tts_path] Clear Chime_TTS Path: Executing step call service
2024-02-13 14:39:16.896 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Clear Cache Called -----
2024-02-13 14:39:16.896 DEBUG (MainThread) [custom_components.chime_tts] Clearing cached downloaded chimes, cached temporary Chime TTS audio files and cached publicly accessible Chime TTS audio files...
2024-02-13 14:39:16.901 DEBUG (MainThread) [custom_components.chime_tts] - Cached file '/config/www/chime_tts/u4b_m863.mp3' deleted successfully.
2024-02-13 14:39:16.904 DEBUG (MainThread) [custom_components.chime_tts] Clearing cached Home Assistant TTS audio files...

Diagnostics dump

No response

Gender deprecated with NabuCasea removed

System Health details

Screenshot 2024-04-06 at 01 25 38

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Screenshot 2024-04-06 at 01 31 10
config needs to be updated.
Change gender by voice.

Reproduction steps

Also when using developer tools it's not working with gender

Debug logs

It's in the update

Diagnostics dump

No response

Message playback speed is not working

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

After updating to version 0.7.3, the playback speed of the message does not work properly.

Describe the solution you'd like

I need to increase the speed to 105 to make the voice natural, but now I can't use it. The sound is terrible and unlistenable

Describe alternatives you've considered

If the speed increases to more than 100, the message has a distorted and hoarse sound.

Additional context

In version 0.7.2 the speed worked perfectly

Allow Repeating Messages

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

I'd like to be able to repeat the message n times (1..n), especially for important messages to make sure they get heard

Describe the solution you'd like

Two new variable

  • Message Repeat Counter (minimum 1, maximum 50?)
  • Message Delay ms, amount of delay between messages, default 500 or 1000 ms
  • Possible Optional third to allow chime to play between messages if desired

When generating mp3, if counter > 1, add message delay and message n-1 times after the first message. If option to put chime between messages was implemented, could do if counter > 1, add existing chime delay then chime and existing chime delay and message n-1 times after the first message

Describe alternatives you've considered

Currently script n times in loop, have issues with clipping\skipping and delay issues

Additional context

n\a

Unrecognised format with Nabu Casa

System Health details

System Information

version core-2023.9.2
installation_type Unknown
dev false
hassio false
docker false
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 5.10.0-23-amd64
arch x86_64
timezone Europe/Paris
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4993
Installed Version 1.33.0
Stage running
Available Repositories 1299
Downloaded Repositories 35
Home Assistant Cloud
logged_in true
subscription_expiration 27 October 2023 at 02:00
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
remote_server eu-central-1-14.ui.nabu.casa
certificate_status ready
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Dashboards
dashboards 4
resources 21
views 14
mode storage
Recorder
oldest_recorder_run 26 September 2023 at 06:40
current_recorder_run 26 September 2023 at 20:47
estimated_db_size 611.00 MiB
database_engine mysql
database_version 11.1.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I installed this plugin via HACS and cannot get the chime to work, the debug logs looks like there is incompatibility with the file format and that the speech is not returned from Nabu Casa causing a 404. I am running HA in Kubernetes (i.e. docker container) and using tts from Nabu Casa, which works.

Please see debug log for details

Reproduction steps

alias: Apartment Doorbell Ring
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 2f2b67f724a6bdd6c301aa1c95e57b3e
    type: action
    subtype: pressed
    discovery_id: 0x5c0272fffee7c4c7 action_pressed
condition: []
action:
  - service: chime_tts.say
    data:
      end_chime_path: custom_components/chime_tts/mp3s/chirp.mp3
      delay: 450
      final_delay: 0
      tts_playback_speed: 100
      volume_level: 0.5
      message: Theres someone at the door
      tts_platform: cloud
      chime_path: custom_components/chime_tts/mp3s/bells_2.mp3
    target:
      entity_id: media_player.homepod_office
mode: single

Debug logs

2023-09-27 08:04:41.974 INFO (MainThread) [homeassistant.components.automation.apartment_doorbell_ring] Apartment Doorbell Ring: Executing step call service
2023-09-27 08:04:44.203 ERROR (MainThread) [root] Failed to parse metadata
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyatv/protocols/raop/audio_source.py", line 263, in get_buffered_io_metadata
    return await get_metadata(buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyatv/support/metadata.py", line 25, in get_metadata
    in_file = await loop.run_in_executor(None, _open_file, file)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyatv/support/metadata.py", line 15, in _open_file
    in_file = MediaFile(file)
              ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mediafile.py", line 165, in wrapper
    return mutagen_call('loadfile', '', f, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mediafile.py", line 137, in mutagen_call
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mutagen/_util.py", line 155, in wrapper
    return func(self, h, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mediafile.py", line 1586, in __init__
    raise FileTypeError(self.filename)
mediafile.FileTypeError: 'https://ogift7s3cbaedvngj0m5til283tegh8j.ui.nabu.casa/media/local/sounds/temp/chime_tts/jw5dmpx0.mp3?authSig=<REDACTE>?': not in a recognized format
2023-09-27 08:04:44.213 WARNING (MainThread) [custom_components.chime_tts] An unexpected error occurred: Got status 404 with message: Not Found

Diagnostics dump

No response

The cache parameter is a bit confusing

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

This is a fantastic project. Thanks.

In the first scenario, when calling the service through HomeAssistant:

If cache=True is set, when playing a TTS audio, it will first play the previously played audio or only start playing a part of it before playing the current audio content.

If cache=False is set, the first time a TTS audio is played after that, it will also play the previously played audio once again before playing the latest TTS content. After that, the TTS audio will play normally without playing the previous audio content.

In the second scenario, when calling it in Node-Red:

The data passed is as follows:

msg.payload={
   "chime_path":"custom_components/chime_tts/mp3s/ding_dong.mp3",
   "end_chime_path":"custom_components/chime_tts/mp3s/tada.mp3",
   "delay":450,
   "final_delay":20,
   "message":"昨日之日不可留",
   "tts_platform":"edge_tts",
   "cache":"True",
   "announce":"True"
}

return msg;

The output log is as follows:

2023-10-14 15:06:32.189 DEBUG (MainThread) [custom_components.chime_tts] Service call #0 was added to the queue.
2023-10-14 15:06:32.190 DEBUG (MainThread) [custom_components.chime_tts] Executing queued job #0
2023-10-14 15:06:32.190 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-10-14 15:06:32.191 DEBUG (MainThread) [custom_components.chime_tts] Chime path supplied = custom_components/chime_tts/mp3s/ding_dong.mp3
2023-10-14 15:06:32.191 DEBUG (MainThread) [custom_components.chime_tts] Chime path supplied = custom_components/chime_tts/mp3s/tada.mp3
2023-10-14 15:06:32.192 DEBUG (MainThread) [custom_components.chime_tts]  * entity_ids = ['media_player.mopidy']
2023-10-14 15:06:32.193 DEBUG (MainThread) [custom_components.chime_tts]  * hass = <HomeAssistant RUNNING>
2023-10-14 15:06:32.193 DEBUG (MainThread) [custom_components.chime_tts]  * chime_path = custom_components/chime_tts/mp3s/ding_dong.mp3
2023-10-14 15:06:32.195 DEBUG (MainThread) [custom_components.chime_tts]  * end_chime_path = custom_components/chime_tts/mp3s/tada.mp3
2023-10-14 15:06:32.196 DEBUG (MainThread) [custom_components.chime_tts]  * delay = 450.0
2023-10-14 15:06:32.196 DEBUG (MainThread) [custom_components.chime_tts]  * message = 昨日之日不可留
2023-10-14 15:06:32.196 DEBUG (MainThread) [custom_components.chime_tts]  * tts_platform = edge_tts
2023-10-14 15:06:32.196 DEBUG (MainThread) [custom_components.chime_tts]  * tts_playback_speed = 100.0
2023-10-14 15:06:32.197 DEBUG (MainThread) [custom_components.chime_tts]  * volume_level = -1.0
2023-10-14 15:06:32.197 DEBUG (MainThread) [custom_components.chime_tts]  * join_players = False
2023-10-14 15:06:32.197 DEBUG (MainThread) [custom_components.chime_tts]  * unjoin_players = False
2023-10-14 15:06:32.197 DEBUG (MainThread) [custom_components.chime_tts]  * cache = True
2023-10-14 15:06:32.197 DEBUG (MainThread) [custom_components.chime_tts]  * announce = True
2023-10-14 15:06:32.197 DEBUG (MainThread) [custom_components.chime_tts] ------
2023-10-14 15:06:32.198 INFO (MainThread) [custom_components.chime_tts] Media player entity "media_player.mopidy" is turned off. Turning on...
2023-10-14 15:06:32.307 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
2023-10-14 15:06:32.307 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("custom_components/chime_tts/mp3s/ding_dong.mp3", 0, audio)
2023-10-14 15:06:32.309 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/ding_dong.mp3"...
2023-10-14 15:06:32.819 DEBUG (MainThread) [custom_components.chime_tts]    - ...audio with duration 1.533s retrieved successfully
2023-10-14 15:06:32.819 DEBUG (MainThread) [custom_components.chime_tts] async_request_tts_audio(hass, tts_platform="edge_tts", message="昨日之日不可留", cache="True", language="None", tld="None", gender="None", tts_playback_speed="100.0"))
2023-10-14 15:06:32.819 DEBUG (MainThread) [custom_components.chime_tts]  - Generating TTS audio...
2023-10-14 15:06:33.339 DEBUG (MainThread) [custom_components.chime_tts]  - ...TTS audio completed in 519.817 ms
2023-10-14 15:06:33.371 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("custom_components/chime_tts/mp3s/tada.mp3", 450.0, audio)
2023-10-14 15:06:33.371 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/tada.mp3"...
2023-10-14 15:06:33.922 DEBUG (MainThread) [custom_components.chime_tts]    - ...audio with duration 2.323s retrieved successfully
2023-10-14 15:06:33.960 DEBUG (MainThread) [custom_components.chime_tts]  - Final audio created:
2023-10-14 15:06:33.960 DEBUG (MainThread) [custom_components.chime_tts]    - Duration = 6.916s
2023-10-14 15:06:33.960 DEBUG (MainThread) [custom_components.chime_tts] Creating final audio file
2023-10-14 15:06:33.961 DEBUG (MainThread) [custom_components.chime_tts]    - Temp folder exists: /media/sounds/temp/chime_tts/
2023-10-14 15:06:33.961 DEBUG (MainThread) [custom_components.chime_tts]  - Creating temporary mp3 file...
2023-10-14 15:06:33.961 DEBUG (MainThread) [custom_components.chime_tts]    - temp_obj = <tempfile._TemporaryFileWrapper object at 0x5de1bd10>
2023-10-14 15:06:33.963 DEBUG (MainThread) [custom_components.chime_tts]    - Filepath = '/media/sounds/temp/chime_tts/l11vjl9d.mp3'
2023-10-14 15:06:35.281 DEBUG (MainThread) [custom_components.chime_tts]    - File saved successfully
2023-10-14 15:06:35.282 DEBUG (MainThread) [custom_components.chime_tts]  - audio_dict = {'audio_path': '/media/sounds/temp/chime_tts/l11vjl9d.mp3', 'audio_duration': 6.916}
2023-10-14 15:06:35.282 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media service with data:
2023-10-14 15:06:35.282 DEBUG (MainThread) [custom_components.chime_tts]  - media_content_type: music
2023-10-14 15:06:35.282 DEBUG (MainThread) [custom_components.chime_tts]  - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/l11vjl9d.mp3
2023-10-14 15:06:35.283 DEBUG (MainThread) [custom_components.chime_tts]  - entity_id: ['media_player.mopidy']
2023-10-14 15:06:35.448 DEBUG (MainThread) [custom_components.chime_tts] ...media_player.play_media completed.
2023-10-14 15:06:35.448 DEBUG (MainThread) [custom_components.chime_tts] Waiting 6.916s for audio playback to complete...
2023-10-14 15:06:42.367 DEBUG (MainThread) [custom_components.chime_tts] Waiting 0.02s for final_delay to complete...
2023-10-14 15:06:42.391 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 10200.245 ms -----
2023-10-14 15:06:42.391 DEBUG (MainThread) [custom_components.chime_tts] Removing current queued service call.
2023-10-14 15:06:42.391 DEBUG (MainThread) [custom_components.chime_tts] Queue emptied. Reinitializing values.

The problem is: although cache=True is set, it doesn't seem to work. The generated file /media/sounds/temp/chime_tts/l11vjl9d.mp3 cannot be found in the file system, but the TTS audio output is normal.

Describe the solution you'd like

no.

Describe alternatives you've considered

I am also puzzled by the situation where it did not take effect in Node-Red. I will conduct further tests to find the reason.

Additional context

chime_tts version: v0.7.4-beta1
home-assistant version: 2023.10.3
home-assistant platform: docker
node-red version: v3.0.2
node-red installed node-red-contrib-home-assistant-websocket version: v0.57.4

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

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

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

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:
- 962e1ecfcfa33ef47f80f79361012e6a
- 8ef442075664c8dcfab2616a88de23f3
data:
delay: 450
final_delay: 2000
tts_playback_speed: 100
message: The big garage door is open
tts_platform: cloud
announce: true
cache: true
chime_path: bells

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

Alexa works with 'media_player.play_media' but not 'chime_tts.say' (local access with valid https)

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

HA is running with a valid https certificate but with NO access from the Internet. The configured internal and external urls are both https://valid.site.tld/ (via an nginx proxy)

Targeting an echo dot, calling play_media on a local mp3 works but calling chime_tts.say results in the "simon says" error.

Works:

service: media_player.play_media
data:
  media_content_id: media-source://media_source/local/conveniencestorering.mp3
  media_content_type: audio/mp3
target:
  entity_id: media_player.alexa_example

Fails:

service: chime_tts.say
target:
  entity_id: media_player.alexa_example
data:
  announce: true
  language: en
  join_players: true
  unjoin_players: true
  tts_platform: tts.piper
  chime_path: "media/subway-station-chime.mp3"
  message: |
    Good test message.

Describe the solution you'd like

It should be possible to work around the Internet-access issue in the same way that play_media does.

Describe alternatives you've considered

I have an older script that plays an item, waits for the player to go playing/stopped, then continues. This "works" for driving these speakers but not very well.

Additional context

Why is this field mandatory?

The TTS stopped working, but the Mediafile still plays

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

As of today I get this error:

This error originated from a custom integration.
Logger: custom_components.chime_tts
Source: custom_components/chime_tts/init.py:543
Integration: Chime TTS (documentation, issues)
First occurred: 11:07:06 AM (10 occurrences)
Last logged: 3:30:00 PM

  • Error calling tts.media_source.generate_media_source_id: Invalid variable type: value should be str, int or float, got False of type <class 'bool'>

It's been working fine sice I installed the add-on a few weeks ago. The mediafile plays but there is no TTS. I've checked that a manual TTS via the UI works via Media/TTS/Cloud. I use the "Nabu Casa Cloud".

Describe the solution you'd like

I want my messages read out again.

Describe alternatives you've considered

I'd hate to revert to the old way with the 3 step config. Media ->Wait-time -> TTS.

Additional context

None

Dropdown for chimes has "Custom 5" listed twice instead of "Custom 4" and then "Custom 5"

System Health details

Using v1.1.0-beta4, but this was also true on prior versions.

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

The dropdown for chime path has "5" listed twice instead of "4" and then "5"

image

Reproduction steps

  1. Setup Chime TTS
  2. Click on dropdown for Chime Path

Debug logs

n/a

Diagnostics dump

No response

Option language does not work for Microsoft Edge TTS

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Hi, if using edge_tts with the parameter language the voice stays the default (for me de-DE) voice and does not adapt to the chosen voice/language.

service: chime_tts.say
target:
  entity_id: media_player.arbeitszimmer
data:
  chime_path: bells
  end_chime_path: ""
  offset: 450
  final_delay: 0
  volume_level: 0.35
  message: Das ist ein Test.
  tts_platform: edge_tts
  language: de-DE-AmalaNeural

I greatly appreciate your help.
Kind regards,
Jonas

Describe the solution you'd like

The parameter 'language' does change the voice as desired.

Describe alternatives you've considered

With the following service provided by Home Assistant / the Edge TTS integration, choosing the language is working:

service: tts.edge_tts_say
data:
  entity_id: media_player.arbeitszimmer
  language: de-DE-AmalaNeural
  message: Das ist ein Test.

Additional context

.

WIKI: Missing prefix for Full example

Describe the issue

Wiki file: chime_tts.say.md#L280

There's a missing end_ prefix for the end_chime_path.

I could NOT create a PR, since the documentations is in the Wiki.

Please consider creating an issue template for documentation too. :

Not able to get this to work.

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Not working. I am sharing the logs from the integration.

Describe the solution you'd like

no

Describe alternatives you've considered

no

Additional context

This error originated from a custom integration.

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/init.py:949
Integration: Chime TTS (documentation, issues)
First occurred: 9:33:45 AM (1 occurrences)
Last logged: 9:33:45 AM

An error occurred: Unknown source directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.