Echo Devices (Alexa) as Media Player - Testers Needed

Anybody else had the problem that the component logins successfuly, but it won’t start automatically after startup ?

Any ideas for running on Hassbian, please?

I solved this issue by uninstalling the add-on, restarting HassOS and reinstalling the add-on.

@kanga_who You should really switch to hassos!

@keatontaylor I just installed 0.5 on hassos, it looks like the start is good:

Thu, 12 Jul 2018 13:19:30 GMT nightmare electron child process exited with code 0: success!
Logged in
Internal endpoint:
curl -X POST -d "tts=Ask Alexa team for a proper TTS API" -d "deviceSerialNumber=deviceSerialNumber" http://localhost:8091/alexa-tts

But when I add the component to hass, it fails:

Traceback (most recent call last):
  File "/usr/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 71, in <lambda>
    track_utc_time_change(hass, lambda now: update_devices(), second=30)
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 318, in wrapper
    result = method(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 318, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/media_player/alexa.py", line 77, in update_devices
    devices = AlexaAPI.get_devices(host).json()['devices']
AttributeError: 'NoneType' object has no attribute 'json'

Are you planning to release a version for 64 bit soon or should I back to 32 bit?

64-bit support is coming as soon as I get my cross-platform build working. (almost done)

2 Likes

Wow… you are da man! So long waiting for Alexa TTS capability. Running Hass.io on Raspberry Pi. Installed the add-on, copied over the script and it worked on first attempt. Using https://alexa.amazon.com as URL. Found all five of my echo’s. Had TTS working within a couple of minutes. Already been asked by my wife to turn it off… LOL Thank you!

1 Like

@pattyland, this is a new error I haven’t seen before. Looks like the device list being returned by the add-on is None. Some potential troubleshooting steps would be to run.

curl -X POST http://localhost:8091/alexa-getDevices

See if that returns a list of devices. (localhost might not work and you may have to replace with the IP of your HassOS device)

Haha, for what it is worth, the first thing I did was ‘rick roll’ my significant other while I was not home. :joy:

6 Likes

Any progress solving the 2FA login issue? I don’t want to disable 2FA for Amazon login.

1 Like

when I put the media player component in config.yaml, then restart home assistant, all my media players disappeard

That is because there is an error processing your media_player components.

Off topic: Try to give more details please when asking for help. I’m sure you have some error messages in your log / dev-log.

On topic: Same thing happened to me at first attempt. In my case, I downloaded the alexa.py file through the browser, and it was all messed up, it contained html tags … etc. I just went on github and copy / paste all contents of the alexa.py file, into my alexa.py file using a text editor. Restarted and all was fine. All my old media_player devices came back and all the alexa devices magically appeared.

@keatontaylor It’s returning 6 devices, and according to JSONLint the JSON is pretty valid :thinking:

I have tried Hassio, but can not use it as I need a working plugin for my Ubiquiti Unifi controller, the current version available does not work for me. I also much prefer being able to install other programs being that Hassbian is a normal linux fork.

STATUS UPDATE:

I’ve been working hard trying to get some of the bugs out and hopefully resolve some of the issues that users have had with the login failing on the add-on, and honestly when researching node.js and nightmare the major issue is that it is remarkably unreliable on different platforms. Therefore I think in the interest of making sure the media_player component works well for everyone I have decided to dump all efforts into removing the need for node.js and the add-on all together and make everything native python.

The issue is that it will indeed need a mechanism for users to input the captcha and my thought is that I can use the component configuration page (like used for ikea trådfri) and allow users to see the captcha and enter the code to make everything seamless.

I’ve already got the code working for logging in, seeing that a captcha is needed and saving it to the file system but I still need to implement the code to present it to the user in the HA gui.

Once this is complete the good news is that the component will not require any external add-ons, it should be faster because it is talking directly to amazon instead of going through the add-on and hopefully will resolve most if not all of the login issues people are having.

Thank you all for your patience and as soon as I get this all working you’ll see a version update from me.

12 Likes

Thank you very much for you hard work getting this up and running for us. Im running Hassio on a pi zero w and have had no luck in getting this to work so far. Looking forward to it is and understatement.

Your work is much appreciated ! Thank you, for your efforts.

thank you for the update and the work.

not working on System HassOS 1.5

error:
Can't install keatontaylor/aarch64-addon-alexa-api:0.5 -> 404 Client Error: Not Found ("pull access denied for keatontaylor/aarch64-addon-alexa-api, repository does not exist or may require 'docker login'")

aarch64 is not supported, but soon the add-on will be obsolete and no longer needed.