core icon indicating copy to clipboard operation
core copied to clipboard

ElevenLabs "Failed to cast media"

Open talormanda opened this issue 1 year ago • 14 comments

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

talormanda avatar Aug 28 '24 05:08 talormanda

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)

home-assistant[bot] avatar Aug 28 '24 05:08 home-assistant[bot]

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

mib1185 avatar Aug 28 '24 06:08 mib1185

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.

ryanaun avatar Sep 01 '24 01:09 ryanaun

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.

talormanda avatar Sep 01 '24 01:09 talormanda

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

ryanaun avatar Sep 02 '24 17:09 ryanaun

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 avatar Sep 08 '24 19:09 sorgfresser

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).

sorgfresser avatar Sep 08 '24 19:09 sorgfresser

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?

ryanaun avatar Sep 09 '24 14:09 ryanaun

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

sorgfresser avatar Sep 09 '24 19:09 sorgfresser

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

H3rian avatar Sep 12 '24 09:09 H3rian

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

sorgfresser avatar Sep 25 '24 21:09 sorgfresser

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

carefulcomputer avatar Oct 05 '24 03:10 carefulcomputer

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)

H3rian avatar Oct 05 '24 06:10 H3rian

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)

sorgfresser avatar Oct 05 '24 07:10 sorgfresser

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.