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

I just installed it. Will keep you posted.

Hi thanks for the new beta.

Trying with fade_audio would fade out but did not change the announce volume and did not fade back after and playing the music.

Steffen

Hi @SteffenDE. Could you please provide me with the debug log messages?

2024-04-18 08:36:38.104 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta3 -----
2024-04-18 08:36:38.104 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-18 08:36:38.212 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-18 08:36:38.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.sonos_buero']
2024-04-18 08:36:38.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-04-18 08:36:38.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-04-18 08:36:38.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 0.0
2024-04-18 08:36:38.213 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array = [{'entity_id': 'media_player.sonos_buero', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.08, 'playback_volume_level': 0.7, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}]
2024-04-18 08:36:38.214 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Guten Morgen, dies ist ein Test
2024-04-18 08:36:38.214 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = edge_tts
2024-04-18 08:36:38.214 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-04-18 08:36:38.214 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-04-18 08:36:38.214 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-04-18 08:36:38.214 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = True
2024-04-18 08:36:38.215 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.7
2024-04-18 08:36:38.215 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-04-18 08:36:38.215 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-04-18 08:36:38.217 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-04-18 08:36:38.217 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'edge_tts'
2024-04-18 08:36:38.217 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Guten Morgen, dies ist ein Test'
2024-04-18 08:36:38.217 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-04-18 08:36:38.218 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-04-18 08:36:38.218 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-04-18 08:36:39.154 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 940.0ms
2024-04-18 08:36:39.155 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-04-18 08:36:39.466 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /media/sounds/temp/chime_tts/h72largz.mp3
2024-04-18 08:36:39.944 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-04-18 08:36:39.944 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 2.904
2024-04-18 08:36:39.945 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/h72largz.mp3"
2024-04-18 08:36:39.945 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-04-18 08:36:39.945 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/h72largz.mp3"
2024-04-18 08:36:39.945 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-04-18 08:36:39.946 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-04-18 08:36:39.947 DEBUG (MainThread) [custom_components.chime_tts] 1 Sonos media player detected:
2024-04-18 08:36:39.947 DEBUG (MainThread) [custom_components.chime_tts] - media_player.sonos_buero
2024-04-18 08:36:39.947 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.sonos_buero', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.08, 'playback_volume_level': 0.7, 'group_members_supported': True, 'announce_supported': True, 'is_playing': False}
2024-04-18 08:36:39.947 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-04-18 08:36:39.948 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-04-18 08:36:39.948 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/h72largz.mp3
2024-04-18 08:36:39.948 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.sonos_buero']
2024-04-18 08:36:39.948 DEBUG (MainThread) [custom_components.chime_tts] - extra: {'volume': 0.7}
2024-04-18 08:36:39.956 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 2.904s for audio playback to complete...
2024-04-18 08:36:42.868 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player isn't playing...
2024-04-18 08:36:42.868 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.sonos_buero
2024-04-18 08:36:42.869 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 4.66 s -----
1 Like

Thank you for the logs. I believe I have fixed the issue and released a new beta: v1.1.0-beta4

Thank you for building this. I can get it to work with my Sonos speakers alone, but not with my Alexa (Echo) speakers. What I want is to run this on both Sonos and Echo speakers at the same time. Below is a sample automation to announce when the washing machine is done. I took the Chime TTS YAML for Alexa directly from the GitHub here. However, this gives me the following error message when I try to save the automation:

Message malformed: extra keys not allowed @ data['sequence']

Here is the automation that will not save:

alias: Laundry Washing Machine Notification
description: >-
  Send a push notification to phones and announce on Echo and Sonos devices if
  it is not between 1 and 3:30 pm on the weekend or 7:30 pm and 7:00 am any day
  when washing machine current consumption is above 5 watts for 1 min 30 sec and
  then falls below 5 watts for 1 min 30 sec
trigger:
  - platform: numeric_state
    entity_id: sensor.washing_machine_current_consumption
    for:
      hours: 0
      minutes: 1
      seconds: 30
    above: 5
condition:
  - condition: state
    entity_id: input_boolean.kill_switch
    state: "off"
  - condition: state
    entity_id: input_boolean.washing_machine_override
    state: "off"
action:
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.washing_machine_current_consumption
        for:
          hours: 0
          minutes: 1
          seconds: 30
        below: 5
  - service: notify.mobile_app_michaels_iphone
    data:
      message: >-
        Washing machine is done at {{as_timestamp
        (states.sensor.washing_machine_current_consumption.last_changed) |
        timestamp_custom("%-I:%M %p (%m-%d-%y)")}}
      data:
        clickAction: /lovelace-minimalist-2/laundry
        url: /lovelace-minimalist-2/laundry
      title: Laundry
  - service: notify.mobile_app_ashleys_iphone
    data:
      message: >-
        Washing machine is done at {{as_timestamp
        (states.sensor.washing_machine_current_consumption.last_changed) |
        timestamp_custom("%-I:%M %p (%m-%d-%y)")}}
      data:
        clickAction: /lovelace-minimalist-2/laundry
        url: /lovelace-minimalist-2/laundry
      title: Laundry
  - condition: or
    conditions:
      - condition: not
        conditions:
          - condition: time
            after: "13:00:00"
            before: "15:30:00"
            weekday:
              - sun
              - sat
          - condition: time
            after: "19:30:00"
            before: "07:00:00"
            weekday:
              - sun
              - mon
              - tue
              - wed
              - thu
              - fri
              - sat
sequence:
  - service: chime_tts.say_url
    response_variable: chime_tts
    data:
      message: The washing machine is done
      tts_platform: google_translate
      audio_conversion: Alexa
      language: en
      chime_path: custom_chime_path_1
      tld: com
  - service: notify.alexa_media
    data:
      message: <audio src="{{chime_tts.url}}"/>
      target:
        - media_player.michael_s_echo
      data:
        type: tts
mode: single

Here is just the notification portion for a Sonos speaker that does work (my goal is to have this work for both Sonos and Alexa in the same automation):

  - service: chime_tts.say
    target:
      device_id:
        - c99b88e8d7470f54d1b33ed6f2fc607f
    data:
      chime_path: custom_chime_path_1
      end_chime_path: ""
      final_delay: 0
      tts_speed: 100
      tts_pitch: 0
      volume_level: 0.3
      tts_platform: google_translate
      message: The washing machine is done

And finally, here is the notify portion that was working across Sonos and Alexa before I installed Chime TTS:

  - service: notify.alexa_media
    data:
      message: The washing machine is done
      data:
        type: tts
      target:
        - media_player.michael_s_echo
        - media_player.michael_s_echo_dot
  - service: tts.google_translate_say
    data:
      cache: false
      message: The washing machine is done
      entity_id: media_player.basement_bedroom

Hi,

did not work with 1.1.0-beta4 here. Fade out but did not fade in and volume is not changed:

service: chime_tts.say
data:
  chime_path: ding_dong
  offset: 450
  final_delay: 100
  message: Hallo dies ist ein Test
  tts_platform: edge_tts
  volume_level: 0.6
  fade_audio: true
target:
  entity_id: media_player.sonos_buero

2024-04-20 09:30:48.327 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta4 -----
2024-04-20 09:30:48.327 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-20 09:30:48.389 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-20 09:30:48.390 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * entity_ids = ['media_player.sonos_buero']
2024-04-20 09:30:48.390 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * chime_path = ding_dong
2024-04-20 09:30:48.390 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * cache = False
2024-04-20 09:30:48.390 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * offset = 450.0
2024-04-20 09:30:48.390 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * final_delay = 100.0
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * media_players_array = [{'entity_id': 'media_player.sonos_buero', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.09, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': True}]
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * message = Hallo dies ist ein Test
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_platform = edge_tts
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_speed = 100.0
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * tts_pitch = 0
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * announce = False
2024-04-20 09:30:48.391 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * fade_audio = True
2024-04-20 09:30:48.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * volume_level = 0.6
2024-04-20 09:30:48.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * join_players = False
2024-04-20 09:30:48.392 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] * unjoin_players = False
2024-04-20 09:30:48.393 DEBUG (MainThread) [custom_components.chime_tts] - Retrieving audio from path: "custom_components/chime_tts/mp3s/ding_dong.mp3"...
2024-04-20 09:30:49.773 DEBUG (MainThread) [custom_components.chime_tts] ...audio retrieved. Duration: 1.533s
2024-04-20 09:30:49.774 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-04-20 09:30:49.775 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'edge_tts'
2024-04-20 09:30:49.775 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Hallo dies ist ein Test'
2024-04-20 09:30:49.775 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-04-20 09:30:49.775 DEBUG (MainThread) [custom_components.chime_tts] * language = None
2024-04-20 09:30:49.775 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-04-20 09:30:52.877 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio generated in 3.1s
2024-04-20 09:30:52.907 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-04-20 09:30:53.397 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] - File saved to path: /media/sounds/temp/chime_tts/bj05wep0.mp3
2024-04-20 09:30:53.841 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated:
2024-04-20 09:30:53.841 DEBUG (MainThread) [custom_components.chime_tts] - audio_duration = 4.311
2024-04-20 09:30:53.841 DEBUG (MainThread) [custom_components.chime_tts] - local_path = "/media/sounds/temp/chime_tts/bj05wep0.mp3"
2024-04-20 09:30:53.842 DEBUG (MainThread) [custom_components.chime_tts] - public_path = None
2024-04-20 09:30:53.842 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/bj05wep0.mp3"
2024-04-20 09:30:53.842 DEBUG (MainThread) [custom_components.chime_tts] *** Pre-Playback Actions ***
2024-04-20 09:30:53.842 DEBUG (MainThread) [custom_components.chime_tts] - Fading out media_players currently playing
2024-04-20 09:30:53.843 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Fading out media_player.sonos_buero's volume from 0.09 to 0 over 0.5s
2024-04-20 09:30:57.619 DEBUG (MainThread) [custom_components.chime_tts] - Pausing 1 media_player
2024-04-20 09:30:57.670 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player is paused...
2024-04-20 09:30:59.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.sonos_buero
2024-04-20 09:30:59.882 DEBUG (MainThread) [custom_components.chime_tts] *** Chime TTS playback ***
2024-04-20 09:30:59.883 DEBUG (MainThread) [custom_components.chime_tts] 1 Sonos media player detected:
2024-04-20 09:30:59.883 DEBUG (MainThread) [custom_components.chime_tts] - media_player.sonos_buero
2024-04-20 09:30:59.884 DEBUG (MainThread) [custom_components.chime_tts] sonos_media_player_dict = {'entity_id': 'media_player.sonos_buero', 'platform': 'sonos', 'should_change_volume': True, 'initial_volume_level': 0.09, 'playback_volume_level': 0.6, 'group_members_supported': True, 'announce_supported': True, 'is_playing': True, 'fade_out_volume': 0, 'volume_steps': [0.0675, 0.045, 0.022499999999999992]}
2024-04-20 09:30:59.884 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-04-20 09:30:59.884 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-04-20 09:30:59.884 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/bj05wep0.mp3
2024-04-20 09:30:59.884 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.sonos_buero']
2024-04-20 09:30:59.884 DEBUG (MainThread) [custom_components.chime_tts] - extra: {'volume': 0.6}
2024-04-20 09:30:59.888 DEBUG (MainThread) [custom_components.chime_tts] - Waiting 4.411s for audio playback to complete...
2024-04-20 09:31:04.486 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player isn't playing...
2024-04-20 09:31:06.275 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.sonos_buero
2024-04-20 09:31:06.275 DEBUG (MainThread) [custom_components.chime_tts] *** Post-Playback Actions ***
2024-04-20 09:31:06.275 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Waiting until 1 media_player is paused...
2024-04-20 09:31:06.276 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ✔ media_player.sonos_buero
2024-04-20 09:31:06.276 DEBUG (MainThread) [custom_components.chime_tts] - Setting volume to 0
2024-04-20 09:31:06.304 DEBUG (MainThread) [custom_components.chime_tts] - Resuming 1 media_player
2024-04-20 09:31:07.782 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] - Fading in media_player.sonos_buero's volume from 0.0 to 0.09 over 0.5s
2024-04-20 09:31:08.244 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 19.86 s -----

Trying Fade Audio in the latest beta while playing Spotify on Amazon Echos, the music fades out and the announcement plays but, Spotify pauses and does not resume after the announcement.
Here’s the log.

2024-04-20 12:20:33.587 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2024-04-20 12:20:33.588 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta4 -----
2024-04-20 12:20:33.588 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.kitchen_echo_show']
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = bells
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * end_chime_path = ba_dum_tss
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-04-20 12:20:33.589 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array = [{'entity_id': 'media_player.kitchen_echo_show', 'platform': 'alexa_media', 'should_change_volume': True, 'initial_volume_level': 0.2, 'playback_volume_level': 0.3, 'group_members_supported': False, 'announce_supported': False, 'is_playing': True}]
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = this is a test
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = tts.piper
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = True
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.3
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-04-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-04-20 12:20:33.590 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-20 12:20:33.590 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  --- Audio will be converted to Alexa-friendly format as Alexa speaker/s detected ---
2024-04-20 12:20:33.591 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/bells.mp3"...
2024-04-20 12:20:33.683 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 0.944s
2024-04-20 12:20:33.684 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-04-20 12:20:33.684 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'tts.piper'
2024-04-20 12:20:33.684 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'this is a test'
2024-04-20 12:20:33.684 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-04-20 12:20:33.684 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-04-20 12:20:33.684 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-04-20 12:20:34.897 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 1.21s
2024-04-20 12:20:34.919 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/ba_dum_tss.mp3"...
2024-04-20 12:20:35.013 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.403s
2024-04-20 12:20:35.021 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /config/www/chime_tts/...
2024-04-20 12:20:35.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem]  - File saved to path: /config/www/chime_tts/awuvinvg.mp3
2024-04-20 12:20:35.153 DEBUG (MainThread) [custom_components.chime_tts]   - Performing FFmpeg audio conversion...
2024-04-20 12:20:35.153 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Converting audio: "ffmpeg -i /config/www/chime_tts/awuvinvg.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/awuvinvg_converted.mp3"
2024-04-20 12:20:35.259 DEBUG (MainThread) [custom_components.chime_tts]     ...FFmpeg audio conversion completed.
2024-04-20 12:20:35.364 DEBUG (MainThread) [custom_components.chime_tts]  - Saving data to chime_tts storage:
2024-04-20 12:20:35.364 DEBUG (MainThread) [custom_components.chime_tts]    - key:   "70c3c5e59acb9cd97db5c2768718763c7c038804f63c7d8904259f95d17cb5b9"
2024-04-20 12:20:35.364 DEBUG (MainThread) [custom_components.chime_tts]    - value: "{'public_path': '/config/www/chime_tts/awuvinvg.mp3', 'audio_duration': 5.352}"
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]    - audio_duration = 5.352
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]    - local_path = None
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]    - public_path = "https://url_here.org:443/local/chime_tts/awuvinvg.mp3"
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]    - media_content_id = None
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts]  - Fading out media_players currently playing
2024-04-20 12:20:35.366 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Fading out media_player.kitchen_echo_show's volume from 0.2 to 0 over 0.5s
2024-04-20 12:20:35.746 DEBUG (MainThread) [custom_components.chime_tts]  - Pausing 1 media_player
2024-04-20 12:20:35.747 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 1 media_player is paused...
2024-04-20 12:20:37.356 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    𝘅 media_player.kitchen_echo_show - Timed out
2024-04-20 12:20:37.356 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-04-20 12:20:37.357 DEBUG (MainThread) [custom_components.chime_tts]    1 Alexa media player detected:
2024-04-20 12:20:37.357 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.kitchen_echo_show
2024-04-20 12:20:37.357 DEBUG (MainThread) [custom_components.chime_tts]    Calling notify.alexa_media with data:
2024-04-20 12:20:37.357 DEBUG (MainThread) [custom_components.chime_tts]      - message: <audio src="https://url_here.org:443/local/chime_tts/awuvinvg.mp3"/>
2024-04-20 12:20:37.357 DEBUG (MainThread) [custom_components.chime_tts]      - data: {'type': 'tts'}
2024-04-20 12:20:37.357 DEBUG (MainThread) [custom_components.chime_tts]      - target: ['media_player.kitchen_echo_show']
2024-04-20 12:20:37.358 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 5.352s for audio playback to complete...
2024-04-20 12:20:42.714 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 1 media_player isn't playing...
2024-04-20 12:20:42.714 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.kitchen_echo_show
2024-04-20 12:20:42.714 DEBUG (MainThread) [custom_components.chime_tts]  *** Post-Playback Actions ***
2024-04-20 12:20:42.714 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 1 media_player is paused...
2024-04-20 12:20:47.740 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    𝘅 media_player.kitchen_echo_show - Timed out
2024-04-20 12:20:47.740 WARNING (MainThread) [custom_components.chime_tts] Timed out waiting for 1 media_player to pause
2024-04-20 12:20:47.740 DEBUG (MainThread) [custom_components.chime_tts]      - Setting volume to 0
2024-04-20 12:20:47.741 DEBUG (MainThread) [custom_components.chime_tts]    - Resuming 1 media_player

Got this installed, it mostly works.

I’m testing chime_tts.say_url in a script to use with Echo players. I have Alexa Media Player and it works correctly for both MP3s and TTS, but I have to add a wait delay between them which is kludgy. I really want to leverage this more elegant solution.

Whenever I run the service call I get a popup with “unknown error”, but it is creating the MP3 files, and when I play them they are correct.
With the exception of Amazon Polly.

If i choose a chime before and after and a text phrase, it throws the “unknown error” message but creates the MP3 correctly if I select cloud (Nabu Casa) or Google.
When i select Amazon Polly the MP3 created has the preamble chime and the postamble chime sounds, but no TTS speach. Is there something special to configure to use Amazon?

Hey @Desert_AIP ! I use Amazon devices and I don’t have any error or delay when using the following yaml below. Did you enable the beta version to download of Chime_TTS or are you using the stable release?

Also, it might be helpful if you show your logs for Nimrod to troubleshoot your issue. :slight_smile: Just be sure to redact your unique code portion of your Nabu Casa link if you’re using custom chimes.

service: chime_tts.say
target:
  device_id:
    - ef5af0a1e39fc38663be1d260e347f40
    - bec8cf8ad0fcf70965e8eb5cce0f4654
    - cbe11566dd6ed0a334f41fc51566c1f1
    - eb6e6046a6c8b41db1f12f09f5811ae3
data:
  chime_path: bells
  tts_platform: amazon_polly
  announce: true
  end_chime_path: custom_chime_path_1
  message: Colton, someone's at the door.
  join_players: false
  unjoin_players: false

@Nimrod_Dolev @Desert_AIP I do get an unknown error when I play one of my longer wav files (37.704s). Desert, could one of your mp3’s be a long one like in my situation?

2024-04-21 19:37:06.990 DEBUG (MainThread) [custom_components.chime_tts.notify] ----- Chime TTS Notify -----
2024-04-21 19:37:06.990 DEBUG (MainThread) [custom_components.chime_tts.notify]  - data = {'chime_path': '/media/sounds/chimes/474983__xiscovar__cat-meowing.wav', 'volume_level': 0.5}
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - message = 'Here kitty kitty kitty kitty kitty kitty kitty?'
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - entity_id = ['media_player.colton_s_echo_show', 'media_player.apartment_door_echo_amz', 'media_player.kitchen_echo_plus_amz', 'media_player.bathroom_echo_amz', 'media_player.couch_echo_left_amz']
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - chime_path = '/media/sounds/chimes/474983__xiscovar__cat-meowing.wav'
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - tts_platform = 'amazon_polly'
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - volume_level = 0.5
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - join_players = True
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - unjoin_players = True
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - announce = True
2024-04-21 19:37:06.991 DEBUG (MainThread) [custom_components.chime_tts.notify]  - language = 'en-AU'
2024-04-21 19:37:06.992 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.1.0-beta4 -----
2024-04-21 19:37:06.992 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-04-21 19:37:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-04-21 19:37:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids:
2024-04-21 19:37:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: media_player.kitchen_echo_plus_amz
2024-04-21 19:37:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: media_player.apartment_door_echo_amz
2024-04-21 19:37:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: media_player.bathroom_echo_amz
2024-04-21 19:37:07.000 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 3: media_player.couch_echo_left_amz
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 4: media_player.colton_s_echo_show
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = /media/sounds/chimes/474983__xiscovar__cat-meowing.wav
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: {'entity_id': 'media_player.kitchen_echo_plus_amz', 'platform': 'alexa_media', 'should_change_volume': True, 'initial_volume_level': 0.5, 'playback_volume_level': 0.5, 'group_members_supported': False, 'announce_supported': False, 'is_playing': False}
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 1: {'entity_id': 'media_player.apartment_door_echo_amz', 'platform': 'alexa_media', 'should_change_volume': True, 'initial_volume_level': 0.5, 'playback_volume_level': 0.5, 'group_members_supported': False, 'announce_supported': False, 'is_playing': False}
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 2: {'entity_id': 'media_player.bathroom_echo_amz', 'platform': 'alexa_media', 'should_change_volume': True, 'initial_volume_level': 0.5, 'playback_volume_level': 0.5, 'group_members_supported': False, 'announce_supported': False, 'is_playing': False}
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 3: {'entity_id': 'media_player.couch_echo_left_amz', 'platform': 'alexa_media', 'should_change_volume': True, 'initial_volume_level': 0.5, 'playback_volume_level': 0.5, 'group_members_supported': False, 'announce_supported': False, 'is_playing': False}
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 4: {'entity_id': 'media_player.colton_s_echo_show', 'platform': 'alexa_media', 'should_change_volume': True, 'initial_volume_level': -1.0, 'playback_volume_level': 0.5, 'group_members_supported': False, 'announce_supported': False, 'is_playing': False}
2024-04-21 19:37:07.001 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = Here kitty kitty kitty kitty kitty kitty kitty?
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * language = en-AU
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = amazon_polly
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.5
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = True
2024-04-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = True
2024-04-21 19:37:07.002 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-21 19:37:07.002 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  --- Audio will be converted to Alexa-friendly format as Alexa speaker/s detected ---
2024-04-21 19:37:07.004 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/media/sounds/chimes/474983__xiscovar__cat-meowing.wav"...
2024-04-21 19:37:07.028 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 34.761s
2024-04-21 19:37:07.029 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-04-21 19:37:07.029 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'amazon_polly'
2024-04-21 19:37:07.029 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'Here kitty kitty kitty kitty kitty kitty kitty?'
2024-04-21 19:37:07.029 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-04-21 19:37:07.029 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-04-21 19:37:07.029 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-04-21 19:37:07.134 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 100.0ms
2024-04-21 19:37:07.147 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /config/www/chime_tts/...
2024-04-21 19:37:07.971 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem]  - File saved to path: /config/www/chime_tts/uq7crryx.mp3
2024-04-21 19:37:07.971 DEBUG (MainThread) [custom_components.chime_tts]   - Performing FFmpeg audio conversion...
2024-04-21 19:37:07.971 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Converting audio: "ffmpeg -i /config/www/chime_tts/uq7crryx.mp3 -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 24000 -write_xing 0 /config/www/chime_tts/uq7crryx_converted.mp3"
2024-04-21 19:37:08.478 DEBUG (MainThread) [custom_components.chime_tts]     ...FFmpeg audio conversion completed.
2024-04-21 19:37:08.615 DEBUG (MainThread) [custom_components.chime_tts]  - Saving data to chime_tts storage:
2024-04-21 19:37:08.615 DEBUG (MainThread) [custom_components.chime_tts]    - key:   "6279ca1e81d99ddf6464edc81c69f341dab3cd945a2f45c331a58917d2f7783e"
2024-04-21 19:37:08.615 DEBUG (MainThread) [custom_components.chime_tts]    - value: "{'public_path': '/config/www/chime_tts/uq7crryx.mp3', 'audio_duration': 37.704, 'local_path': None}"
2024-04-21 19:37:08.620 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-04-21 19:37:08.620 DEBUG (MainThread) [custom_components.chime_tts]    - audio_duration = 37.704
2024-04-21 19:37:08.620 DEBUG (MainThread) [custom_components.chime_tts]    - local_path = None
2024-04-21 19:37:08.620 DEBUG (MainThread) [custom_components.chime_tts]    - public_path = "https://REDACTED.ui.nabu.casa//local/chime_tts/uq7crryx.mp3"
2024-04-21 19:37:08.620 DEBUG (MainThread) [custom_components.chime_tts]    - media_content_id = None
2024-04-21 19:37:08.620 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-04-21 19:37:08.622 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Decresing media_player.kitchen_echo_plus_amz's volume from 0.5 to 0.5
2024-04-21 19:37:08.622 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Decresing media_player.apartment_door_echo_amz's volume from 0.5 to 0.5
2024-04-21 19:37:08.623 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Decresing media_player.bathroom_echo_amz's volume from 0.5 to 0.5
2024-04-21 19:37:08.623 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Decresing media_player.couch_echo_left_amz's volume from 0.5 to 0.5
2024-04-21 19:37:08.623 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Increasing media_player.colton_s_echo_show's volume from 0.0 to 0.5
2024-04-21 19:37:08.624 WARNING (MainThread) [custom_components.chime_tts] Unable to join speakers. 0 supported media_players found (minimum is 2).
2024-04-21 19:37:08.624 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]    5 Alexa media players detected:
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.kitchen_echo_plus_amz
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.apartment_door_echo_amz
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.bathroom_echo_amz
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.couch_echo_left_amz
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.colton_s_echo_show
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]    Calling notify.alexa_media with data:
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - message: <audio src="https://REDACTED.ui.nabu.casa//local/chime_tts/uq7crryx.mp3"/>
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - data: {'type': 'tts'}
2024-04-21 19:37:08.626 DEBUG (MainThread) [custom_components.chime_tts]      - target: ['media_player.kitchen_echo_plus_amz', 'media_player.apartment_door_echo_amz', 'media_player.bathroom_echo_amz', 'media_player.couch_echo_left_amz', 'media_player.colton_s_echo_show']
2024-04-21 19:37:08.627 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 37.704s for audio playback to complete...

I’m using the stable version and testing only with the included chimes.
I’ve only used the “say.url” service, I’ll play with the “say” service.

The blank TTS when calling Amazon Polly, but included with Nabu Casa and Google seems like an odd error related to calling that outside server (the code is otherwise identical).

More to follow - ill grab some logs.

I see this error:
Logger: custom_components.chime_tts
Source: custom_components/chime_tts/init.py:679
integration: Chime TTS (documentation, issues)
First occurred: 8:42:55 AM (1 occurrences)
Last logged: 8:42:55 AM

The amazon_polly platform was not found. Please check that it has been configured correctly: Integrations - Home Assistant

And up above I see this link:
Amazon Polly - Home Assistant (home-assistant.io)

So let me give that a try.

@ColtonYYZ I also posted recently about a struggle to get this working with Echo devices (Amazon Alexa). Does it only work if using Amazon Polly (and not Google Translate)? Because it looks like Polly is only free for 12 months, and then you must pay for it.

@Nimrod_Dolev Thank you again for creating this! I use it all the time in my home, all of my announcements are via ChimeTTS.

In fact I use it so much that it was getting boring to hear the same set of announcements every day. So I wrote a small python script to use Google’s Gemini LLM to generate different variations of the announcements. While doing this I stumbled upon the ssml format that Google Cloud TTS supports.

Would you be able to support SSML in Chimes too? It would be good to be able to format the input string with pauses, etc. to make it more lifelike.

Hey @msl2424 I don’t have all of the TTS’s setup/configured so I can’t tell you which one’s don’t work. I tested the following which the phrase “Testing 1-2-3”.

The chime worked on all of them, the message did not:

Worked      	                Did Not Work

Amazon Polly	                Google Translate
Google Cloud	                OpenAI TTS
Nabu Casa Cloud TTS	            Mary TTS
Microsoft Edge TTS	            Microsoft Text-to-Speech (TTS)

I don’t have Google Translate, OpenAI TTS, Microsoft Text-to-Speech set up, but I do have Mary TTS set up, so not sure exactly why the message didn’t work with it.

@Nimrod_Dolev

I ran across this HACS integration earlier. Great work! I’d like to use it to announce issues with equipment around the house. A leaking washer, overflowing sump pump or a door left open during heating season.

I’ve installed version 1.1.0-beta4 but I’m having an issue! When one Sonos speaker is added as a target, the integration announces the alert and says the message just fine. However, if I add more than one Sonos speaker, only one of them plays

Here is the script I’m using to test the integration;

alias: Chime Test TTS
sequence:
  - service: chime_tts.say
    data:
      chime_path: fanfare
      message: This is a test
      tts_platform: tts.google_en_com
      join_players: true
      unjoin_players: true
    target:
      entity_id:
        - media_player.kitchen_sonos
        - media_player.livingroom_sonos
        - media_player.workshop_sonos
        - media_player.breakfast_sonos
        - media_player.roam_sl_sonos
mode: single
icon: mdi:alert

Why isn’t the integration joining the five speakers and making the announcement on all?

Thankyou @Nimrod_Dolev, I also really like this integration. I was listening to a podcast the other day on alarm design, and this is exactly what they said. Use a chime to get people’s attention, then something to indicate the specific alert - in this case it’s TTS but it could also be a particular sound effect that has meaning. Bad alarm design uses all sorts of horrible beeps and alarms with no meaning that we we have to learn or investigate what they’re for.

However, I’m having a couple of issues with version 1.0.0.

  1. Cache doesn’t work for me, it throws an Unknown Error. I’m using a rPi4 with HASSOS.

  2. Announce at 100% volume when music is currently playing. The Announce feature increases the volume first, plays the chime and TTS, then returns to the volume back normal. e.g. if the music is at 15% and the announce is at 100%, then the result is music is playing at 15%, submit the chime_tts → music plays at 100% for 1 second, chime_tts announcement at 100%, music continues playing 100% for another 1 second, then music volume returns to 15%.

Hi, new here. Using 1.1.0 Beta 4. On Sonos paired setup

Since using the Beta 4, the recording is playing twice and only out of 1 speaker
Removing this audio_conversion: “-filter:a volume=1.5” stops the repeating but still only out of 1 speaker. Apologies if a known issue, let me know if logs would be useful.

Current automation.

data:
  chime_path: bells
  message: The alarm is now set.
  tts_platform: tts.piper
  announce: true
  audio_conversion: "-filter:a volume=1.5"
target:
  entity_id:
    - media_player.kitchen_sonos```

Can’t seem to get any audio output either testing via the call service below with v1.0.0.

service: chime_tts.say
data:
  chime_path: custom_components/chime_tts/mp3s/bells.mp3
  end_chime_path: custom_components/chime_tts/mp3s/tada.mp3
  message: This is a test message using Chime TTS.
  tts_platform: cloud
  volume_level: 0.75
  announce: true
target:
  entity_id: media_player.living_room

Debug Log

2024-05-05 09:35:38.762 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v1.0.0 -----
2024-05-05 09:35:38.763 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-05-05 09:35:38.764 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player] ```Media players found: [{'entity_id': 'media_player.living_room', 'should_change_volume': True, 'initial_volume_level': 0.5, 'group_members_supported': True, 'announce_supported': True, 'resume_media_player': False}]
2024-05-05 09:35:38.765 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ----- General Parameters -----
2024-05-05 09:35:38.765 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.living_room']
2024-05-05 09:35:38.765 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = custom_components/chime_tts/mp3s/bells.mp3
2024-05-05 09:35:38.766 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * end_chime_path = custom_components/chime_tts/mp3s/tada.mp3
2024-05-05 09:35:38.776 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-05-05 09:35:38.777 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-05-05 09:35:38.777 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-05-05 09:35:38.777 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = This is a test message using Chime TTS.
2024-05-05 09:35:38.777 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_platform = cloud
2024-05-05 09:35:38.777 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-05-05 09:35:38.778 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-05-05 09:35:38.778 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = True
2024-05-05 09:35:38.778 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = 0.75
2024-05-05 09:35:38.778 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-05-05 09:35:38.778 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-05-05 09:35:38.780 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/bells.mp3"...
2024-05-05 09:35:39.080 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 0.944s
2024-05-05 09:35:39.081 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-05-05 09:35:39.082 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'cloud'
2024-05-05 09:35:39.082 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'This is a test message using Chime TTS.'
2024-05-05 09:35:39.082 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-05-05 09:35:39.082 DEBUG (MainThread) [custom_components.chime_tts]     * language = None
2024-05-05 09:35:39.082 DEBUG (MainThread) [custom_components.chime_tts]     * options = {}
2024-05-05 09:35:39.956 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 870.0ms
2024-05-05 09:35:39.968 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "custom_components/chime_tts/mp3s/tada.mp3"...
2024-05-05 09:35:40.281 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.323s
2024-05-05 09:35:40.317 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to folder: /config/tts/...
2024-05-05 09:35:40.907 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem]  - File saved to path: /config/tts/q8ldpbux.mp3
2024-05-05 09:35:41.243 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-05-05 09:35:41.243 DEBUG (MainThread) [custom_components.chime_tts]    - audio_duration = 7.646
2024-05-05 09:35:41.243 DEBUG (MainThread) [custom_components.chime_tts]    - local_path = "/config/tts/q8ldpbux.mp3"
2024-05-05 09:35:41.244 DEBUG (MainThread) [custom_components.chime_tts]    - public_path = None
2024-05-05 09:35:41.244 DEBUG (MainThread) [custom_components.chime_tts]    - media_content_id = None
2024-05-05 09:35:41.244 DEBUG (MainThread) [custom_components.chime_tts]  *** Pre-Playback Actions *** 
2024-05-05 09:35:41.244 DEBUG (MainThread) [custom_components.chime_tts]  - Setting volume level to 0.75 for 1 non-fade in/out media_player
2024-05-05 09:35:41.244 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Setting media_player.living_room's volume to 0.75
2024-05-05 09:35:41.483 DEBUG (MainThread) [custom_components.chime_tts]  *** Chime TTS playback ***
2024-05-05 09:35:41.483 WARNING (MainThread) [custom_components.chime_tts] Error calling `media_player.play_media` service: No media content id found
2024-05-05 09:35:41.483 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 7.646s for audio playback to complete...
2024-05-05 09:35:46.243 ERROR (Thread-15 (_thread_main)) [tuya_sharing] on message error = 115
2024-05-05 09:35:49.223 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Waiting until 1 media_player isn't playing...
2024-05-05 09:35:49.223 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]    ✔ media_player.living_room
2024-05-05 09:35:49.223 DEBUG (MainThread) [custom_components.chime_tts]  *** Post-Playback Actions ***
2024-05-05 09:35:49.223 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player]  - Setting media_player.living_room's volume to 0.5
2024-05-05 09:35:49.253 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 10.49 s -----

@Coolie1101 and @stormshaker I would suggest updating to the latest BETA version (v1.1.0-beta4) as you will have better success with it as there have been quite a few updates made.

To install the new beta version:

  • Open the Chime TTS repository in HACS
  • Click on the ⋮ button in the top right
  • Select the ↻ Redownload option
  • Enable the Show beta versions option (it may take a moment to update the list)
  • Select version v1.1.0-beta4 from the updated version drop-down list
  • Restart Home Assistant