The Add-on works perfectly for me too. The love for Alexa is back again, this opens a world of new possibilities. I have been re-writing my scripts and automations for the past few days and Alexa updates me and my households on everything now. It’s amazing, I love it. Thank you so much @keatontaylor , this was the missing link in my home automation.
If you’re ever in Amsterdam, let me buy you a beer
Although…, I actually reverted back to v0.5 with the add-on yesterday, it just works flawlessly for me, no captcha and allows me to use multiple accounts. (with some minor hackery)
Honestly, I’d recommend most people use the v0.5 component with the add-on.
That is, unless you are willing to test and don’t mind the possibility of issues, at least until the standalone component is more mature.
FWIW,
I don’t mind testing, the persistent captcha on restarts, or other issues right now with the standalone component right now, but not being able to use multiple accounts make the standalone component useless to me.
Thanks for getting this working, this is a very nice addition to my HASS setup.
Question - Is there a way to output to multiple echos at the same time? Group them into a single media player with a new name like “media_player.kids_echos”?
Also - I can get a single echo to play a siren sound (found on Amazon Music), but I can only stream to one device at a time. Is there a way to play it on all my echoes at the same time? One echo plays it, the other complains it can only stream from amazon music to one device at a time.
2018-07-31 00:14:39 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was
never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/root/.homeassistant/custom_components/media_player/alexa.py", line 120, in <lambda>
track_utc_time_change(hass, lambda now: update_devices(), second=30)
File "/usr/local/lib/python3.5/dist-packages/homeassistant/util/__init__.py", line 318, in wrapper
result = method(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/homeassistant/util/__init__.py", line 318, in wrapper
result = method(*args, **kwargs)
File "/root/.homeassistant/custom_components/media_player/alexa.py", line 129, in update_devices
devices = devices.json()['devices']
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 8 column 1 (char 7)
I have logged in with the capcha but no alexa medai players show and I get this in the logs…
Still got “simplejson.errors.JSONDecodeError: Expecting value: line 8 column 1 (char 7)”
Update1:
Getting closer with my debugging
the code: devices = AlexaAPI.get_devices(url, login_obj._session)
returns: <Response [200]>
and if i cycle through the devices array, i see a bunch of html - not JSON. so need to track down the website its going to and what its pulling in.
Update2:
when, on my laptop, i go to “https://alexa.amazon.com/api/devices-v2/device” on my computer, i get the JSON that the python script is looking for. But when i look at the code is pulls in from the script (from my server), i clearly see that it has NOT succeeded in logging in. However, the script is incorrectly still interpreting that page as a “successful login”.
i.e. the following code isnt working the way it is intended. just finding the word ‘devices’ in what you pull from the post response is insufficient as even the web page has that word in it,.
if ‘devices’ in post_resp.text:
status[‘login_successful’] = True
else:
status[‘login_failed’] = True
Update3:
I can confirm that even if it can access the json file (i set up my own locally hosted version), it still crashes out with the same error. i can also confirm it is this line: devices = devices.json()[‘devices’]
but it is beyond me to diagnose further.
I remember now, that, the first time this happened to me, the component and alexa.py were at version 6.1.
I did the login / logout / switch account / sign in sequence, but also deleted the alexa.cpython-36.pyc file from /custom_components/media_player/__pycache__ folder.
Please, just do it once more:
Do the sequence
Delete that file
Restart HA
… please, I’m curious why it worked for me !
It worked from ver. 6.1 so when I upgraded to 7.1, I needed not to delete the file. but you must, if you did not.
I did not mention this (the deletition part) because I thought you did that part earlier … sorry.