Echo Devices (Alexa) as Media Player - Testers Needed

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…

Hi there,

I’ve been playing around with ways to make my Echo devices play audio by URL. The goal was to play full length media in any quality, not just the lousy bitrate and length offered by audio tags in speech markup.
The result is a custom skill that has a “Play {Audio}” intent where the {Audio} slot is used to pass an identifier for the URL. It’s not actually usable by talking to Alexa as the identifier is just gibberish, but can be triggered via media_player.play_media with custom type. As the quest was to use an arbitrary media URL, the interesting part was to transport this URL via the “Audio” slot. Alexa does some weird and (not so) wonderful things to what you pass in there via the test console or other textual means. So I resorted to basically encode the URL in a way that circumvents any further treatment by Alexa. The skill decodes the URL and returns an AudioPlayer.Play directive to have the device stream media from the given address.
Everything is still very rough, but all test look good so far.

My question: the logical next step would be to integrate this in a way that I can select the Echo devices from HA’s media browser and stream any media source to them just like with the Chromecasts. Any pointer as to what is needed to:

  • have HA media browser list the alexa_media entities as targets for playing
  • translate a play action into sth. like media_player.play(“custom”, “Play {encoded_url} from home media”) respectively the equivalent action being sent to the device

Thanks in advance

If everything works, I’ll happily share all the details needed to wire things up

Is there a way to determine the status of a device attached to my Alexa account? I tried the following, but there is no response or update on the media_player.this_device entity.

data:
  media_content_id: 'is bissil vacuum on'
  media_content_type: custom
target:
  entity_id: media_player.this_device
action: media_player.play_media

I am able to control the vacuum through routines, but I would like to know if it is running or not, if possible.

So basically what I think I’m learning here is that if I have additional questions I should probably message Angelo. Yes, I said Angelo, the man with the plan shall provide my needed answers. :rofl: