It has come to my attention that the custom integration Alexa Media Player no longer has an active developer fixing issues. The custom integration appears to be on life-support. Fixes will not occur without community member intervention.
Please head over to Alexa Media Player and start assisting with issues if you can replicate them. It appears that the the current owner of the repository is only reviewing PRs and is not actively developing any more features or fixing issues.
Lastly, do not create issues in the repository to make complaints about the owners decision to stop development.
run it "python library_test.py --country XX --email [email protected] --password ZZZ " where country is the 2 digit international code, like IT or Italy
Running the script, I get to the OTP prompt, but never get a OTP sent. I tested in the browser and was able to get an OTP sent. I tested with both US and us and two different accounts.
Testing again in a browser, https://www.amazon.com/ap/signin?<snip> also sends an OTP code where the script doesn’t.
DEBUG:aioamazondevices:Logging-in for [email protected] [otp code 123456]
DEBUG:aioamazondevices:Creating HTTP ClientSession
DEBUG:aioamazondevices:Build oauth URL
DEBUG:aioamazondevices:GET request: https://www.amazon.DE/ap/signin[...]
DEBUG:aioamazondevices:Get request data from HTML source
Traceback (most recent call last):
File "/share/alexa_test/library_test.py", line 89, in <module>
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_comp lete
return future.result()
^^^^^^^^^^^^^^^
File "/share/alexa_test/library_test.py", line 63, in main
await api.login(args.otp_code or input("OTP Code: "))
File "/share/alexa_test/lib/python3.11/site-packages/aioamazondevices/api.py", line 194, in login
login_method, login_url = self._get_request_from_soup(login_soup)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/share/alexa_test/lib/python3.11/site-packages/aioamazondevices/api.py", line 153, in _get_request_from_soup
method = form["method"]
~~~~^^^^^^^^^^
File "/share/alexa_test/lib/python3.11/site-packages/bs4/element.py", line 157 3, in __getitem__
return self.attrs[key]
~~~~~~~~~~^^^^^
KeyError: 'method'
It seems to work, if the country is written in small letters (de instead of DE).
I had to escape some special characters in the password though (also in the previous attempt).
Do you need any output?
That might be the case, but from my browser tests, they were fast. The one from the library didn’t ever come at all. I will try a little later to run the script in my Container and see if that has better results. I originally tested it just from a quick venv I setup locally.
So, as soon as I changed from SMS for OTP to an MFA app, I was able to get in and see my devices… However, with that said, there’s still an issue with the SMS MFA provider. Not sure where it might be though.
I’m going to try a couple more tests and see if I can figure it out.
EDIT: So, oddly enough, after I enter in the OTP from a MFA app, THEN I get an SMS from Amazon with another OTP code.
I make heavy use of this integration in my Home Assistant configuration, to play alert sounds and speak notifications on multiple Alexa devices around the house. This all stopped working after I updated to HA Core 2024.5.5 last night. I came to these forums to request help, and saw this post - so I guess there are bigger problems.
There is an update available which I will try - I’m still using 4.9.0 which is several versions out of date.
However, given how incredibly useful I find Alexa Media player, if the original developer is no-longer able to maintain it I wonder whether the Home Assistant team could consider promoting it to an official integration. There must be a lot of Home Assistant users with Alexas who would benefit from this.