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

I can't get this to work. #36

Closed
wptracy opened this issue Feb 1, 2023 · 15 comments
Closed

I can't get this to work. #36

wptracy opened this issue Feb 1, 2023 · 15 comments

Comments

@wptracy
Copy link

wptracy commented Feb 1, 2023

I can't get this to work.
Alexa complains, says:
Sorry, text to speech can only be called with the notify dot Alexa underscore media service. Please see the Alexa underscore media wiki for details.

Home Assistant 2023.1.7
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230110.0 - latest

[core-ssh custom_components]$ wget -O - https://raw.githubusercontent.com/hasscc/get/main/get | DOMAIN=edge_tts REPO_PATH=hasscc/hass-edge-tts ARCHIVE_TAG=main bash -
Connecting to raw.githubusercontent.com (185.199.109.133:443)
writing to stdout
-                    100% |********************************|  3970  0:00:00 ETA
written to stdout
INFO: Archive URL: https://github.com/hasscc/hass-edge-tts/archive/main.zip
INFO: Trying to find the correct directory...
INFO: Found Home Assistant configuration directory at '/config'
INFO: Changing to the custom_components directory...
INFO: Downloading...
Connecting to github.com (140.82.114.4:443)
Connecting to codeload.github.com (140.82.113.10:443)
saving to '/config/custom_components/main.zip'
main.zip             100% |********************************|  8333  0:00:00 ETA
'/config/custom_components/main.zip' saved
INFO: Unpacking...
INFO: Removing temp files...
INFO: Installation complete.
INFO: 安装成功!

INFO: Remember to restart Home Assistant before you configure it.
INFO: 请重启 Home Assistant
[core-ssh custom_components]$ 

[core-ssh custom_components]$ ls
alexa_media  edge_tts     hacs         xiaomi_miot
[core-ssh custom_components]$ ls edge_tts/
__init__.py    manifest.json  tts.py
[core-ssh custom_components]$ 

restarted, then:
added edge_tts to configuration.yaml:

# Text to speech
tts:
  - platform: google_translate

  - platform: edge_tts
    language: en-US # Default language or voice (Optional)
    
test in Developer Tools:

service: tts.edge_tts_say
data:
  entity_id: media_player.william_s_office_echo_dot
  message: >-
    You can replace this text with any text you wish. You can either write in
    this text box or paste your own text here.  Try different languages and
    voices. Change the speed and the pitch of the voice. You can even tweak the
    SSML (Speech Synthesis Markup Language) to control how the different
    sections of the text sound. Click on SSML above to give it a try!  Enjoy
    using Text to Speech!
  options:
    voice: Eric (neural)

Alexa complains, says:
Sorry, text to speech can only be called with the notify dot Alexa underscore media service. Please see the Alexa underscore media wiki for details.

@rany2
Copy link
Collaborator

rany2 commented Feb 1, 2023

@al-one Is this related to #33?

@wptracy
Copy link
Author

wptracy commented Feb 1, 2023

I deleted google_translate, but it still didn't work.
tts:

  • platform: google_translate

@rany2
Copy link
Collaborator

rany2 commented Feb 1, 2023

In entity_id replace media_player with notify.alexa_media.

@wptracy
Copy link
Author

wptracy commented Feb 1, 2023

Like this?

service: tts.edge_tts_say
data:
entity_id: notify.alexa_media.william_s_office_echo_dot
message: >-
You can replace this text with any text you wish. You can either write in
this text box or paste your own text here. Try different languages and
voices. Change the speed and the pitch of the voice. You can even tweak the
SSML (Speech Synthesis Markup Language) to control how the different
sections of the text sound. Click on SSML above to give it a try! Enjoy
using Text to Speech!
options:
voice: Eric (neural)

image

@rany2
Copy link
Collaborator

rany2 commented Feb 1, 2023

Like this?

I'm not entirely sure, but I think the links I sent above match the issue you're facing.

@rany2
Copy link
Collaborator

rany2 commented Feb 1, 2023

voice: Eric (neural)

P.S. your voice is invalid. It should be en-US-EricNeural.

@wptracy
Copy link
Author

wptracy commented Feb 1, 2023

This is in my automation, and it works.

service: notify.alexa_media_william_s_office_echo_dot
data:
message: Shelly Flood Detected Water

I replaced
entity_id: notify.alexa_media.william_s_office_echo_dot
with
entity_id: notify.alexa_media_william_s_office_echo_dot
And Alexa doesn't say anything.

service: tts.edge_tts_say
data:
entity_id: notify.alexa_media_william_s_office_echo_dot
message: >-
You can replace this text with any text you wish. You can either write in
this text box or paste your own text here. Try different languages and
voices. Change the speed and the pitch of the voice. You can even tweak the
SSML (Speech Synthesis Markup Language) to control how the different
sections of the text sound. Click on SSML above to give it a try! Enjoy
using Text to Speech!
options:
voice: Eric (neural)

@rany2
Copy link
Collaborator

rany2 commented Feb 1, 2023

I'm sorry but I don't think anyone here might be able to help you but there is also this thread with people with similar issues: alandtse/alexa_media_player#1683

@wptracy
Copy link
Author

wptracy commented Feb 1, 2023

I changed voice and tried again.
Alexa still complains.

Text to speech
tts:

  • platform: google_translate

  • platform: edge_tts
    language: en-US-EricNeural # Default language or voice (Optional)

service: tts.edge_tts_say
data:
message: >-
You can replace this text with any text you wish. You can either write in
this text box or paste your own text here. Try different languages and
voices. Change the speed and the pitch of the voice. You can even tweak the
SSML (Speech Synthesis Markup Language) to control how the different
sections of the text sound. Click on SSML above to give it a try! Enjoy
using Text to Speech!
options:
voice: EricNeural
entity_id: media_player.william_s_office_echo_dot

@wptracy
Copy link
Author

wptracy commented Feb 1, 2023

Where is you find the acceptable voice like en-US-EricNeural
Is there a list?

@rany2
Copy link
Collaborator

rany2 commented Feb 1, 2023

I honestly haven't use HASS in a while (I only maintain the edge-tts library which this uses) but the list is accessible from https://github.com/hasscc/hass-edge-tts/blob/main/custom_components/edge_tts/tts.py#L24 or https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=6A5AA1D4EAFF4E9FB37E23D68491D6F4 (either ShortName or Name would work)

@wptracy
Copy link
Author

wptracy commented Feb 3, 2023

This was working all along. I just didn't know how to use is.
These are the currently supported media plays for Home Assistant.
https://www.home-assistant.io/integrations/media_player/
Currently only supported on Sonos, Spotify, MPD, Kodi, Roon, Owntone, Squeezebox and Universal.

The Edge TTS card appears in the Media TTS Card.
It plays on supported devices.
Screenshot from 2023-02-03 14-43-16
Screenshot from 2023-02-03 14-43-08

@rany2
Copy link
Collaborator

rany2 commented Feb 4, 2023

So this is solved?

@wptracy
Copy link
Author

wptracy commented Feb 4, 2023

yes

@rany2 rany2 closed this as completed Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants