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

Invalid TTS provider - this should be a clue…

2023-12-03 12:34:41.378 WARNING (MainThread) [custom_components.chime_tts]    - Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected
2023-12-03 12:34:41.378 WARNING (MainThread) [custom_components.chime_tts] Unable to generate TTS audio
2023-12-03 12:34:41.447 WARNING (MainThread) [custom_components.alexa_media.media_player] To send TTS, set public url in integration configuration Please see the alexa_media wiki for details.https://github.com/custom-components/alexa_media_player/wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service
2023-12-03 12:34:43.234 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Bad status line "Invalid method encountered:\n\n  b'\\x16\\x03\\x01\\x02'\n    ^"
2023-12-03 12:34:43.263 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Bad status line "Invalid method encountered:\n\n  b'\\x16\\x03\\x01\\x02'\n    ^"

I logged an issue. Feel free to add to it.

Hi @jazzmonger, thanks for the log messages.

The log error:
Error calling tts.media_source.generate_media_source_id: Invalid TTS provider selected
suggests that the Amazon Polly TTS service is not configured correctly on your Home Assistant instance. Please call the chime_tts.say_url service with Amazon Polly as the TTS platform to see if the issue is with Amazon Polly or with the Echo speaker.

that is exactly what I’m doing ass shown in my above post… its what causes the error.

This might hold some clues…

oops… no thanks… I already paid for the gold toilet Bezos uses in his vacation house…

I just came across this and I’d like to use chime_tts for my Alerts. But for Alerts you have to set up a Notifier and I’m struggling to see how to set this up or if indeed that is even possible. Has anyone done this ? Is it possible?

1 Like

Hi @jazzmonger, I am not sure if I understood your last message. Have you configured Amazon Polly and tested it with the chime_tts.say_url service (not the chime_tts.say service)?

Hi @perjury1. What exactly are you trying to do? It wasn’t clear to me from your message.

Thanks for responding.
I’m using the Alert integration Alert - Home Assistant (home-assistant.io)
This requires that you must setup a notification integration Notify using TTS - Home Assistant

I’d like to set up Chime TTS as a notifier but I can’t work out how.

Does that explain it well enough?

I think you cash create an automation with an event trigger (the event being the notification alert) and then call the chime_tts.say service.

No doubt I can, but that wasn’t really what I was after. I was hoping to be able to set up chime_tts.say as a notifier.

Ok, well I don’t think it’s possible directly in its current form.
I will take a closer look at it when I can and perhaps add support in a future release.

OK, thanks

Amazon Polly is a paid service. No thanks…

I got my script working, so I’m good.

Hi all,

Just playing around last night with the latest (
v0.10.0) version of this integration. I have this action called from an automation:

  - service: chime_tts.say
    data:
      message: Just testing the doorbell!
      tts_platform: cloud # also tried google_translate
      volume_level: 0.7
    target:
      entity_id:
        - media_player.office_speaker
        - media_player.hallway_speaker

This resulted in the following error:

2023-12-03 20:04:05.167 ERROR (Thread-10) [homeassistant.components.cast.media_player] Failed to cast media https://<public_url>:8123/mediasoundstempchime_tts/yxmy87d7.mp3?authSig= from internal_url (https://<public_url>:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

When tested, the url returned a 404, which wasn’t surprising given the rather odd mediasoundstempchime_tts path. I’ve checked the integration config, and it’s correctly reporting the temporary MP3 folder path as /media/sounds/temp/chime_tts/

Am I doing something fundamentally daft here?

I’ll investigate and see if I need to push a hotfix. Thanks for spotting this :+1:

Thanks. Shout if you need anything from me on this.

Thanks. I just released a hotfix (v0.10.1) which should fix the bug.

Much better! Thanks for the quick response :+1: I’ll go back to experimenting and playing.

One further question: is there any built-in way within this integration to get rid of the default Google Home “chime” when first sending a TTS announce down to it?

Happy to hear it fixed the issue!

is there any built-in way within this integration to get rid of the default Google Home “chime” when first sending a TTS announce down to it?

Not through this integration i’m afraid. I don’t have any Google Home speakers myself but I found this thread on the forum which might help you.

I just installed this today for the first time.

My first issue is it is not using the port of the home assistant URL of https://agilehumor.com:8123 and instead is omitting the port #

Log snippet:

2023-12-04 10:07:04.677 DEBUG (MainThread) [custom_components.chime_tts] Final URL = Coming Soon

My second issue is that it does not seem to be generating the full public URL (www path?) and using the local. As this is first time installed, unsure of expected results.

Hi @AgileHumor. I am not sure why the file paths for the generated MP3s aren’t working for your setup. I haven’t heard from any other users who ran into this issue.

  1. Could you please describe your Home Assistant instance in a little more detail? Are you running HAOS or a Docker container, etc?

  2. Which version of Chime TTS do you have installed?

  3. It would be helpful to see the debug logs for Chime TTS to better understand what the issue might be. To see debug logs for the integration please follow these steps:

    1. Turn on debug logging for Chime TTS:
    service: logger.set_level
    data:
      custom_components.chime_tts: debug
    
    1. Reload Chime TTS:

      SettingsDevices & servicesChime TTSReload

    2. Call the chime_tts.say & chime_tts.say_url services again.

    3. Check your log messages in Home Assistant:

      https://{YOUR_HOME_ASSISTANT_ADDRESS}:8123/config/logs?filter=chime_tts
      

      and then click LOAD FULL LOGS to view all log messages.