Echo Devices (Alexa) as Media Player - Testers Needed

Again, please open an issue so I can help you there. Please fill out the template and also let me know what domain you’re using.

For comparison, this is what the OTP screen should look like so you’re in a weird state where I’ll need to get some logs probably. If you don’t want to debug and just want to log in, you can disable the proxy. However, I’ll probably discontinue the legacy login methods at some point in the future.

Regarding the state of success since 3.4.8 and the last login request
Since 28 Days no new relog request appeared. Before it was around every 10 days.
Seems that the new oauth procedure works.
Thanks @alantse

Updated to V3.8.1
On the first restart it’s asking me to re-authenticate
“Relogin required after 3:03:20.301703 and 201 api calls.”

When I click on reconfigure, it won’t let me move past the first page. The submit button just reloads the same window over and over again.

After removing the integration and re-installing, I still cannot get past the first page.
Now I get a message “Email for Alexa URL already registered” when I click submit

Do you have it in your configuration.yaml? It will auto load from that. Delete that.

Hey all,

Alexa media centre automation, play flash briefing, then play music.

Here is my automation (scripts work) but flash briefing does not change the entity state and music never starts after the flash briefing, it just remains “standby” But! If I take out the “wait for trigger” the music will just roll over the flash briefing after a second.

Any ideas what the proper trigger should be? Should flash briefings have a state other then standby?

Thanks

alias: 'Motion: Morning'
description: ''
trigger:
  - type: motion
    platform: device
    device_id: id
    entity_id: binary_sensor.bathroom_motion_sensor_motion
    domain: binary_sensor
condition:
  - condition: template
    value_template: >-
      {{ ((as_timestamp(now()) | float) -
      (as_timestamp(state_attr('automation.go_to_sleep','last_triggered')) |
      default(0) | float)) > 36000.0 }}
  - condition: time
    after: '07:00'
    before: '11:00'
action:
  - service: script.alexa_flash_briefing_volume
    data: {}
  - service: script.play_flash_briefing
    data: {}
  - wait_for_trigger:
      - platform: state
        entity_id: media_player.bathroom
        to: standby
  - service: script.play_music_bathroom
    data: {}
mode: single

I just tried to configure this but I can’t get past the logon screen - when submitting the credentials I get the error message: “Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General”.

The URL i am using is https://smart.home.mydomain which is reachable from inside my network and outside (split dns setup) and the certificates are valid as well (wouldn’t be able to access HA otherwise since I’ve configured my domain to use HSTS).

I don’t have the Internal URL configured under Configuration -> General, and this component works for me.

For some reason I have to re-auth often, every couple of weeks. I noticed that in my logs, I have this:

Logger: alexapy.alexalogin
Source: /usr/local/lib/python3.8/site-packages/alexapy/alexalogin.py:696
First occurred: February 17, 2021, 7:05:32 AM (2 occurrences)
Last logged: February 17, 2021, 7:10:17 AM

No access token found; falling back to credential login instead of oauth.

What do I have to do to fix this so it just stays connected better? I’m always having to mess with it and I’m not sure what I’m doing wrong. Thank you - love this app when it stays connected! :slight_smile:

1 Like

I’ll add to liminal above…
What I find, is when an alexa device is in the standby state, if I use the media_player.play_media for media_type: custom (which I understand is emulating a voice command), the media player stays in the standby state even though media is playing on the device. If I were to do similar but instead of using custom, use TUNEIN then the alexa device’s state will change to Playing. I’m not sure why, just my observation.

The HA server will attempt to connect to the url you have provided. if it can’t, it will get the message you mentioned. Please verify it can. If you’ve verified, you can open up a new issue and we can try to see why it’s failing. The other alternative is to disable the login proxy.

Remove and readd and make sure the oauth token option is checked. It’s the new default but we’ve left the old option in place in case you can’t log in using the new method.

I am experiencing a weird issue with authentication. Amazon locked me out of my account, and I was able to change the email in the proper file in .storage, however I now have two integrations, and one will not let me reconfigure.
Screenshot 2021-02-21 121024

Any ideas? I would uninstall but there is no option!

You shouldn’t edit .storage because it can put you in a weird state if you do it wrong. Delete the entry in your configuration.yaml.

Unfortunately, I don’t have an entry in my config.yaml

Then uninstall it on the integrations page. The reconfigure dialogue will disappear on reboot if both integrations are removed.

That did the trick, everything is back up and running :slight_smile:

NOTE: I posted this on the AMP github page, but I thought I might get more traction here.


From: Home Assistant -> Developer Tools -> Service

I enter:

Service: media_player.play_media
entity_id: media_player.my_echo_show
media_content_id: 'what time is it?'
media_content_type: custom

When I click “CALL SERVICE” nothing happens. I.e., I am sitting next to the echo show and it is silent. The “CALL SERVICE” button flashes green, indicating the service is called OK.

With DEBUG logging on, the only relevant message in the log is:

2021-02-23 06:20:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140562015356528] Received {'type': 'call_service', 'domain': 'media_player', 'service': 'play_media', 'service_data': {'entity_id': 'media_player.my_echo_show', 'media_content_id': 'what time is it', 'media_content_type': 'custom'}, 'id': 168}

I also ran:

Service: media_player.play_media
entity_id: media_player.my_echo_show
media_content_id: shuffle greenday
media_content_type: SPOTIFY

and it worked just fine (started playing Green Day). I assume that means I am properly authenticated.

I am running “Alexa Media Player” v3.8.2 on HomeAssistant v2021.2.1

Alexa Media Player was installed using HACS Integrations (using 2FA) and my yaml files have no mention of alexa.

What can I do to troubleshoot this?

Thanks!

P.S. I plan to run:

media_content_id: 'open firefox'

which should work, right? …although I tried that also and it did nothing.

Your “what time is it?” config service call looks correct and I just tried this on my echo (not a show) and it works. Maybe take a look at your Alexa App’s Activitiy-> Voice History to see if it saw anything.

Thank you for the suggestion re: Voice History. I was not aware of it… However, regretfully, my “what time is it” query does not show up there, although I tried repeatedly again just now. My “shuffle greenday” attempt DID show up in Voice History, but nothing using media_content_type: custom. Any further suggestions are welcome!

I found the problem! I discovered the solution filling out the issue template on github (which I had failed to do in the first place - live and learn…)

In filling out the template, it asked for my version of alexapy, which I then discovered, I do not have the current cersion 1.24.2. (I had 1.16 installed). I used HACS to install Alexa Media Player, and I encountered no mention of alexapy. Is a HACS installation supposed to upgrade alexapy?

In any case, I removed my old version of alexapy and reinstalled alexa media player, and it now works!