Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"To send TTS, set public url in integration configuration" #2130

Closed
jazzmonger opened this issue Dec 3, 2023 · 11 comments
Closed

"To send TTS, set public url in integration configuration" #2130

jazzmonger opened this issue Dec 3, 2023 · 11 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jazzmonger
Copy link

IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.

Describe the bug

I get this msg when trying TTS "To send TTS, set public url in integration configuration"

service: chime_tts.say
data:
  chime_path: bells
  end_chime_path: ""
  delay: 450
  final_delay: 0
  tts_playback_speed: 100
  volume_level: 0.68
  message: Testing 123
  tts_platform: alexa_media
  gender: male
target:
  entity_id: media_player.kitchen_original

1 - run service
2. See error

Expected behavior

voice output "To send TTS, set public url in integration configuration"

System details

  • Home-assistant (version): 2023.11.3
  • alexa_media (version from const.py or HA startup): 4.7.9
  • alexapy (version from pip show alexapy or HA startup): 2023.11.3
  • Amazon 2FA is enabled (y/n). <!---We will not debug login issues if unanswered--->: YES

Logs

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    ^"

Additional context

@nanobra1n
Copy link

nanobra1n commented Dec 4, 2023

You need to set your public URL in the Amazon Media Player integration. Click Settings >> Devices & services>>Alexa Media Player >> Configure . Enter the URL that allows you to access your Homeassistant instance from the outside, i.e. you Nabu Casa address (e.g https://[youruniqueidentifierhere].ui.nabu.casa/)

I don't think alexa_media is a valid tts_platform, but it works for me with Nabu Casa Cloud TTS and Google Translate TTS

@alandtse
Copy link
Owner

alandtse commented Dec 4, 2023

I don't use that feature so hopefully @surfingbytes who contributed it sees this and is able to help.

@alandtse alandtse added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Dec 4, 2023
@surfingbytes
Copy link
Contributor

Sorry if I misunerstood, but you say you don't use this feature, but the code you posted shows you're calling TTS on Echo speaker? Amazon Echo speakers (via Alexa media player integration) don't support TTS, or to say, playing any mp3 files locally. Therefore you need to set public url in configuration, if you want to use TTS. If you know how to play mp3 file locally via alexa.py, I'm more than happy to update my PR.

@nanobra1n
Copy link

OPs issue is really with the Chime TTS integration which they are trying to use with an Echo as a target. I followed him here from this discussion

https://community.home-assistant.io/t/chime-tts-play-audio-before-after-tts-audio-lag-free/578430/184

therefore I had more information than he provided in this issue.

@github-actions github-actions bot removed the help wanted Extra attention is needed label Dec 5, 2023
Copy link

This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed automatically.

@github-actions github-actions bot added the help wanted Extra attention is needed label Dec 27, 2023
@pippo73
Copy link

pippo73 commented Jul 25, 2024

Hello all, I think I have a similar problem. Did anybody found a solution?
I have configured the Integration alexa media player, but I don't use nabucasa to connect to alexa but I have the integration to alexa with the haaska system. any way to redirect a tts to and echo device?

@kristoficko
Copy link

I did set up this integration (alexa_media_player) a week ago, tested with Microsoft TTS and it worked flawlessly from the first try.

Since then I have upgraded HA from 2024.5.4 to 2024.6.4 and started getting this weird "To send TTS, set public url in integration configuration Please see the alexa_media wiki for details" message as voice output and also in the log files.

I do have my external HA URL set correctly (verified by removing and re-setting the integration), my HA is available from the outside world on said URL.

Any help appreciated.

Thanks

Mike

@L81ker
Copy link

L81ker commented Jul 28, 2024

I did set up this integration (alexa_media_player) a week ago, tested with Microsoft TTS and it worked flawlessly from the first try.

Since then I have upgraded HA from 2024.5.4 to 2024.6.4 and started getting this weird "To send TTS, set public url in integration configuration Please see the alexa_media wiki for details" message as voice output and also in the log files.

I do have my external HA URL set correctly (verified by removing and re-setting the integration), my HA is available from the outside world on said URL.

Any help appreciated.

Thanks

Mike

Same here., was working until recent updates. Switched to calling notify-via-alexa instead of TTS., slightly annoyed that TTS and the Alexa integration aren't more stable but hey ho, at least there IS a workaround.

@qJake
Copy link

qJake commented Jul 29, 2024

Since this issue is closed and I am also experiencing the same issues with TTS, I've opened a new issue - please add your comments and experiences here: #2369

@danielbrunt57
Copy link
Collaborator

I use this script all the time as a single central queueing point to prevent multiple calls to the same speaker from cutting off each other.
TTS is working fine for me.

alias: "Alexa: Notify Alexa Media"
description: Send notification to sensor.last_alexa
fields:
  message:
    description: The message content
    example: I am notifying you
sequence:
  - service: notify.alexa_media
    continue_on_error: true
    data:
      message: "{{ message }}"
      data:
        type: tts
      target: "{{ states('media_player.last_alexa') }}"
  - delay:
      seconds: >-
        {{ (message.split(' ') | count *
        states('input_number.alexa_word_duration')|float ) | round(0, 'floor',
        default) }}
mode: queued
icon: mdi:account-voice
max: 10

@danielbrunt57 danielbrunt57 reopened this Jul 29, 2024
@github-actions github-actions bot removed the help wanted Extra attention is needed label Jul 30, 2024
@Phil182
Copy link

Phil182 commented Oct 2, 2024

this is the method i use and it works with every tts prompt for alexa. play spotify, radio, turn on, ....

service: media_player.play_media
target:
entity_id: media_player.nicoles_echo
data:
media_content_type: custom
media_content_id: "what is time"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

10 participants