I had something weird this morning. I have an automation run every morning (as part of my alarm) which triggers a routine on an Echo Dot. This morning it didn’t go off, so I checked in Home Assistant and found that Alexa Media Player had disappeared from Integrations.
I then checked some other things and then found that it had reaappeared but was actually showing twice, once with all my devices (and their entities) and once with no devices. I removed the one with no devices, but triggering routines was still not working, giving an error like this (censored the email address):
File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 1186, in async_play_media
queue_delay=self.hass.data[DATA_ALEXAMEDIA]["accounts"][self.email][
KeyError: '*******.*******@*******'
I restarted Home Assistant and now everything appears to be working as expected. I had no notifications about login issues.
My assumption is that the disappearing and duplication of the integration confused it, but do you have any idea why that would have happened?
If one was marked Discovered with a Configure button, then that’s the relogin prompt. It should have had a button to configure. The fact you removed an integration may have removed the stored data causing the key error. In theory the service should have been disabled as soon as you removed the integration but without logs I’m not sure why the service remained. I can of course catch this KeyError but then the service would fail silently.
Alexa TTS has suddenly stopped working. I have set 2-Step authentication on my account. Before you got a notification in the Home Assistant and it asked you for a Captua, but now the pop-up just disappears and nothing logs in, so I changed the Amazon Password (2FA is on) and updated in the configuration.yaml and now I just get this:
Log Details (ERROR)
Logger: homeassistant.setup
Source: custom_components/alexa_media/init.py:99
First occurred: 3:24:03 PM (1 occurrences)
Last logged: 3:24:03 PM
Error during setup of component alexa_media
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 191, in _async_setup_component
result = await task
File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/alexa_media/init.py”, line 99, in setup
login = AlexaLogin(url, email, password, hass.config.path,
File “/usr/local/lib/python3.8/site-packages/alexapy/alexalogin.py”, line 48, in init
self.login_with_cookie()
File “/usr/local/lib/python3.8/site-packages/alexapy/alexalogin.py”, line 93, in login_with_cookie
self.login(cookies=cookies)
File “/usr/local/lib/python3.8/site-packages/alexapy/alexalogin.py”, line 263, in login
self._process_page(html, site)
File “/usr/local/lib/python3.8/site-packages/alexapy/alexalogin.py”, line 425, in _process_page
if ‘’ in self._data.values():
AttributeError: ‘NoneType’ object has no attribute ‘values’
Log Details (ERROR)
Logger: homeassistant.setup
Source: setup.py:258
First occurred: 3:24:03 PM (1 occurrences)
Last logged: 3:24:03 PM
Unable to prepare setup for platform alexa_media.notify: Unable to set up component.
You’re on an old version of alexapy. Please make sure you’re using the latest version of alexa_media and report things like this on GitHub. I may never see it on this forum given how fast posts are buried here.
This morning it really happened what I was afraid of.
I received a notification that a relogin is required. The event works.
I changed to Amazon and activated the 2FA.
Then filled the captcha form with password and captcha code. Used the mobile phone.
I let the 2FA line empty at that time.
Received then a SMS with 2FA code, entered it and everything’s OK.
Puh😅
Mine stopped working this morning. In the integration page, I have 7 cards for Alexa, 6 of them with “CONFIGURE” button while the rest one is the normal one. I clicked one of “CONFIGURE” and enter stuff as necessary but never worked. So I removed the integration and added it back, it works fine now.
But the extra 6 Alexa with “CONFIGURE” button are still appearing in the integration page, how can I get rid of them?
Thanks!
Just to be clear -some of the posts mention “an authenticator app” instead fo using Amazon authentication. I googled authenticator app and there seems to be many. Will any one of them do? Will the Google authenticator app do or is that specific to my google account logins?
I’m about to update my alexa_media files from 2.8.3 since it all stopped working today. I was first enabling Amazon’s 2SV when it had a checkbox for “use authenticator app” and I’m unsure what to do here.
Should I use Amazon’s SMS or authenticator app (which one?)
You should set up any authenticator app. SMS has a limit to the number of SMS it will send while the authenticator is unlimited. Google authenticator will work for Amazon too.
I really have to say that the integration has become really unstable for me.
I got a new “login required” notification about an hour ago (even tho it’s only been a few days since I last went thru my recent authentication troubles). it asked me for the standard Captcha and the 2FA code just like it did before. I used the authenticator app I used last time (which worked fine) and put in the generated code but then after a few minutes I noticed it was asking me for a second 2FA code and I noticed Amazon sent me a OTP code to enter. OK, fine. No big deal I’ll just do it that way.
Everything seemed to work until about half an hour later I noticed it asked me to put in another 2FA code - that Amazon had sent again. So I did…
After that I gor asked to re-setup the integration again (add email address, password, region, devices, etc) then I got a window that said “please wait while the integration install”. weird…it was already installed…and it completely locked up my HA until I exited from my browser session and went back in. but then every time I went to the integration configuration page (because it kept asking me to authenticate over and over) I got the same “please wait…” message.
I eventually had to uninstall the integration and re-install. Which didn’t work. It never actually uninstalled even after a restart of HA.after un-installing, restarting, re-installing and restarting a few times I think I finally have everything entered and working.
but I’m pretty sure I never got the integration to successfully uninstall. It just kept coming back every time I restarted. Along with asking me to re-authenticate over and over.
the last time I uninstalled and restarted when HA came back up the integration was already there along with all my devices without me having to re-install the integration or even add any of the authentication information. It was like the previous 45 minutes never even happened.
But, like I said, it’s now working again. I just hope this doesn’t become a regular occurrence. It’s kind of a PITA.
Did you remove the data from your configuration.yaml? If you don’t it will import that data.
The simple fact is Amazon is being more aggressive about disconnecting apps like this. One day we will lose functionality. You can ask the official HA app to try to replicate as much as they can of this apps functionality in preparation for me not being able to work around Amazon login issues.
Past few days I have not been able to successfully auth with the app. It prompts me for 2FA and captcha but it always fails. I have the correct username/password in my configuration.yaml file. I did not have issues with this until recently.
Hi @alandtse. Do you really suggest that the media_player should be taken over by the core team and therefore an official function of the nabu casa alexa integration?
Did anybody wrote this as a request in the WTH Forum?