Echo Devices (Alexa) as Media Player - Testers Needed

My setup is working perfect after the patch. No issues since this idea popped up

I wanted to reinstall Alexa media Player because it was not working…but it fails:

  • After configuration step, 2FA authentification, it brings me on a local amazon loging page (an external connection is needed) but nothing happens, I cant login into this page it loops…
  • after that , the integration does not shows up in the integration list
    what shoul I do?

anyone seen this form? which value I have to insert in second and third position?

2024-10-05 22:07:08.658 DEBUG (MainThread) [custom_components.alexa_media] {'coordinator': None, 'config_entry': <ConfigEntry entry_id=0162aa1b96ebca9775bd9583d2e940bc version=1 domain=alexa_media [email protected] - amazon.it state=ConfigEntryState.SETUP_ERROR [email protected] - amazon.it>, 'setup_alexa': <function setup_alexa at 0x7fc6c484c0e0>, 'devices': {'media_player': {}, 'switch': {}, 'guard': [], 'light': [], 'binary_sensor': [], 'temperature': [], 'smart_switch': []}, 'entities': {'media_player': {}, 'switch': {}, 'sensor': {}, 'light': [], 'binary_sensor': [], 'alarm_control_panel': {}, 'smart_switch': []}, 'excluded': {}, 'new_devices': True, 'http2_lastattempt': 0, 'http2error': 0, 'http2_commands': {}, 'http2_activity': {'serials': {}, 'refreshed': {}}, 'http2': None, 'auth_info': None, 'second_account_index': 0, 'should_get_network': True, 'options': {'include_devices': 'echo cucina', 'exclude_devices': 'echo garage', 'queue_delay': 1.5, 'scan_interval': 60.0, 'public_url': 'https://dxxxxxduckdns.org/', 'extended_entity_discovery': True, 'debug': False}, 'listener': [<function ConfigEntry.add_update_listener.<locals>.<lambda> at 0x7fc6c484c9a0>], 'login_obj': <alexapy.alexalogin.AlexaLogin object at 0x7fc6c4848710>, 'last_push_activity': 0} options reloaded
2024-10-05 22:24:33.939 DEBUG (MainThread) [custom_components.alexa_media.helpers] d*************i@g*******m: Returning uuid {'uuid': '268d2309eb7b7db11ecdb201b0c911e3', 'index': 0}
2024-10-05 22:24:34.004 DEBUG (MainThread) [alexapy.alexalogin] Creating TOTP for H************************************************D2A
2024-10-05 22:24:34.004 DEBUG (MainThread) [alexapy.alexalogin] Generating OTP 644816
2024-10-05 22:24:34.006 DEBUG (MainThread) [alexapy.alexalogin] Login created for [email protected] - amazon.it
2024-10-05 22:24:34.010 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/.storage/[email protected]
2024-10-05 22:24:34.013 DEBUG (MainThread) [alexapy.alexalogin] Trying to load cookie from file /config/.storage/[email protected]
2024-10-05 22:24:34.039 DEBUG (MainThread) [alexapy.alexalogin] Trying to load aiohttpCookieJar to session
2024-10-05 22:24:34.082 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/[email protected]
2024-10-05 22:24:34.085 DEBUG (MainThread) [alexapy.alexalogin] Searching for cookies from /config/.storage/[email protected]
2024-10-05 22:24:34.088 DEBUG (MainThread) [alexapy.alexalogin] Using credentials to log in
2024-10-05 22:24:34.089 DEBUG (MainThread) [alexapy.alexalogin] Attempting oauth login to https://www.amazon.com/ap/signin?openid.return_to=https://www.amazon.com/ap/maplanding&openid.assoc_handle=amzn_dp_project_dee_ios&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&pageId=amzn_dp_project_dee_ios&accountStatusPolicy=P1&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns.oa2=http://www.amazon.com/ap/ext/oauth/2&openid.oa2.client_id=device:323638643233303965623762376462313165636462323031623063393131653332333431333234393536346335363335353634643332353733383331&openid.ns.pape=http://specs.openid.net/extensions/pape/1.0&openid.oa2.response_type=code&openid.ns=http://specs.openid.net/auth/2.0&openid.pape.max_auth_age=0&openid.oa2.scope=device_auth_access&openid.oa2.code_challenge_method=S256&openid.oa2.code_challenge=jTRCQHzjPbr_n_zvxBFTX_oTbCDASrGaTpLi78c2eDs&language=it_IT
2024-10-05 22:24:34.089 DEBUG (MainThread) [alexapy.alexalogin] Loaded last request to https://www.amazon.com/ap/register 
2024-10-05 22:24:34.091 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.com/ap/register
2024-10-05 22:24:34.159 WARNING (MainThread) [alexapy.helpers] alexalogin.login((<alexapy.alexalogin.AlexaLogin object at 0x7fc6c4848710>,), {'cookies': {}}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments:
('can only concatenate str (not "NoneType") to str',)

regards

You will need to create a new account on the Alex Login page.
You enter the email from the existing account.
It shows that the account already exists
Confirm again and you will be taken to enter the OTP
done!

1 Like

it doesn’t open alexa login web page…How I can do?

It was a reply to moreje.

In your case, delete installation, restart HA, re-add installation.

I done again alexa integration, and now seems to be ok, but I’m not able to control my echo dot; in logs I found this:

2024-10-06 21:59:29.222 DEBUG (MainThread) [alexapy.alexaapi] d******i@gm:Login error detected; ignoring post request to /api/np/command with {‘type’: ‘PlayCommand’} {‘deviceSerialNumber’: ‘G0922H0725120SFN’, ‘deviceType’: ‘A4ZXE0RM7LQ7A’}
2024-10-06 21:59:29.222 WARNING (MainThread) [alexapy.helpers] alexaapi.play((<alexapy.alexaapi.AlexaAPI object at 0x7f3a4f3eb950>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments:
(‘Login error detected; not contacting API’,)

So, I uninstalled AMP due to the boot issues, reinstall the latest version, and I now get a login loop with the amazon alexa webpage.

2FA steps work as expected and described in the installation guide on the WIKI

Is there a simple fix ?

2 Likes

Hi,
I installed again all and it works only few minutes…then I receive these errors:

Registratore: alexapy.helpers
Fonte: runner.py:189
Prima occorrenza: 21:04:08 (6 occorrenze)
Ultima registrazione: 21:04:15

* alexaapi.run_behavior((<alexapy.alexaapi.AlexaAPI object at 0x7f81ff72ae10>, {'@type': 'com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode', 'type': 'Alexa.Speak', 'operationPayload': {'deviceType': 'A4ZXE0RM7LQ7A', 'deviceSerialNumber': 'G************SFN', 'locale': 'it-it', 'customerId': 'A**********TDL', 'textToSpeak': 'ciao, bella gioia!', 'target': {'customerId': 'A**********TDL', 'devices': [{'deviceSerialNumber': 'G************SFN', 'deviceTypeId': 'A4ZXE0RM7LQ7A'}]}, 'skillId': 'amzn1.ask.1p.saysomething'}}), {'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
* alexaapi.send_sequence((<alexapy.alexaapi.AlexaAPI object at 0x7f81ff72ae10>, 'Alexa.Speak'), {'customer_id': 'A10MHAKBMVITDL', 'textToSpeak': 'ciao, bella gioia!', 'target': {'customerId': 'A**********TDL', 'devices': [{'deviceSerialNumber': 'G************SFN', 'deviceTypeId': 'A4ZXE0RM7LQ7A'}]}, 'skillId': 'amzn1.ask.1p.saysomething', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
* alexaapi.send_tts((<alexapy.alexaapi.AlexaAPI object at 0x7f81ff72ae10>, 'ciao, bella gioia!'), {'customer_id': 'A10MHAKBMVITDL', 'queue_delay': 1.5}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)


Registratore: alexapy.helpers
Fonte: custom_components/alexa_media/__init__.py:778
Integrazione: Alexa Media Player ([documentazione](https://github.com/alandtse/alexa_media_player/wiki), [problemi](https://github.com/alandtse/alexa_media_player/issues))
Prima occorrenza: 20:53:40 (2 occorrenze)
Ultima registrazione: 20:53:40

* alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f820c97bbf0>,), {'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)
* alexaapi.get_last_device_serial((<alexapy.alexalogin.AlexaLogin object at 0x7f820c97bbf0>,), {}): An error occurred accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Unauthorized',)

Experiencing the same thing where after re-installing the Login page just kept looping. I selected “Create new account” entered my e-mail address. This triggered an alert that I already had an account. I then switched back to “Sign in” and it worked as expected.

Hi,
I’m working with HA 2024.8.3 and AMP 4.13.2 successful and never had any issues since month. I have 9 Echos and use them intensively for tts and starting scripts.
But now, I will have to update due to other fixes and I’m totally unsettled because of these 3 threads on Github:
Alexa Media Reauthentication Required - continuously appear: Login error detected; not contacting API · Issue #2453 · alandtse/alexa_media_player (github.com)
Alexa API / Too many requests · Issue #2177 · alandtse/alexa_media_player (github.com)
TypeError: can only concatenate str (not “NoneType”) to str · Issue #2515 · alandtse/alexa_media_player (github.com)

It might have something to do with changes in HA. Otherwise I would have had these issues too.

Does anybody run AMP 4.13.2 or higher successfully on HA 2024.10.x without skipping the polling or other mods? Do I still have to wait for fixes?

Does anyone know if you can use the value of a sensor within the media_content_id field of the media_player.play_media action?

Use Case: I want to send a custom command to my Echo that leverages a sensor’s value as part of the sentence.

Example: Alexa, move music to <sensor.room_name> echo’
would result in sending: Alexa, move music to family room echo

Sure, just use a template:

action: media_player.play_media
target:
  entity_id: media_player.dotkitchen
data:
  media_content_type: custom
  media_content_id: |
    simon says H.A. version is {{ states('sensor.home_assistant_versions') }}

For now I use node-red with the alexa applestrudel node and most of the automations work, the only ones that I still can’t get to work are those related to the Alexa actionable notification because I can’t use the alexa applestrudel node but the event node and when Alexa media player doesn’t work those automations are “blocked”… Is there anyone who is using applestrudel for actionable notifications?

Is this how it’s supposed to be? Didn’t see this trick mentioned in the installation instruction.

Hi everyone,

I have two fire TV sticks and messed them up in my HA config.
I did not find an option to delete the Echo devices separately.

Anny suggestion how to delete a single Echo device and discover it again?
Thanks in advance.

Hi All,

I’ve just updated and was hit with a window asking me to include the external URL and a list of Allowed and denied devices separated by a comma… as far as I understand I’ve done that… copied and pasted my Nabucasa URL (including the last) and entered my included device list as “light.bedside1, light.bedside2, light.lounge_decorative_light, etc…” and my Excluded device list as “automation, binary_sensor, device_tracker, etc…” but it fails to load… where have I gone wrong?

my log file from the error is this,

Logger: homeassistant.setup
Source: setup.py:416
First occurred: 9:18:31 PM (1 occurrences)
Last logged: 9:18:31 PM

Error during setup of component alexa_media
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/alexa_media/__init__.py", line 159, in async_setup
    CONF_PUBLIC_URL: account[CONF_PUBLIC_URL],
                     ~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'public_url'

I hope that makes sense to someone…

any and all help is greatly appreciated

thank you so much for your attention and participation.

Robin

I also have tried (twice) to upgrade to 4.13.8 (from 4.13.7). Upon reboot, I get the following notification:

Invalid config
The following integrations and platforms could not be set up:

alexa_media (Show logs)
Please check your config and logs.

In the log I get the following:

Log details (ERROR)
Logger: homeassistant.setup
Source: setup.py:416
First occurred: 5:45:22 PM (1 occurrences)
Last logged: 5:45:22 PM

Error during setup of component alexa_media
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/alexa_media/__init__.py", line 159, in async_setup
    CONF_PUBLIC_URL: account[CONF_PUBLIC_URL],
                     ~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'public_url'

After going back to 4.13.7, I have no noticeable issues.

1 Like

Not just me then… thought I was going mad there but after reading this I went back to 4.13.7 and all is good for now.

1 Like

Hi, here is te same. rollback to 4.13.7 and everything works…