Echo Devices (Alexa) as Media Player - Testers Needed

The volume level can be accessed in automations and scripts by filling in the attribute field in a State trigger or condition, or by using a template: {{ state_attr('media_player.echo_dot', 'volume_level')}}

Volume can be set using the media_player.volume_set service.

    - service: media_player.volume_set
      target:
        entity_id: media_player.your_echo
      data:
        volume_level: 0.3
1 Like

This attribute is not present in any of my devices.
That is the reason I asked.

Thanks.

Try reloading the integration from your Settings > Devices & Services > Integrations page. In the past there were issue where the websocket would fail and it would affect receiving info from Amazon including volume level, and reloading would reestablish the connection.

I am still using 3.11.3
This is what happened when I reloaded it…

mac_dms not detected; websocket likely won't connect
5:22:39 AM – (WARNING) /usr/local/lib/python3.9/site-packages/alexapy/alexawebsocket.py
No access token found; falling back to credential login instead of oauth.
5:22:39 AM – (WARNING) /usr/local/lib/python3.9/site-packages/alexapy/alexalogin.py

I will try again when I decide to update.
I have seen people saying reauth is needed on every boot, so I will wait a little more.

Thanks

I think it’s standard stuff for the Alexa Media Player integration. That attribute was created for me automatically.

1 Like

The majority of people experiencing that issue updated without reading or understanding the breaking changes notification. When they updated they did not remove the old alexa_media login configuration from configuration.yaml. The legacy login method has been causing issues for a number of users for a while, so it has been deprecated.

1 Like

At some point my ‘alexa media player’ integration stopped working. I’m using it to announce when the doorbell rings. On the integrations page, it says “Not loaded”. I can’t delete it either. I renamed the authentication file pickle file to .old. I installed all HA updates, I rebooted, I tried removing the integration again… nothing. I tried disabling and then enabling. No change - I can’t delete it. Any tips?

To be honest, the import failure because of the old configuration.yaml is probably a bug that no one has actually reported (i.e., I had intended for that to actually still work but since most people are fine after removing, there’s little incentive to fix it), but otherwise you’re right. A lot of people updated without reviewing the change log. The main issue is that a lot of people had degraded functionality and we never surfaced it so it would sorta “work” and people would randomly complain about stuff not working (i.e., stuff doesn’t update instantly, reminders/timers/alarms didn’t show, etc.).

As of 4.0.x we don’t allow the degraded state so everyone who was sorta working is now being forced to reauthenticate. While there could be an issue with the reauthenticating, I haven’t seen any bug reports that show it’s more than user error yet.

I got it working. My version of alexa media player was on 3.10.15 (if I remember right) and way out of date. I did not realize my hacs integrations have to be manually updated. I updated it via HA ui in hacs and then recreated the 2fa code and it is working now.

I am having this issue regularly… can you please share details of how you recreated the 2fa code?

I am having this issue regularly… can you please share details of how you recreated the 2fa code?

Mine stopped working again and I haven’t had time to dig back into it. I’m guessing it is a different reason this time as to why it stopped working from my previous issue.

Thanks. Confirming that it is the same information I had. After two very long days, I submitted a detailed github request I am unable to re-authenticate alexa_media_player api · Issue #1648 · custom-components/alexa_media_player · GitHub
The sad part is, when it was working it was a true charm. Can you or anyone else provide any guidance?

1 Like

@alandtse & @Didgeridrew

Honestly, I may have been one of the people that missed the notation in the release notes. I went searching and could not find the notation either. can you assist? For the record and comment(s) here is my configuration yaml chunk:

default_config:
#Alexa Media Player
alexa_media:
  accounts:
  - email: !secret amazon_user
    password: !secret amazon_password
    url: amazon.com
alexa:
  smart_home:
    locale: en-US
    endpoint: https://api.amazonalexa.com/v3/events
    client_id: https://pitangui.amazon.com/
    client_secret: xxxxxxxx

Any guidance is greatly appreciated.

You can completely remove the alexa_media: portion. Leave the alexa: heading alone… that’s for your Nabu Casa or Alexa custom skill connection.

default_config:

alexa:
  smart_home:
    locale: en-US
    endpoint: https://api.amazonalexa.com/v3/events
    client_id: https://pitangui.amazon.com/
    client_secret: xxxxxxxx

@Didgeridrew thanks for the response. I have taken your advice and removed the entry(s) from my configuration.yaml Again spending another day and multiple attempts have provided pretty much the same result.
Removing the integration, followed by removing it from HACS. Then Reloading it in HACS, it did not appear available in the search of integrations until I re-added the chunk into configuration.yaml and restarted HA. At that point it appeared in the search. Again, removed the chunk, and restarted HA. It was still avaiable when I searched. Thing being different was that the fields in the form were no longer prefilled. So, at that point, I went in to Amazons Login & Security and removed the 2 Step and started over new. This time creating only the one for HA. Form the log, I was able to see the generated code, and completed the process by butting the 6digit code in the Amazon verification field. Watching the log, I could see that a login was created. However, the same error is repeated that I have been getting for the past three days… Unable to connect to provided Home Assistant url: https://xxxxxx.duckdns.org What I find interesting is thatI can double click the address right from the log and it opens and new login for HA

.
The only other think I fine notable is that beyond the Username and Password, I also have to enter the F2A for HA from my authy app. I wonder if that is what is hosing my Authorization. I have not heard anything from @alandtse in community or from my I am unable to re-authenticate alexa_media_player api · Issue #1648 · custom-components/alexa_media_player · GitHub request for help. Although, I can easily say he is most likely swamped with tickets as 5 more people have added me-too to my request.
Everything else is pretty much the same except the logs…

2022-06-22 11:15:18 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Creating new login
2022-06-22 11:15:18 DEBUG (MainThread) [custom_components.alexa_media.helpers] R****e@M*************t: Returning uuid {'uuid': '3ec5fddfbe094aaa7dd3f696f79ae14c', 'index': 0}
2022-06-22 11:15:18 DEBUG (MainThread) [alexapy.alexalogin] Creating TOTP for 4************************************************G6A
2022-06-22 11:15:18 DEBUG (MainThread) [alexapy.alexalogin] Generating OTP 339205
2022-06-22 11:15:18 DEBUG (MainThread) [alexapy.alexalogin] Login created for R____e@M_________t.net - amazon.com
2022-06-22 11:17:30 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Unable to connect to provided Home Assistant url: https://_____.duckdns.org
2022-06-22 11:27:59 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Using existing login
2022-06-22 11:27:59 DEBUG (MainThread) [alexapy.alexalogin] Creating TOTP for 4************************************************G6A
2022-06-22 11:27:59 DEBUG (MainThread) [alexapy.alexalogin] Generating OTP 645357
2022-06-22 11:30:08 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Unable to connect to provided Home Assistant url: https://_____.duckdns.org

Here is the GUI response


Any ideas?

2 Likes

Does this fix means we can leave it in the config file??

2022-06-27_5-02-24

Yes it does.

1 Like

@alandtse @Didgeridrew
Fortunately, thanks to @alandtse (GitHub)I have my issue resolved.
I have one more very minor issue/question. Following various leads to get where i am now, I enabled DEBUG via the configuration.yaml In the guidance, I removed those lines. Everything is working now, however, The DEBUG is still enabled but no longer necessary.

Des anyone know how to turn Alexa Media DEBUG off via Settings/Devices&Services?
Thanks in advance!

You can do that in the developers view under services. Logger.set_level and under data the the Alexa component you would like to turn off. But in order to do that permanently, you have to set the log level in the configuration yaml as well