Echo Devices (Alexa) as Media Player - Testers Needed

Hey, I’m trying to set up this component in italian :it: as well, but it fails to setup.

- platform: alexa
  email: !secret alexamail
  password: !secret alexapwd
  url: “amazon.it”

Is the url: part like yours?

From the Alexa history, if I send the previous Service Call and get that sound, I don’t find anything new.

Also if I ask for something who is not understood, for example “How does the dog?” I get a different response “Unfortunately I can not find the answer to the question!”

So why Alexa understand two different non-managed request as not equal?

“Test message” -> Beep
“How does the dog?” -> “Unfortunately I can not find the answer to the question!”

Really strange

Yes, it’s the same for me

:thinking::thinking:

Error while setting up platform alexa
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/requests/models.py”, line 350, in _get_idna_encoded_host
host = idna.encode(host, uts46=True).decode(‘utf-8’)
File “/usr/local/lib/python3.6/site-packages/idna/core.py”, line 361, in encode
s = alabel(label)
File “/usr/local/lib/python3.6/site-packages/idna/core.py”, line 284, in alabel
check_label(label)
File “/usr/local/lib/python3.6/site-packages/idna/core.py”, line 261, in check_label
raise InvalidCodepoint(‘Codepoint {0} at position {1} of {2} not allowed’.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+201C at position 1 of ‘“amazon’ not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/requests/models.py”, line 398, in prepare_url
host = self._get_idna_encoded_host(host)
File “/usr/local/lib/python3.6/site-packages/requests/models.py”, line 352, in _get_idna_encoded_host
raise UnicodeError
UnicodeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/media_player/alexa.py”, line 142, in setup_platform
config.get(CONF_DEBUG))
File “/config/custom_components/media_player/alexa.py”, line 608, in init
self.login_with_cookie()
File “/config/custom_components/media_player/alexa.py”, line 631, in login_with_cookie
self.login(cookies=cookies)
File “/config/custom_components/media_player/alexa.py”, line 747, in login
resp = self._session.get(site)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 537, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 510, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 453, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File “/usr/local/lib/python3.6/site-packages/requests/models.py”, line 313, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.6/site-packages/requests/models.py”, line 400, in prepare_url
raise InvalidURL(‘URL has an invalid label.’)
requests.exceptions.InvalidURL: URL has an invalid label.

but we already know that the italian server doest have simon says and it does interpret what is sent to alexa as a voice command.
in this topic before there are others that have tried that and confirmed that alexa does do what is send with the tts service.

so it is possible to start a routine with the tts service and in the routine let alexa speak.

@cherokee93 your quotes are wrong.

because the second is a question and the first doesnt contain words that she can respond to.
so send something that she does understand and can answer to!

1 Like

Have you rebooted (not just restarted HA) ?

I’ve checked the routine menu in the Alexa app and I can’t find any action where I can say what I want, but there is “Alexa says”", but with almost fixed response…

Thanks, hope that the italian server can implement tts asap

I thought I was pretty up to speed on this thread, but had missed that about the .IT servers. Very interesting, makes perfect sense. That sounds like a bit of a pain. So, can you have a routine, that starts a script to speak a message with a variable, etc. I’d think not, since that would also be interpreted as a command, right?

tts is not on any other server. alexa doesnt have tts at all.
what we do here is a hack!

but you can be sure that amazon will also add custom responses for routines in the future.
so if this hack still works at that point you could use it.

keep checking if your alexa app has updated and if there are more options in the routines.
untill then you can use the fixed texts.

@ptdalen they can start a routine, but they can only use preformatted texts there at the moment.
you cant create a routine so you cant get a variable from ha in the routine.

but you can create a skill and start that skill with the tts service. something we cant do.
and the skill can speak the response.

2 Likes

If you play a radio station rather then a piece of music it would be great if the station name was displayed rather than the attributes being blank - is that possible with this component?

I removed the " from “amazon.it”, and the !secrets and now it works. :thinking:

So at this moment, is this implementation useful or not?Will it work with music? (not home to check) :smiley:

@ReneTode yup thanks

From the picture you are using tts.google_say. That won’t work.

From my understanding you can’t do that. You have to use media_player.alexa_tts

Yes, it’s not available in italian amazon skill store

I tested it, but it is not working…

The answer to this question on my echo is: “Non posso trovare una risposta a questa domanda”. In english “cannot find an answer to this question”

Try amazon.it without double quotes…

Same for me

@maurizio53 please try to put your answers inside 1 reaktion.
its very bad to see 1 person reacting 5 times in a row.

@cherokee93 yeah it should work with music.
and you can send commands to alexa with the TTS service.
so you can start skills, routines, ask for the weather, or traffic from HA.

1 Like

@ReneTode “…so you can start skills…”

Would you happen to know if this can be done in the UK, on a second-generation Dot?

(Actually all I want to do is issue the “stop” command from HA.)

Alexa B wakes up when Alexa A says “Alexa,” and then they both immediately shut off. The initial TTS message does not even complete.