Chime TTS - Play audio before/after TTS audio lag free

I’m not familiar with the Google TTS platform… Perhaps there’s something in that config that does the chime.

In my case I was targeting a media_player that Music Assistant provided. That media_player had “pre-announce” defaults that were redundant when using Chime TTS, so I had to turn them off.

Hello,

I just tried this integration and it seems like on both my Google Nest Display and original Google Home if I set the volume to 1 the volume will actually turn to 1/10 on the devices, I have to set it to 0.99 instead which seems to work. Also the announce feature doesn’t seem to work.

Sigi.

Hello. Is there an update of HomePod mini which prevent Chime TTS to work ?
Actually, a few months (can’t remember when, and I didn’t had time to search a solution) ago ChimeTTS stopped to produce any sound on my HomePod mini (it worked very well before).

Thanks

Been trying to figure this weird one out, so far no joy.

Occasionally an announcement made thru chime_tts, appears to fail, but the logs do not show anything, and the problem is it isn’t reproducible. An example: the washer completes its cycle and triggers the announcement that it’s done. The music playing on the Sonos speakers fades down to a lower level and then quiet until the music returns to normal volume. If I trigger the announcement manually, it plays just fine, and it plays fine for the next announcement also. I’ve looked at the logs for both Sonos and Chime_TTS and there are no errors.

At first I thought maybe the IP address for the Sonos speakers was getting dropped by my router, but the Sonos speakers have reserved IP addresses and the renewal time is over 24hrs, so that’s not it, besides I have 5 Sonos speakers and it fails on all of them.

Don’t think it would be any help to upload log files because they don’t show anything. I’ve tried removing and reinstalling/configuring chime_tts to no avail so I’m stumped. If anybody using Sonos speakers might have possible insight toss in a suggestion.

====================================================

Was this question about using HAOS mounted network storage for media files answered?

I also store all my audio files on a NAS to reduce backup sizes and bloat.

Is there a local path the remote shares are mounted in?
Can you add its contents to the dropdown by default?

Is there a way to use the HA media picker control like the Media Player action?

I found the mount location /media/Media
image

I updated the config for chime:
image

But pick list is still not populating:

Suggestions for troubleshooting?

Hello everyone, maybe someone can help.

I have a local TTS Marytts, it takes up to 7 seconds to generate a response, It seems that Chime does not receive a response in time and thinks that the file is not generated, but if the response file was already in the cache, then it works as it should.
As a result, it turns out like this:
10:00:01 Hey Jarvis, what time is it?
10:00:03 …
10:00:10 Hey Jarvis, what time is it?
10:00:13 It’s 10:00 now
10:01:01 Hey Jarvis, what time is it?
10:01:03 …

LOG:

2025-01-19 15:14:34.804 ERROR (MainThread) [custom_components.chime_tts.helpers.tts_audio_helper]    - Error calling tts.async_get_media_source_audio with media_source_id = 'media-source://tts/marytts?message=%D1%81%D0%B5%D0%B9%D1%87%D0%B0%D1%81+15+14&cache=false&tts_options=%7B%7D': timed out
2025-01-19 15:14:34.805 ERROR (MainThread) [custom_components.chime_tts.helpers.tts_audio_helper] ...audio_data generation failed
2025-01-19 15:14:34.805 WARNING (MainThread) [custom_components.chime_tts] Error generating TTS audio from messsage segment #1: {'type': 'tts', 'message': 'сейчас 15 14'}

Uninstalled because of this Every ChimeTTS use through MPD integration results in ban attempt · Issue #159 · nimroddolev/chime_tts · GitHub, which I know isn’t the authors fault.

Hi. Is it possible to create a several predefined messages and play one at the time in random order? Like this one here:

just put that template in the message field. it is a standard template function, will work with the message. You might need to edit only in yaml after pasting that.

Hey, is it possible for me to use custom “.onnx” AI voices with ChimeTTS? I’ve only been seeing tutorials on how to use ChimeTTS with Google, elevenlabs, etc, but I wondered if I can use custom AI voices with this Text to Speech engine.

Hi Everyone,

I really love Chime TTS especially the announce function which I really want to use. But after an initial succes of setting up Chime TTS on my system of 4 Sonos one and 7 AirPort Express airplay 2 devices. After a weekend away from the house trouble started. Only one of the sonos devices would still play the Chime TTS script that I made and none of the airplay devices would work.

First I found out that the Sonos players were getting an IP ban due to expired URL tokens and I found the workaround for that in this topic https://github.com/home-assistant/core/issues/88714#issuecomment-2692173073

Now I am wrecking my head over how to get the chime_tts.say function to start working again on my airplay 2 devices. I can get a direct google translate TTS and also a chime_tts.say_url function to work. But if I want to call chime_tts.say then the below connection lost error logs appear and the sound does not play, were it did play perfectly before. Below is the script that I use, it works now on the Sonos players but not on the airport express airplay2 devices:

alias: Original Chime TTS Test
sequence:
  - action: chime_tts.say
    data:
      tts_platform: google_translate
      message: Test message
      chime_path: bright
      language: nl
      announce: true
      volume_level: 0.5
    target:
      entity_id: media_player.dynaudio_airplay
mode: single

I get the following errors in the log:

This error originated from a custom integration.

Logger: custom_components.chime_tts.helpers.media_player_helper
Source: custom_components/chime_tts/helpers/media_player_helper.py:569
integration: Chime TTS (documentation, issues)
First occurred: 3 March 2025 at 19:12:46 (7 occurrences)
Last logged: 19:26:04

Unable to set media_player.dynaudio_airplay's volume to 0.33: connection was lost
Unable to set media_player.dynaudio_airplay's volume to 0.3299999999999999: connection was lost
Unable to set media_player.dynaudio_airplay's volume to 0.15: connection was lost
Unable to set media_player.dynaudio_airplay's volume to 0.18999999999999997: connection was lost
Unable to set media_player.dynaudio_airplay's volume to 0.32000000000000006: connection was lost

Logger: homeassistant.core
Source: core.py:2814
First occurred: 3 March 2025 at 19:12:46 (7 occurrences)
Last logged: 19:26:04

Error executing service: <ServiceCall media_player.play_media (c:01JNEQBQ9NNNP786Y024NRYWQS): entity_id=['media_player.dynaudio_airplay'], announce=True, extra=, media_type=music, media_id=media-source://media_source/local/sounds/temp/chime_tts/b2d01a6ac0c7319db367792cd8875c29.mp3>
Error executing service: <ServiceCall media_player.play_media (c:01JNGQ23PG9Y5WT64AKAKH3BAM): entity_id=['media_player.dynaudio_airplay'], announce=True, extra=, media_type=music, media_id=media-source://media_source/local/sounds/temp/chime_tts/0aa07b8a4593a0ae94c2eaae8a0bb979.mp3>
Error executing service: <ServiceCall media_player.play_media (c:01JNH6BF1XYZS1BFPNC44BQ4NM): entity_id=['media_player.dynaudio_airplay'], announce=True, extra=, media_type=music, media_id=media-source://media_source/local/sounds/temp/chime_tts/6c91772fa8e1cb0fc9f3f1470588b5fe.mp3>
Error executing service: <ServiceCall media_player.play_media (c:01JNH6DA3XH642QK6N7JZFD450): entity_id=['media_player.dynaudio_airplay'], announce=True, extra=, media_type=music, media_id=media-source://media_source/local/sounds/temp/chime_tts/b92c43f566fd1fea809167a53573345f.mp3>
Error executing service: <ServiceCall media_player.play_media (c:01JNH6GQBF7HWFWYMS8R4MG870): entity_id=['media_player.dynaudio_airplay'], announce=True, extra=, media_type=music, media_id=media-source://media_source/local/sounds/temp/chime_tts/fa8c3bb141ce06dca17ce4d47d65850c.mp3>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2814, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/media_player.py", line 345, in async_play_media
    await self.atv.stream.stream_file(media_id)
  File "/usr/local/lib/python3.13/site-packages/pyatv/core/facade.py", line 374, in stream_file
    await self.relay("stream_file")(
    ...<4 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/raop/__init__.py", line 356, in stream_file
    await client.initialize(self.core.service.properties)
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/raop/stream_client.py", line 338, in initialize
    await self._protocol.setup(self.timing_server.port, self.control_client.port)
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 109, in setup
    await self._setup_base(timing_server_port)
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/raop/protocols/airplayv2.py", line 56, in _setup_base
    setup_resp = await self.rtsp.setup(
                 ^^^^^^^^^^^^^^^^^^^^^^
    ...<17 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyatv/support/rtsp.py", line 177, in setup
    return await self.exchange("SETUP", headers=headers, body=body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/support/rtsp.py", line 294, in exchange
    resp = await self.connection.send_and_receive(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyatv/support/http.py", line 467, in send_and_receive
    raise exceptions.ConnectionLostError("connection was lost")
pyatv.exceptions.ConnectionLostError: connection was lost

I have made debug log too, but it is very long and do not see how I ca post it.

Would anyone be able to help me get this going again? It seems like there is an issue with being able to play the local temporary file because any other media does play, and also I can play a local file from the chime tts folder in the /media/sounds/temp/chime_tts/ folder. But the file that I find there strongly enough is an old TTS file that was created when the script was still working more than a week ago.

I really love the announce feature and how it even works over external audio played via airplay by another source, which is why it would love it to start working again!


I get this error:

An OSError occurred while creating the folder ‘/media/sounds/temp/chime_tts/’: [Errno 13] Permission denied: ‘/media/sounds’

I’m using home assistant in a docker container.

I’ve added this in configuration.yaml, but it didn’t help. Same error message:

media_dirs:
    local: /media

Inside the container I try this:

root@rpi4:/media# ls -la
total 20
drwxr-xr-x 5 root root 4096 Feb 15 14:36 .
drwxr-xr-x 1 root root 4096 Mar  5 04:09 ..
drwxr-xr-x 2 root root 4096 Feb 15 14:36 cdrom
drwxr-xr-x 2 root root 4096 Feb 15 14:36 floppy
drwxr-xr-x 2 root root 4096 Feb 15 14:36 usb
root@rpi4:/media# 

I’m not sure how to edit permissions in a docker container. Any ideas?

@Nimrod_Dolev are you still maintaining this integration?

I haven’t had much time to put into maintaining the integration lately but I do plan to continue. I’m always happy for pull requests if anyone else also wishes to contribute.

@Nimrod_Dolev I understand you must have been busy. Sorry for calling you out like this. I really like your integration but I had some trouble with my Sonos and now especially with my airplay2 AirPort Express devices.

I understand if your schedule doesn’t allow it but if it does I am a bit stuck with the error I described in my post above. Chime TTS - Play audio before/after TTS audio lag free - #772 by Sebastiaan1

Would you point me in the direction please?

@Sebastiaan1 i’m happy to hear you’ve found the integration useful, thank you :+1:

I’m sorry you’ve been having issues with your Sonos device. I know that the Sonos integration for Home Assistant has been causing trouble for a lot of users, from what I can tell from posts to the forums (here and generally), and more specifically when I worked with volunteer testers on the Chime TTS issues page.

I reviewed what you reported in your posts and the fact that things were working and then stopped tells me that it’s unlikely Chime TTS is directly causing the issue. I can tell you that under the hood the chime_tts.say action calls media_player.play_media to play the generated audio file.

Unfortunately I don’t own any Sonos devices, which makes it very difficult to troubleshoot and solve issues related to them. It might be useful if you could please provide the full debug log messages so that I can trace what is and isn’t working, and perhaps something insightful might reveal itself.

Hey @danwie, sorry you’ve been having issues.

It indeed looks like you’re dealing with a permissions issue. I’m no docker expert but perhaps you could open up the permissions on your /media folder to allow Chime TTS to read/write file there?

Try running: sudo chmod 777 /media to allow read/write access

Hey @Stubborn.

After you set the /media/Media folder path for your custom chime audio files, did you restart Home Assistant?

If you did, and they still aren’t added to the dropdown list, it might be due to a folder permission issue…or something else. Can you please enable debug logging, restart Home Assistant, and provide the debug log messages? Hopefully they might shed some light on what the issue is.

Hey @IssacI19. Chime TTS works with the TTS platforms you’ve added into your Home Assistant instance. I think you might be able to use .onnx files with Piper (never tried though). If you get that working then there’s no reason why it won’t also work with Chime TTS :+1: