Echo Devices (Alexa) as Media Player - Testers Needed

alexa
Tags: #<Tag:0x00007f47f9bba768>

#1226

Yes I thought so too after reading your suggestions but no luck. Maybe is something related to api calls. It seems to understand only internal commands as news, weather, timer and other commands but stuff related to skills have strange behaviors:

  • calling my skill like “chiedi a Tom ripeti messaggio testo da ripetere” returns the error sound
  • calling a skill from skill store like “chiedi a giallo zafferano una ricetta” (skill related to kitchen receipts) seems to work but a little buggy: Alexa replies something like “Giallo Zaf” and stops speaking truncating words, waits 2 or 3 seconds and then skills starts normally as expected
  • calling a skill from skill store like “avvia foresta notturna” (english: “night forest”, an ambient sound skill) returns an error sound like my skill

At first sight it seems to not work skills that don’t need further details (receipts skills needs some details once started) after start but this is just an opinion :thinking:


#1227

are you sure she understands exactly the same as what you write?
so if you speak to her and look at the history, and you send exactly that?

did you also try other parts from your own skill?
preferably the most simple thing you got.

maybe she has trouble with conversation skills, but not with single command skills.
or with some words.


#1228

are you sure she understands exactly the same as what you write?

Yes I tried exactly with same text and speaking directly to Alexa works, trying from skill test page works but from TTS or shell command doesn’t work

yes I use my skill every day asking for garbage days, system devices status (slots), system status and works. I just tried to make same request (system status, simples one) from TTS service and directly from Alexa and, as expected, doesn’t works with TTS service but works at first try speaking with her…


#1229

hmm, to bad.
would be nice if we could understand why some skills work and why some give problems.


#1230

We have some other details :sunglasses:
I made some tries and looking to Alexa history I noticed one thing: my intent (in intent_script.yaml) is configured as:

TTSIntent:
speech:
  text: >
    {{TextToSpeech}}
card:
  type: simple
  title: TTS skill
  content: Alexa text to speech

So title is TTS skill and content description is Alexa text to speech. As I said in previous messages when I call my skill (or other skill without details after start) Alexa returns error sound and nothing else so no history entry, but if I send from media_player a sentence like “quanto manca a natale” (“How many days until christmas?” in english) she replies me with correct reply (so 34 days from now) and I see the history event in history, but this entry is named “Simon dice quanto manca a Natale” (“Simon says how many days until christmas” in english)…so it seems to have an hidden skills\api call called Simon says.
I think our error is related maybe to a different implementation for some APIs…

PS: In history I see Simon says but of course instead repeating text Alexa runs it as a command


#1231

I have a similar situation. I have two echo’s, one in the office and one in the living room. The one in the living room gets updated with album art and I can pause, next track etc but it will not play tts, the one in the office gets updated with what is playing, but no album art and I can not control it or get it to play tts. I have tried removing the office one from my alexa account (de-registering it) and adding it again but it always comes back the same. I have tried deleting the ‘pickle’ file, removing and re-adding the media_player entry, deleting and reintroducing the alexa.py file, all to no avail. This has so much promise but I am finding it really frustrating trying to get it working like others are reporting. Does anyone one have any other suggestions?


#1232

i think you interpret that wrong.

the reason why you see “Simon dice quanto manca a Natale” in the history is because the TTS service sends that. the part simon dice is added because in other languages there is such a skill.
but from the response it seems that in IT she ignores that part and we know that that skill isnt there.

so in some cases she ignores that part and does what it placed after it, in some cases she doesnt ignore it.
i dont have the mediaplayer anymore, but i got the bashscript.
to bad that i dont have enough knowledge from that script to find out how i can send the tekst without the simon says part.
it might be that commands are possible from all languages now, but i have no means to test.

just for fun it could be worth it to try how alexa reacts when you call your skill simon instead of tom.
and then adapt the text you send to her with in mind that the tts function adds “simon dice”


#1233

Uhmm…I took a look to the bash script linked in some post above (the same linked by the post author in the first post) and there is nothing referring to “Simon” or “says” (just did a string search in file). To make a TTS it “simply” create a string with

TTS=$(echo ${COMMAND##*:} | sed -r 's/[^-a-zA-Z0-9_,?! ]//g' | sed 's/ /_/g')
TTS=",\\\"textToSpeak\\\":\\\"${TTS}\\\""

(row 312-313)

and uses it to create command string

COMMAND="{\"behaviorId\":\"PREVIEW\",\"sequenceJson\":\"{\\\"@type\\\":\\\"com.amazon.alexa.behaviors.model.Sequence\\\",\\\"startNode\\\":{\\\"@type\\\":\\\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\\\",\\\"type\\\":\\\"${SEQUENCECMD}\\\",\\\"operationPayload\\\":{\\\"deviceType\\\":\\\"${DEVICETYPE}\\\",\\\"deviceSerialNumber\\\":\\\"${DEVICESERIALNUMBER}\\\",\\\"locale\\\":\\\"${LANGUAGE}\\\",\\\"customerId\\\":\\\"${MEDIAOWNERCUSTOMERID}\\\"${TTS}}}}\",\"status\":\"ENABLED\"}"

(row 498)

and then calls cURL command with

${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L\
 -H "Content-Type: application/json; charset=UTF-8" -H "Referer: https://alexa.${AMAZON}/spa/index.html" -H "Origin: https://alexa.${AMAZON}"\
 -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X POST -d ${COMMAND}\
 "https://${ALEXA}/api/behaviors/preview"

(row 501)

so “Simon dice” is added by API service in some way because (I think) command contains “textToSpeak” so Alexa API recognizes it but seems that IT implementation is not finished or not enabled (don’t know)

Nice one, I will try when ad home and I will update with results :+1:


#1234

yeah i did go through it myself and did find that.
in the app (when its from germany or usa) you can use custom text in routines.
and the command is send to call that part from the routine.
and that part from the routine was a skill that amazon adapted to use in routines.

so it seems like that the IT server accepts the api to do that part from the routine, but because they forgot to implement the skill it results in other behaviour.

i did go to the script to see if there was a way to send the text in another way then as that command, but there my knowledge stops :wink:

by the way, i think row 501 is to start the routine that is created in row 498


#1235

Yep, I agree on everything.
From what I read on previous messages in this topic it seems that in other countries than IT, ES and newer Alexa countries you can set custom text as response in routines but in Italy we don’t have (yet) this option and maybe this is the key to TTS.
Yes, you are correct: row 501 starts the http call to API with parameters composed in row 498 (and 312-313). I think bash script and HA plugin are working, the problem is on server side so we have to wait for them…:worried:


#1236

Getting always this error… what’s about?

2018-11-20 17:05:22 ERROR (Thread-18) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type ConnectionError occurred. Arguments:
(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')),)
2018-11-20 17:05:22 ERROR (Thread-18) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type AttributeError occurred. Arguments:
("'NoneType' object has no attribute 'json'",)

It seems connection related, but my wifi is working very good.


#1237

no idea.
depends on what you are trying on that moment i guess.
you seem to try to do something but you didnt provide the neccesary attribute.
or you have something somewhere in your configuration that isnt complete.


#1238

No, i just had that error after restarting HA and doing nothing related to that media_player.
My configuration says:

  - platform: alexa
    email: !secret amazon_email
    password: !secret amazon_password
    url: amazon.it

And i think it’s ok…


#1239

if its an error that only appeared 1 time i shouldnt worry if the component does what it should.


#1240

Like one of the previous posters mentioned I added the following to configuration.yaml file:

media_player:
  - platform: alexa
    email: !secret amazon_email
    password: !secret amazon_password
    url: amazon.com

After this to the config file and checking the config it just spins and never completes the check. I’ve also tried it with just the following with the same results:

media_player:
  - platform: alexa

#1241

do you have another media_player in your config?

you can only have once:

mediaplayer:

in the config.

did you copy paste into your config?
some editors add unseen stuff when you copy paste.
delete all whitespace (everything that looks like a space) and add real spaces.


#1242

I did have more than 1 media_player in the config. I removed it and typed the config without cut and paste and made sure spacing is correct. Still doing the same thing.
If I put the following it pass the config check:

media_player:

If I put the following it will not pass the config check, just spins:

media_player:
  -  platform: alexa

#1243

You have one too many spaces after the - in the platform: line. Try:

media_player:
  - platform: alexa

#1244

I have this working well but is there a way to switch the default TTS to Alexa?


#1245

no, tts is only available through services