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

Hi @Nimrod_Dolev , all. First of all, thank you for the hard work on this integration. It’s helpful!

My situation is as-follows:

  1. I’ve been using this with Sonos speakers
  2. Everything works fine when playing the announcement on the Kitchen Sonos speaker (A Play 1)
  3. When trying to play it on both the kitchen + living room Playbar, which is physically connected to the TV, it only announces on the kitchen one.

Here’s my code:

      - action: chime_tts.say
        target:
          entity_id: >
            {% set default_players = ['media_player.kitchen_sonos', 'media_player.living_room_sonos'] %}
            {% set players = target_media_player if target_media_player is defined and target_media_player is not none else default_players %}
            {% if players is string %}
              {{ [players] | tojson }}
            {% else %}
              {{ players | tojson }}
            {% endif %}
        data:
          chime_path: chord
          cache: false
          tts_platform: cloud_say
          voice: "NancyNeural||friendly"
          message: "{{ full_message }}"
          volume_level: >
            {% import 'common.jinja' as c with context %}
            {% if c.early or c.late %}
              0.125
            {% else %}
              0.5
            {% endif %}
          announce: true
          join_players: true
          unjoin_players: true
          final_delay: 250

This action is within a larger script, that also paused the TV before it gets to the above code if the TV was playing.

It announces just fine on the Kitchen Sonos but the living room one doesn’t say anything.

Any hints or others who have encountered this?

Thanks!!
Matt

EDIT: Interesting. It seems to work if I go into the Sonos app and uncheck “TV Autoplay”. In the Home Theater Settings. So I suspect it has to do with Sonos preferring the TV source. Will keep digging to get more info in case others hit this.

When using the announce: true parameter, is the music supposed to resume (ie: should it work) with Music Assistant? I’m not finding it the case for me. I use Music Assistant to stream to Google Home speakers. Not sure if this is a bug or that my setup is not supported.

I believe so. I checked some of my reliable automations and that’s what they have. I’m using a Sonos speaker through Music Assistant for what that’s worth.

I do remember finding that and/or fade audio was giving some unexpected results at one point. What it appears I landed on was announce.

Thanks. I’m not using the fade_audio parameter, only announce. Whenever a TTS is played, the Music Assistant playlist pauses just fine, the TTS is played, but then the music doesn’t resume…

YW. I’d guess it’s something to do with how the Google Home is handling it.

Turns out this is a long standing issue

It looks like in that issue, someone solved their problem by playing through MA player providers (I turned off the announce noise in the provider settings as it is redundant with ChimeTTS)

Have you tried that?

I’m just trying to figure out what the solution was there at the moment. I have a feeling the persons solution was to use the Music Assistant TTS feature and move away from Chime TTS but just reading into it now.

Does adding your speaker to MA create additional media_player entities with Google Home Speakers? If so, use those entities as your target for both the music and ChimeTTS.

I do have media players with _2 on the end which relate to the original ones. I’ll give it a try, thanks.

I guess that another issue which maybe I can’t get around is that in many cases I’ll have music playing a a particular group of Google Cast speakers, but the TTS message is only setup to broadcast to a few (or maybe only one) of those in the playing group… Guessing this will still fail to resume the music playback.

I must be missing something - I’ve installed the integration and taken the defaults.
When I try to use chime.say as an action in a automation I just get a blank configuration page.

What am I missing? I expected to see the sample screens as shown in the documentation. (btw, I’m updated to the latest HA. )
When I use the “developer” tools I get a similar result and an undefined error when I run the action. I uninstalled and reinstalled…

1 Like

FYI,
installing version 1.2.3-beta1 seems to have restored the missing configuration panels.

I ran into issues with that version.

Had to make these changes manually.

Hey all, I installed the chime TTS via HACS per the installation instructions, then added the integration.

I am using home assistant cloud and tested it works using ‘try’ in the text to speech panel.

I set up TTS configuration and selected “tts.home_assistant_cloud” from the default TTS platform dropdown. I also manually added the folders for the folder path options as these were not created during the installation.

When I went to test the chime_tts.say action from Developer Tools I just get a blank page. I don’t see the options seen in the chime_tts.say action documentation page. I just have a blank action page instead.

Any ideas? Have I missed something somewhere?

*** I re-did / checked the folder locations in the integration configuration and I now have the missing options ***

You haven’t lost anything… there’s been a problem with the UI.

The solution is here: v1.2.3-beta1 - UI works again, but no TTS generated · Issue #291 · nimroddolev/chime_tts · GitHub

U have to fic by yourself

Thanks for that, I ended up going with eleven labs TTS which seems to work great.

It works very well but the free plan is limited depending on the number of notifications

1 Like

Using v1.2.3beta 1. Attempting to configure. Unsure of why it’s telling me this dir isn’t a subfolder of a media directory:

All of these folders are in /media in the root of my config.

  1. Chime TTS will play previously created messages (cached?) but won’t create new messages
  2. Chime now truncates the chime. I.e. Bells I only get one ring not two

I haven’t changed anything since setting up Chime TTS some time ago
This happens with v 1.2.2 and 1.2.3-beta1

Test case: All I hear is part of Bells

action: chime_tts.say
data:
  chime_path: bells
  offset: 450
  message: Hello world!
  tts_platform: tts.piper
  volume_level: 0.75
target:
  entity_id: media_player.raspiaudio_muse_luxe
  
  Logger: custom_components.chime_tts.helpers.helpers
Source: custom_components/chime_tts/helpers/helpers.py:370
integration: Chime TTS (documentation, issues)
First occurred: 5:52:47 PM (1 occurrence)
Last logged: 5:52:47 PM

Unable to select a TTS platform - installed TTS platforms: ['cloud']

Logger: custom_components.chime_tts
Source: custom_components/chime_tts/__init__.py:932
integration: Chime TTS (documentation, issues)
First occurred: 5:52:47 PM (1 occurrence)
Last logged: 5:52:47 PM

Error generating TTS audio from messsage segment #1: {'type': 'tts', 'message': 'Hello world!'}

Hi. Quick question. What are the required parameters for the MP3 files for Chime TTS please? I have tried adding a couple of MP3s to the relevant directory but they don’t play before the TTS portion of the announcement.

I haven’t been able to find anything regarding why these files are not working on the www.

Thanks in Advance :slight_smile:

[EDIT] Never mind. Turned out to be a problem with the directory I had the MP3 files in, as well as the occasional forget to restart HA.

Thanks to anyone that looked anyway :slight_smile: