alexa_media_player: Can't relogin after update
IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.
I got an update for Alexa Media Player on Home Assistant, I ran it and now it doesn’t find my devices, I keep getting OTP codes via SMS to re-login but I don’t know where to put them!
Update Alexa Media Player via Home Assistant to the last version
- Go to Settings
- You have an update of “Alexa Media Player”
- Install it
- Reboot HA
To have a page to re-login or where to insert the OTP code received via SMS.
System details
- Home Assistant version: 2025.1.4 (Core) and 20250109.2 (Frontend)
- alexa_media version (from
const.pyor HA startup log): 5.5.1 - alexapy version (from
pip show alexapyin homeasssistant container or HA startup log): 1.29.5 - Is Amazon 2FA/2SV enabled <!—We will not debug login issues if unanswered—> (y/n): y
- Amazon Domain: amazon.it
Debug Logs (alexa_media & alexapy) Questo errore ha avuto origine da un’integrazione personalizzata.
Registratore: alexapy.helpers Fonte: custom_components/alexa_media/media_player.py:606 Integrazione: Alexa Media Player (documentazione, problemi) Prima occorrenza: 18:43:37 (2 occorrenze) Ultimo accesso: 18:43:40
alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0x7f454a5a90>,), {}): A login error occurred: An exception of type JSONDecodeError occurred. Arguments: (‘Expecting value: line 1 column 1 (char 0)’,) alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0x7f454a6350>,), {}): A login error occurred: An exception of type JSONDecodeError occurred. Arguments: (‘Expecting value: line 1 column 1 (char 0)’,)
Additional context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 45
Thank you, this solved it for me as well!
Yep, every two minutes here too, I didn’t wait long enough to notice.
El sáb, 8 mar 2025, 13:50, crik91 @.***> escribió:
The alexa_media_<your_email>.pickle is saved in /config/.storage folder in home assistant container.
I switched over to an authenticator token (TOPT) instead of SMS OTP a while back and that seems to still be working fine. E.g. the code in the google authenticator app you get by scanning the on screen qrcode looking thing.
https://www.amazon.com/a/settings/approval/appbackup?ref=ch_adsec_addExtraApp_attempt
I think you should somewhere, may just be in a different location. You could try running:
For those having issues finding and deleting the file, I’ve have had great success with the Terminal & SSH addon to simply get a terminal via browser to navigate to the directory and delete the pickle file. You can add it easily in the official add-on store:
fyi my pickle was named a little different: alexa_media.[amazon account email].pickle
Enable SSH and try to access via SSH, then launch
locate alexa_media.pickleorfind / -name "alexa_media.pickle" 2>/dev/nullI have found that it can be difficult to find, mine is located in
/mnt/dietpi_userdata/homeassistant/.storage/alexa_media.pickleDepending on the system hosting Home Assistant you can launch a global search to find out where it is.Same problem for me too. After updating to version 5.5.1, I started receiving OTP SMS messages from Amazon every 2-3 minutes. Thinking it was a hacking attempt, I changed my passwords, then realized it all started after updating AMP. I reverted to the previous version and everything went back to working smoothly without any OTP requests.
Solved! I deleted(renamed) the file
../homeassistant/.storage/alexa_media.pickleand restarted HA and now it works! The … depends on where is your folder located… I have Dietpi and the full path is/mnt/dietpi_userdata/homeassistant/.storage/alexa_media.pickleAMP was never written to deal with OTP codes issued by Amazon via SMS. It only works with 2-step Verification using an authenticator app generated OTP, the authenticator app being AMP itself via Python’s pyauth/pyotp which it supplies with the 52-character app secret to self-generate a TOTP (time-based one time password aka “OTP”) to give to Amazon. The SMS OTP is generated by Amazon and AMP can’t use that. You need to turn that off in your Amazon account.
This is happening to me as well on a fresh installation. After successfully authenticating on the web page, it just got stuck “Waiting for next step” and timed out.
Getting the same issue here, my devices are listed but for a few weeks I’ve been randomly receiving OTP texts, to the point I thought my Amazon account was compromised. After changing my password it happened again and I discovered the same error above in my Home Assistant logs. This error originated from a custom integration.
Logger: alexapy.helpers Source: custom_components/alexa_media/media_player.py:606 integration: Alexa Media Player (documentation, issues) First occurred: 10:20:51 PM (2 occurrences) Last logged: 10:20:54 PM
alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0xffff53095e10>,), {}): A login error occurred: An exception of type JSONDecodeError occurred. Arguments: (‘Expecting value: line 1 column 1 (char 0)’,) alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0xffff5272e0d0>,), {}): A login error occurred: An exception of type JSONDecodeError occurred. Arguments: (‘Expecting value: line 1 column 1 (char 0)’,)
Same problem here too on any version, even older ones
It seems like, I have the same issue.