Echo Devices (Alexa) as Media Player - Testers Needed

TTS does not work with Amazon Whole House Audio groups (WHA). Use Announce.

1 Like

Thanks, I’ll give that a shot.

I receive the following error intermittently:

ERROR (MainThread) [homeassistant.components.alexa.state_report] Error when sending ChangeReport to Alexa: INVALID_ACCESS_TOKEN_EXCEPTION: Access token is not valid.

Is this a problem or could it be caused by a wifi dropout?

This error is with the built in integration and has nothing to do with the custom component. Notice it says homeassistant.components.alexa.

1 Like

I have exactly the issue you are writing. Would love to see a fix

I’m using the built-in 2FS and it’s been fine until the other day when it threw a reauthenticate warning. Wasn’t sure what to do especially as it had the broken captcha image problem too but noticed there was an update on HACS. Installed that, pre-filled set up window popped up, hit OK, submit or whatever it is and it went straight through without changing anything.

alandtse changed code based on what i said.
so i suppose there is a fix

1 Like

hi, I need some help to understand an alexa behavior.
I have a script which switches the lights according to “last_called_alexa” exposed to alexa which works fine. The issue is, that sometimes the echo in another room reacts instead of the echo next to me. Leads to funny but for my wife annoying situations :slight_smile:

As the light.group entities are also exposed to alexa and are assigned to a room in the alexa app, I tried to say “alexa light in the kitchen off” sitting in the livingroom. That worked. During that time, music was active on my alexa_all_rooms speaker group.
Then I sayed “alexa light in kitchen off” - worked as well.
But after these two calls I found this in the logbook:


Küche ausgeschaltet durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa.PowerController/TurnOff for Küchenlicht durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa.PowerController/TurnOff for Küche durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Gartenleuchten durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Wohnzimmer durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Office durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Fitnessraum durch Home Assistant Cloud
12:29:47 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Küche durch Home Assistant Cloud
12:29:37 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Küchenlicht durch Home Assistant Cloud
12:29:37 - vor 16 Minuten
Küche eingeschaltet durch Home Assistant Cloud
12:29:36 - vor 16 Minuten
Amazon Alexa send command Alexa.PowerController/TurnOn for Küche durch Home Assistant Cloud
12:29:36 - vor 16 Minuten
Amazon Alexa send command Alexa.PowerController/TurnOn for Küchenlicht durch Home Assistant Cloud
12:29:36 - vor 16 Minuten
Amazon Alexa send command Alexa/ReportState for Gästezimmer durch Home Assistant Cloud
12:29:18 - vor 17 Minuten

Question: What does alexa do there? Why sends alexa a report state command to other echos as well?
I’m a little confused and in principle I don’t want to have all these calls in my logbook.

This isn’t from the custom component so you’re in the wrong forum.

Hi All,

I did the following steps:
Installed via HACS
Restarted
Went to Integrations
Added Alexa Media Player
Input: user, password, amazon.co.uk
Next
Added captcha
In the next screen it says:
Amazon will send a push notification per the below message. Please completely respond before continuing.

To continue, approve the notification sent to: MAIL/PHONE

I go on my mail/phone and press approve, then nothing happens in HA…even if I press Submit, the screen still says there.
What can I do?

Enable 2FA.

1 Like

Hi,
I’m using this integration with 2FA since quite some time and it works very well. The only issue I have is that every month or so an Amazon re-authentication is required. But that also somehow triggers a “new password required” process. So I have to change my Amazon password and then re-authenticate this integration. Is there something wrong with my configuration?

Thanks

I also had this, so have removed the integration

I have the normal 2FA, had to do this re-auth every couple days. But didn’t have any “new password required” so far.

This is what I use:

entities:
  - entity: input_select.alexa_state
    name: Select Alexa device
  - entity: input_text.cmd_text
    name: 'Type question/command here:'
    type: 'custom:text-input-row'
  - action_name: Run Command/Ask Question...
    icon: 'mdi:voice'
    name: ' '
    service: script.send_alexa_command
    type: call-service
  - action_name: Stop Alexa
    icon: 'mdi:voice'
    name: ' '
    service: script.stop_alexa_command
    type: call-service
  - entity: input_text.announcement_text
    name: 'Type announcement text here:'
    type: 'custom:text-input-row'
  - type: call-service
    name: ' '
    icon: 'mdi:voice'
    action_name: Announce It...
    service: script.send_alexa_annoucement
type: entities

Screen Shot 2020-12-21 at 4.10.24 PM

I believe all the scripts referenced are from the Alexa Media Player wiki. The “Stop Alexa” button action is nice if you accidentally leave her playing in another room or you can hear a timer going off, you can stop it without having to talk to her and guessing which echo device is playing.

This is my card as shown above…

type: entities
entities:
  - entity: input_select.target_echo
  - entity: input_text.alexa_command
    name: Do...
    type: 'custom:text-input-row'
  - entity: input_text.speak
    name: Say...
    type: 'custom:text-input-row'
title: Alexa commands

Is there any way to shorten the response time after Alexa says ok, till the message is read

Can you share your scripts?

I just wanted to post this in case the open-source code might help with re-authentication.
Back in October, I moved my Alexa TTS from AMP to node-red-contrib-alexa-remote2. It’s been working well.
Well, discovered it has a neat feature that refreshes the account’s login cookies.
Since it’s node red, I have a simple flow that refreshes my Amazon account cookies every 60 minutes. This means I don’t have to re-auth the account.

The function call to refresh the cookie is:

The node is called the "alexa init’ node and the option is “Refresh Cookie”.
Here’s a screenshot:
alexa-remote2 init node, refresh cookie Screen Shot 2020-12-22 at 7.32.51 PM

Maybe someone can reverse-engineer how this Refresh Cookie function talks to Amazon and use a similar approach to help with the re-auth issues here in AMP.
The “Refresh Cookie” running every 60 minutes has been key to my Alexa TTS running reliably since October.

For that node, when you create an account for alexa-remote2 you can use the “File Path” to save the cookie info and it will automatically refresh it. Below is my setting, I never have to re-auth my account.