Echo Devices (Alexa) as Media Player - Testers Needed

Almost there but now I’m getting this error

Thu, 05 Jul 2018 08:14:24 GMT nightmare queueing action “evaluate”
Thu, 05 Jul 2018 08:14:24 GMT nightmare running
There was an error
Internal endpoint:
curl -X POST -d “tts=Ask Alexa team for a proper TTS API” -d “deviceSerialNumber=deviceSerialNumber” http://localhost:8091/alexa-tts

Almost there too.

ERROR (SyncWorker_12) [custom_components.media_player.alexa] Could not connect to alexa server at http://addon_9ff8aed5_alexaapi (('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)))

UPDATE: After few Hassio restarts it’s working great! :slight_smile:

So i got the addon working (restart was needed). And also got the login message. So that looks good. I also installed the custom media_player component and after a restart I got the devices listed. But they dont seem to work and always have an unknown state. The log says the following:
2018-07-05 11:43:00 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.echo_wohnzimmer is taking over 10 seconds
for every device. The frontend says:
grafik
In reallity it is playing a TuneIn channel. So it seems that the custom component does not work as it should.

As every mobile is also getting discovered by the service, it could be a good idea, to implement a white list of devices

Regards
Lukas

How about 2FA ?

This has to be disabled to get this working.
Is there any workaround for that?

Cheers
Marc

1 Like

2 Factor Authentication is not active. Login is successful, devices are found, but the not its status.

Hi,

Trying out your component and I get …

Thu, 05 Jul 2018 17:20:58 GMT nightmare running
There was an error
Internal endpoint:
curl -X POST -d "tts=Ask Alexa team for a proper TTS API" -d "deviceSerialNumber=deviceSerialNumber" http://localhost:8091/alexa-tts
got request for getDevices
TypeError: Cannot read property 'cookies' of null
    at Object.getDevices (/workspace/alexa-api.js:181:26)
    at /workspace/index.js:29:13
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
    at next (/workspace/node_modules/express/lib/router/route.js:137:13)
    at urlencodedParser (/workspace/node_modules/body-parser/lib/types/urlencoded.js:100:7)
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
    at next (/workspace/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/workspace/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
    at /workspace/node_modules/express/lib/router/index.js:281:22

Any suggestions on what I can check?

For those experiencing the “There was an error” error in their addon log. Can I ask what environment you’re running on (raspberry-pi, or other). Also what locale are you in. (USA, or other)

Typically the error means that it failed to login to amazon with your credentials, but this could be because as of right now it is using the amazon.com website.

@lweberru, I haven’t tested with other media playback besides amazon prime. Do you have prime music that you could test to see if that works?

I’m in the UK with devices registered in the UK
Runing HASS.io on a R-Pi 3

When I try manually to logonto alexa.amazon.com it kicks me to the UK login

Thanks

Env. HASSIO latest, on RPI 3, using amazon.co.uk in the UK, checked that my credentials work in amazon.co.uk, haven’t tried in amazon.com. Is there an option to tell the addon what country you are in, either automatically or manually?

Yeah, it seems that it will need to be region specific for logging in. I’ll see if I can get a config added in version 0.3 and see if that works.

For those of you in the UK. Can you access alexa config from the web? I assume the UK equivalent would be https://alexa.amazon.uk is this correct?

correct - I’ve just had a look at the original shell script, and I’m blocked with this by a captcha response.

while your at it, can you add AU specific too please?

https://alexa.amazon.com.au

btw, uk is https://alexa.amazon.co.uk

language, ‘en-AU’, ‘en-UK’.

Or maybe just make it an entry to allow the user to add the URL and language.
Presumably, there a variety of locations (IT, DE, FR, etc. etc.)

Nope…

image

https://alexa-amazon-co-uk/
works :slight_smile:
BTW i put dashes in where the dots should be for the forum.

@keithh666 thanks! Pushing an update, should see it soonish.

@keithh666, @viperIII, @pembo, @acidhouse and all others.

Update 0.3 uploaded with a new parameter for the add-on config.

"url" : "https://alexa.amazon.com" 

above is what the additional config will look like for US Alexa users. Replace with your respective url.

1 Like

Edit: After 5 retries its up.

Somethings up with the check on the config. Cant seem to get a valid setting without having 3 nulls.

Edit2: Used “xxxx”.

Fri, 06 Jul 2018 03:52:18 GMT nightmare queuing process start
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “goto” for https://alexa.amazon.com.au
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “wait”
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “type”
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “type”
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “click”
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “wait”
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “goto” for Server Busy
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “wait”
Fri, 06 Jul 2018 03:52:19 GMT nightmare queueing action “evaluate”
Fri, 06 Jul 2018 03:52:19 GMT nightmare running
There was an error
Internal endpoint:
curl -X POST -d “tts=Ask Alexa team for a proper TTS API” -d “deviceSerialNumber=deviceSerialNumber” http://localhost:8091/alexa-tts
got request for getDevices
TypeError: Cannot read property ‘alexaURL’ of null
at Object.getDevices (/workspace/alexa-api.js:181:19)
at /workspace/index.js:29:13
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at next (/workspace/node_modules/express/lib/router/route.js:137:13)
at urlencodedParser (/workspace/node_modules/body-parser/lib/types/urlencoded.js:100:7)
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at next (/workspace/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/workspace/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at /workspace/node_modules/express/lib/router/index.js:281:22

Login is failing according to the log. Not sure why the config won’t let you put in your settings.

{
  "username": "[email protected]",
  "password": "mysupersecretamazonpassword",
  "url": "https://alexa.amazon.com"
}

Ok, changed to alexa.amazon.com and it works with that. Must be a different path for AU :thinking: or different login.