Echo Devices (Alexa) as Media Player - Testers Needed

Hi everyone!

Happy new Year!!!

I have a problem that needs solving and I’m wondering if someone has any idea how to execute it.

Background:
2 people in the house use 4 Alexa speakers independently.
We have different Amazon/Alexa profiles tied to our accounts with our respective personal Spotify accounts tied to them.
Using my (main) account I’ve setup a Family Household and added the 2nd account to the family.
Alexa ties 1 Spotify account per profile.
Using the Spotify App or the Mini Player from Home assistant with this component, I can see and select all 4 of Alexa speakers.
The 2nd family account cannot see any Alexa speakers.
In order to see the Alexa speakers and select them (from Spotify app or Mini Player in Home Assistant) to play music you have to:
a) change to the desired profile with the voice command “Alexa, change to Michael’s profile”
b) then you have to say the voice command “Alexa, play music”
THEN it starts paying Spotify from the correct Spotify account from the speaker you asked and THEN you can go to the Spotify app or Mini Player in Home Assistant and select the track, playlist, album etc you want to listen to.

What we need (Problem):
A way to send the voice commands “Alexa, change to Michael’s profile” and “Alexa, play music” as text commands.

Final Product:
A button (or a dropdown menu) in Lovelace that executes these 2 commands in sequence to the selected Alexa speaker or group of speakers.

Is there any way to do this using this Integration or I’m asking in the wrong place?
Any input would be greatly appreciated as I’m trying to solve this for over a year!

Saying “Alexa, Spotify Connect” also works to expose the Echo device as a Spotify Player for all users in the same Wifi.

So in a script you would call the service like this:

service: media_player.play_media
data:
  media_content_id: spotify connect
  media_content_type: custom
entity_id: media_player.echo_piny

2 Likes

Hi there and welcome!

I did not know that with this command you can expose it as Spotify player!
That’s cool!

So with one voice command you get 2 tasks.

Now all I need is to find a way to send “Alexa, Spotify Connect” command with a text to Alexa so I can make a button of it.

1 Like

Check my EDIT :slight_smile:

1 Like

Oh this is a veeeery good idea!

Let me try this

I do it like this:

- service: media_player.play_media
  data_template:
      entity_id: media_player.your_player
      media_content_id: 'what ever you have to say to alexa'
      media_content_type: custom
1 Like

I just tried this and it doesn’t seem to care :joy::joy::joy:

Tried it with just “next song” and to different Alexa speakers.
They ignore me

Update

Removed the quotes and it worked. silly me.

A big thank you

1 Like

Just tried it from services

Works like a charm!
The only issue is that I get an answer “Open Spotify on the device you’d like to connect from, tap devices available and choose your Alexa device”.

Do you happen to know how to shoosh her? :joy:

Nah, but would be interested in this, too.

Tried setting the volume to zero, but that didn’t work.

1 Like

I have 2 designs atm. Will use both of them to see which fits best (I already prefer 1 click buttons over the drop down menu but I’ll give it some time).

Been messing around with this feedback thing for a while but still haven’t found a good enough solution.

2 Likes

Try this

yeah this fixed it. thank you!

How often do people have to re-authenticate with this module? I’m finding that it seems to be about once a week. I’m using the 2FA and all and I would think it would be a lot longer than that.

Any tips on getting it to last longer?

I had to login every two weeks before I updated to 3.4.5 12 days ago.
Since then no login required. Let’s see the next 4 days

Following the information on the security bulleting below:

I updated HA. Now I get the following message on HACS:

My Alexa Media Player integration looks fine but nothing works. I uninstalled/reinstalled the Add on.

alexa

Are all HACS add ons not working? Thanks for the info!

Hi all, I noticed that an entity (alexa app) is currently unavailable. It was good to have this entity because i could send notification directly to app. I tried to uninstall / reinstall component but no changes. Does anyone know hot to get the entity working again?

Hello all,
i noticed that the notify device is missing. I tried to uninstall and install the repository , the integration etc but without results. Also tried to manualy delete the .pickle file. Can anyone help ?

Hey @alandtse, thanks a bunch for the update. I’m finally back in with the legacy mode :slight_smile:

I would also appreciate any guidance on this. Is constant reauthorization unavoidable and should be expected? Is it completely unpredictable or is there something that triggers it? Is it just the nature of how amazon services work? Is there a suggested way we should be logging in?

It’s based on Amazon deciding to force you to reauth. We’re mimicking Amazon official apps but Amazon can decide they don’t want unofficial apps and cut us off whenever. In other words, it’s a game of cat and mouse until Amazon gets serious and purposely blocks the component. Then we’re done.

In the short term, you can use the oauth token method (>3.4.8), which mimics the Amazon mobile apps. This was switched to because other efforts at accessing Amazon have indicated it avoids reauths; but who knows if it’s true. We have a survey for people who want to crunch the data. Frankly, I don’t see reauth requirements more than monthly so I’m just guessing why people do.

You can also use the built in 2FA key generator so the component can try to relog in if it’s logged out. Obviously it can’t relog in if you get a Captcha or some other anti-automation countermeasure but using 2FA avoids the captcha in most cases.

Lastly, you can convince Amazon to open an official API to do everything their official apps do. I mean, you are paying fo the device. I leave it to the audience to decide if mentioning the unofficial components like AMP is helpful or will just get those components blocked faster.

It’s almost impossible to help you given the level of information you’ve provided. You can open up an issue and maybe I can help you with more info.

This was removed as they were not media players you could control and people were complaining the media player didn’t work. If you can identify the specific functionality you need from them, then I can see if we can enable it somehow in a way that I don’t get complaints about it.

This isn’t the right forum for HACS questions. However, you may have to manually update to HACS 1.10.0.

The changes to HA had no impact on this component.

1 Like