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

[Regression] TTS broken when using service tts.speak #2369

Closed
qJake opened this issue Jul 29, 2024 · 19 comments
Closed

[Regression] TTS broken when using service tts.speak #2369

qJake opened this issue Jul 29, 2024 · 19 comments
Labels
bug Something isn't working pr-submitted

Comments

@qJake
Copy link

qJake commented Jul 29, 2024

Describe the bug

When using service tts.speak, Alexa responds with the following:

To send TTS, set public url in integration configuration.

I have removed and reconfigured my AMP integration and confirmed my public URL is in fact set.

To Reproduce

  1. Use a custom TTS provider, such as OpenAI TTS.
  2. Create a service call:
    service: tts.speak
    data:
      cache: true
      media_player_entity_id: media_player.sample_alexa_device
      message: This is a sample TTS voice.
    target:
      entity_id: tts.openai_alloy
  3. Call the service.
  4. Alexa says "To send TTS, ..."

Expected behavior

Prior to the regression, the TTS audio would play correctly from the TTS service. It no longer does.

Screenshots

image

System details

  • Home-assistant (version): 2024.7.3
  • alexa_media (version from const.py or HA startup): 4.11.5
  • alexapy (version from pip show alexapy or HA startup): N/A - Default (Installed with HACS, not manually managed)
  • Amazon 2FA is enabled: Yes

Logs

Logger: custom_components.alexa_media.media_player
Source: custom_components/alexa_media/media_player.py:1423
integration: Alexa Media Player ([documentation](https://github.com/alandtse/alexa_media_player/wiki), [issues](https://github.com/alandtse/alexa_media_player/issues))
First occurred: July 27, 2024 at 4:17:57 PM (18 occurrences)
Last logged: 8:33:58 PM

To send TTS, set public url in integration configuration Please see the alexa_media wiki for details.https://github.com/alandtse/alexa_media_player/wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service

Additional context

This used to work recently (within 1 week ago), but I'm not sure when it broke - if it was an upgrade to the AMP component or to Home Assistant itself.

@danielbrunt57
Copy link
Collaborator

To send TTS, set public url in integration configuration

Let me re-examine this aspect of the integration. I may have inadvertently broken it 🥺

@Zylazy
Copy link

Zylazy commented Jul 29, 2024

The same problem here
It happened after the upgarde, but I am not sure about the previous version. It must be 4.11.X
And the same time i have upgraded HA 2024.7.3

@Morpheus2018
Copy link

the same."To send TTS, .." problem answer when sending tts

@cw-cdz
Copy link

cw-cdz commented Jul 30, 2024

Here is a temporary work around until the fix is in:

# Edit custom_components/alexa_media/const.py make the following edit and restart home assistant

DEFAULT_PUBLIC_URL = "https://<your_url>/"

image

I noticed some updates from "public_url" to "hass_url" in #2319 , but it looks like not all logic was updated to read the new config option. I didn't have time to dig deeper because I'm on a tight deadline for another project, so this might not be the full picture.

@MJHeijster
Copy link

MJHeijster commented Jul 30, 2024

Ah, and here I was trying to figure this out for over half an hour. Glad it's being addressed :)

Also love this component, thanks for all your work.

@Dare2Code
Copy link

Thanks for that temporary workaround. I hope next hotfix address this.

@qJake
Copy link
Author

qJake commented Jul 30, 2024

Here is a temporary work around until the fix is in:


# Edit custom_components/alexa_media/const.py make the following edit and restart home assistant



DEFAULT_PUBLIC_URL = "https://<your_url>/"

image

I noticed some updates from "public_url" to "hass_url" in #2319 , but it looks like not all logic was updated to read the new config option. I didn't have time to dig deeper because I'm on a tight deadline for another project, so this might not be the full picture.

Thanks for this - if I edit this right now, will it just get replaced/fixed when the next HACS release installs? I just don't want to break anything in HACS if I edit this manually.

@cw-cdz
Copy link

cw-cdz commented Jul 30, 2024

Thanks for this - if I edit this right now, will it just get replaced/fixed when the next HACS release installs? I just don't want to break anything in HACS if I edit this manually.

Correct. The next time the integration is updated it will overwrite everything so this change will no longer be present.

@pippo73
Copy link

pippo73 commented Jul 30, 2024

Here is a temporary work around until the fix is in:

# Edit custom_components/alexa_media/const.py make the following edit and restart home assistant

DEFAULT_PUBLIC_URL = "https://<your_url>/"

image

I noticed some updates from "public_url" to "hass_url" in #2319 , but it looks like not all logic was updated to read the new config option. I didn't have time to dig deeper because I'm on a tight deadline for another project, so this might not be the full picture.

I would like to thank @cw-cdz for the temporary hack. Hope @alandtse will take in concideration this "solution" to fix the problem with the next release of this integration.

@qJake I hope the developer will consider this for the next release ;-)

@qJake
Copy link
Author

qJake commented Jul 30, 2024

Okay, so I made that code update, but I'm getting a different error - Alexa now says:

Sorry, I'm having trouble accessing your Simon Says NA skill right now.

EDIT: Nevermind - figured it out. Firewall was blocking public access to HA.

For anyone else that gets this error, check your firewall and make sure your .mp3 TTS URLs are publicly accessible!

The code workaround works great! 👍

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Jul 31, 2024

Here is a temporary work around until the fix is in:

# Edit custom_components/alexa_media/const.py make the following edit and restart home assistant

DEFAULT_PUBLIC_URL = "https://<your_url>/"

image

I noticed some updates from "public_url" to "hass_url" in #2319 , but it looks like not all logic was updated to read the new config option. I didn't have time to dig deeper because I'm on a tight deadline for another project, so this might not be the full picture.

I think you've hit the nail on the head! I downloaded the old 4.10.3 zip file and will try to do a file-by-file comparison with 4.12.1 of what's different and where and what I screwed up later this evening. My issue right now is sitting for any length of time is painful due to an abscessed pimple on my pelvis...
image-1

@qJake
Copy link
Author

qJake commented Aug 4, 2024

Thank you for fixing this quickly! 🎉

@kristoficko
Copy link

Am I the only one who still has this issue with 4.12.4?

@cw-cdz
Copy link

cw-cdz commented Aug 6, 2024

Am I the only one who still has this issue with 4.12.4?

After updating, you need to reconfigure the public URL in the Integration. A side effect of the bug is that it caused it to lose the previous setting.
Integration --> Alexa Media Player --> Configure

@kristoficko
Copy link

kristoficko commented Aug 6, 2024

Thanks Brian,

figured that could be the issue, just now I'm struggling to obtain a working version, as the latest one 4.12.4 is giving me the "Unknown Error" as seen in #2393

@cw-cdz
Copy link

cw-cdz commented Aug 6, 2024

Thanks Brian,

figured that could be the issue, just now I'm struggling to obtain a working version, as the latest one 4.12.4 is giving me the "Unknown Error" as seen in #2393

I see. Have you tried downgrading to 4.10.3, authenticate again, and then update back to 4.12.4?
Then reconfigure the URL and hopefully all will be well (just a theory).

@kristoficko
Copy link

That's a little bit tricky, as I don't have the URL field visible in the Configure dialog on an already deployed integration (Just the Excluded/Included devices and the time parameters).
Need to remove and add the integration from scratch? Or am I missing something here?

@cw-cdz
Copy link

cw-cdz commented Aug 6, 2024

That's a little bit tricky, as I don't have the URL field visible in the Configure dialog on an already deployed integration (Just the Excluded/Included devices and the time parameters). Need to remove and add the integration from scratch? Or am I missing something here?

Initially, I suggested downgrading to a known working version (4.10.3). Since the HACS will not show this version, you would need to manually download it from GitHub: manual mode instructions.

However, upon reconsideration, here’s alternative approach that might work:

  • A working Public URL in the config is not essential for the integration to authenticate successfully.
  • Therefore, first, ensure that you have a version of the integration that authenticates successfully (try any that HACS lists, start with the earliest version). After using that to authenticate again, update back to 4.12.4 without removing the existing configuration.
  • Once updated, you can fix the missing Public URL via Integration -> Alexa Media Player -> Configure.

@kristoficko
Copy link

Sorry Brian, I didn't realize the field Public URL is version dependent. To recap what I did:

My AMP is working again, thank you so much for your support today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pr-submitted
Projects
None yet
Development

No branches or pull requests

9 participants