home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.38k stars 30.64k forks source link

ElevenLabs "Failed to cast media" #124752

Open talormanda opened 2 months ago

talormanda commented 2 months ago

The problem

Integration never works. The google speaker or display activates, but nothing happens.

What version of Home Assistant Core has the issue?

2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ElevenLabs

Link to integration documentation on our website

https://www.home-assistant.io/integrations/elevenlabs/

Diagnostics information

No response

Example YAML snippet

action: tts.speak
target:
  entity_id: tts.elevenlabs
data:
  media_player_entity_id: media_player.aarons_room_speaker_2
  message: Hello, can you hear me now?

Anything in the logs that might be useful for us?

Failed to cast media http://192.168.0.7:8123/api/tts_proxy/dc822ad43fc9d5fe50deec8faf65dd8a2444528c_en_-_tts.elevenlabs.mp3 from internal_url (http://192.168.0.7:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Failed to cast media http://192.168.0.7:8123/api/tts_proxy/4b00795a5f1834a60797d268e9e6c0c56e1900c0_en_-_tts.elevenlabs.mp3 from internal_url (http://192.168.0.7:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Error on load tts: dc822ad43fc9d5fe50deec8faf65dd8a2444528c_en_-_tts.elevenlabs not in cache!

Error on load tts: 4b00795a5f1834a60797d268e9e6c0c56e1900c0_en_-_tts.elevenlabs not in cache!

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @sorgfresser, mind taking a look at this issue as it has been labeled with an integration (elevenlabs) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `elevenlabs` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign elevenlabs` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


elevenlabs documentation elevenlabs source (message by IssueLinks)

mib1185 commented 2 months ago

@sorgfresser don't download this file, it's a bot, trying to spread malware!

ryanaun commented 2 months ago

I was having the same problem while trying to use the speak Action with the ElevenLabs integration. It would cause the device I wanted the speech to play on to play the chime indicating a connection, but then nothing. After digging through some other issues I saw some people mention that ElevenLabs was working as part of play media. In case it help you OP; I tried it and swapping the speak Action for a media player: play media action in my automation and using ElevenLabs TTS as the media to be played worked for me.

talormanda commented 2 months ago

I was having the same problem while trying to use the speak Action with the ElevenLabs integration. It would cause the device I wanted the speech to play on to play the chime indicating a connection, but then nothing. After digging through some other issues I saw some people mention that ElevenLabs was working as part of play media. In case it help you OP; I tried it and swapping the speak Action for a media player: play media action in my automation and using ElevenLabs TTS as the media to be played worked for me.

Can you post your YAML code.

ryanaun commented 2 months ago

I was having the same problem while trying to use the speak Action with the ElevenLabs integration. It would cause the device I wanted the speech to play on to play the chime indicating a connection, but then nothing. After digging through some other issues I saw some people mention that ElevenLabs was working as part of play media. In case it help you OP; I tried it and swapping the speak Action for a media player: play media action in my automation and using ElevenLabs TTS as the media to be played worked for me.

Can you post your YAML code.

Sure thing mate! Here's the code from the play media action I was using:

action: media_player.play_media
target:
  entity_id: media_player.ryan_s_room_nest_hub
data:
  media_content_id: >-
    media-source://tts/tts.elevenlabs?message=Door+alert&language=en&voice=IKne3meq5aSn9XLyUdCD
  media_content_type: provider
metadata:
  title: Door alert
  thumbnail: https://brands.home-assistant.io/_/tts/logo.png
  media_class: app
  children_media_class: null
  navigateIds:
    - {}
    - media_content_type: app
      media_content_id: media-source://tts
    - media_content_type: provider
      media_content_id: >-
        media-source://tts/tts.elevenlabs?message=Door+alert&language=en&voice=IKne3meq5aSn9XLyUdCD
sorgfresser commented 1 month ago

90% sure this should be related to #123624 So can you try adding

data:
      <your other data keys>
      options:
        voice: <voice_id to be used>

maybe? Sorry for the inconvenience, I hope we will get this merged soon!

sorgfresser commented 1 month ago

I was having the same problem while trying to use the speak Action with the ElevenLabs integration. It would cause the device I wanted the speech to play on to play the chime indicating a connection, but then nothing. After digging through some other issues I saw some people mention that ElevenLabs was working as part of play media. In case it help you OP; I tried it and swapping the speak Action for a media player: play media action in my automation and using ElevenLabs TTS as the media to be played worked for me.

Can you post your YAML code.

Sure thing mate! Here's the code from the play media action I was using:

action: media_player.play_media
target:
  entity_id: media_player.ryan_s_room_nest_hub
data:
  media_content_id: >-
    media-source://tts/tts.elevenlabs?message=Door+alert&language=en&voice=IKne3meq5aSn9XLyUdCD
  media_content_type: provider
metadata:
  title: Door alert
  thumbnail: https://brands.home-assistant.io/_/tts/logo.png
  media_class: app
  children_media_class: null
  navigateIds:
    - {}
    - media_content_type: app
      media_content_id: media-source://tts
    - media_content_type: provider
      media_content_id: >-
        media-source://tts/tts.elevenlabs?message=Door+alert&language=en&voice=IKne3meq5aSn9XLyUdCD

Agreed that this is another neat way to fix it. So this fixes the same issue. With the media source, we're setting a voice (see the get parameters of your media-source string).

ryanaun commented 1 month ago

I was having the same problem while trying to use the speak Action with the ElevenLabs integration. It would cause the device I wanted the speech to play on to play the chime indicating a connection, but then nothing. After digging through some other issues I saw some people mention that ElevenLabs was working as part of play media. In case it help you OP; I tried it and swapping the speak Action for a media player: play media action in my automation and using ElevenLabs TTS as the media to be played worked for me.

Can you post your YAML code.

Sure thing mate! Here's the code from the play media action I was using:

action: media_player.play_media
target:
  entity_id: media_player.ryan_s_room_nest_hub
data:
  media_content_id: >-
    media-source://tts/tts.elevenlabs?message=Door+alert&language=en&voice=IKne3meq5aSn9XLyUdCD
  media_content_type: provider
metadata:
  title: Door alert
  thumbnail: https://brands.home-assistant.io/_/tts/logo.png
  media_class: app
  children_media_class: null
  navigateIds:
    - {}
    - media_content_type: app
      media_content_id: media-source://tts
    - media_content_type: provider
      media_content_id: >-
        media-source://tts/tts.elevenlabs?message=Door+alert&language=en&voice=IKne3meq5aSn9XLyUdCD

Agreed that this is another neat way to fix it. So this fixes the same issue. With the media source, we're setting a voice (see the get parameters of your media-source string).

Oh cool, I hadn't even noticed that difference. Truthfully I don't usually write yaml I just use the UI as much as possible. Does the play media action have some kind of difference where it adds voice as a parameter by default without reflecting that difference between the yaml and the UI view?

sorgfresser commented 1 month ago

Well, I'm also not 100% sure how the conversion from the UI happens here, though I am decently confident that it comes from generate_media_source_id in the homeassistant/components/tts/media_source.py file. We have the

if options is not None:
        params.update(options)

Where options should include ATTR_VOICE as this is set in ElevenLabs supported options

H3rian commented 1 month ago

I have the same problem

Failed to cast media http://192.168.0.9:8097/announcement/media_player.mansarda.mp3?pre_announce=True. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

With the unofficial elevenlabs integration, it works fine. Maybe can be helpful? https://github.com/carleeno/elevenlabs_tts

sorgfresser commented 1 month ago

Could you verify whether this still occurs in the newest version?

carefulcomputer commented 1 month ago

i have same problem with lastest version.

[homeassistant.components.cast.media_player] Failed to cast media http://X.X.X.X:8123/api/tts_proxy/XXXXXXXXXX...XXXXXX_en_-_tts.elevenlabs.mp3 from internal_url (http://X.X.X.X:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

H3rian commented 1 month ago

I haven’t tried it yet with 2024.10 (just updated). but i can confirm that with 2024.9.4 was working (sorry for not answering the previous question)

sorgfresser commented 1 month ago

That is indeed a different problem @carefulcomputer Would you mind opening a separate issue for this including the yamls that lead to this (feel free to remove any personal info)