Echo Devices (Alexa) as Media Player - Testers Needed

Worked like a charm. Thank you!

Finally a chance to give back… I have all my echos announce when a tracked person comes home… using Life360.

I took a highly modular approach… but it works… our ranch is Called ‘WeNoGottaRancho’

You can group your echos…
in your groups file place this

wenogotta_echos:
  name: House Announcement Echos
  entities:
    - media_player.office_echo
    - media_player.family_room_echo
    - media_player.living_room_echo
    - media_player.kitchen_echo

Then is a scipt I have this

aaron_home_announcment:
  alias: Announce Aaron is home
  sequence:
  - data:
      data:
        method: speak
        type: announce
      message: Aaron has arrived home. That's right, daddy's home
      target: group.wenogotta_echos
    service: notify.alexa_media

and in an automation…

- id: '1565972702040'
  alias: Announce Aarons Home
  trigger:
  - entity_id: device_tracker.life360_aaron_pitts
    from: not_home
    platform: state
    to: home
  condition: []
  action:
  - service: script.aaron_home_announcment
1 Like

Again, if you want help, I need the logs enabled for the component and alexapy. Otherwise I’m just guessing what went wrong whether it’s user input or an error in the code.

We do have a method to handle the claimsoption page (e.g. email or sms). However, if Amazon has changed the page, it may have broken. If you provide the post.html page we can see what needs to be changed.

Finally, you can read the FAQ if you want to self diagnose. Be careful though of hammering Amazon’s servers with login attempts as they may throttle you and stop sending you OTP codes for a few hours.

Sorry for being a total noob, but I would like to add Alexa to my Hass.io home assistant. I have home assistant up and running with lights and smart outlets, but now want to add my Alexa devices so I can text to speech. I have read for hours and watched a couple videos but I know that things have changed since Alexa notify. I was wondering what all I would need to install or what to update in my configuration.yaml. Or if there is anything else. Sorry for stupid question but looks like most have it figured out.
Thanks

Here is the applicable (I hope) section of the log…the error shows up when I select (enter) sms or email…both are rejected.

2019-08-27 08:29:44 DEBUG (MainThread) [alexapy.alexalogin] Verification method requested: Authentication required
We will send you a One Time Password (OTP) to authenticate your request.
, Option: sms = As a text message - +1******xxxx.
Option: email = In an email - x**[email protected].

2019-08-27 08:29:44 DEBUG (MainThread) [custom_components.alexa_media] Testing login status: {‘claimspicker_required’: True, ‘claimspicker_message’: ‘Option: sms = As a text message - +1******xxxx.\nOption: email = In an email - x**[email protected].\n’}
2019-08-27 08:29:44 DEBUG (MainThread) [custom_components.alexa_media] Creating configurator to select verification option
2019-08-27 08:30:22 DEBUG (MainThread) [custom_components.alexa_media] Status: {‘claimspicker_required’: True, ‘claimspicker_message’: ‘Option: sms = As a text message - +1******xxxx.\nOption: email = In an email - x**[email protected].\n’} got captcha: w6geea securitycode: None Claimsoption: sms AuthSelectOption: None VerificationCode: None
2019-08-27 08:30:22 DEBUG (MainThread) [alexapy.alexalogin] No valid cookies for log in; using credentials
2019-08-27 08:30:22 DEBUG (MainThread) [alexapy.alexalogin] Loaded last request to https://www.amazon.com/ap/cvf/request?arb=c7cf42eb-f42b-43a1-b10b-0b471447xxxx

The error message is from HA…sms or email are just not acceptable to the OTP page.

One note that might help…when the box is shown for me to select sms or email, the last captcha I entered is shown in the input field. I would have expected the input field to be blank.

Not sure how to get you a copy of the amazon page…it really looks normal and unchanged. The error message is not coming from amazon.

Long thread, couldn’t find an answer to this question. I’ve setup this integration and have used the include_devices flag. It seems to still add all of my devices to HA, but mark the ones I don’t want as unavailable. Is that expected behavior or am I doing something wrong?

  accounts:
    - email: !secret amazon_user
      password: !secret amazon_password
      url: amazon.com
      include_devices: 
        - "Master Bedroom"
        - Kitchen
        - "Master Bathroom"
        - Office

The log is truncated. The component got the sms command but you ended it before I saw whether it was sent to Amazon and before the component identified the next page. Did it display "failed to call service configurator/configure expected string or bytes like object”, I’m not seeing any log entry for that.

Send a private gist with the .html file.

Here.

No, please file a bug. Please confirm your devices are setup in the US region otherwise change your url to match.

1 Like

The log is not truncated…that is the end of the log file…

config entry:

logger:
  default: fatal
  logs:
    custom_components.icloud3: fatal
    custom_components.alexa_media: debug
    alexapy: debug

Did the service error happen? What stage is the configurator in?

The stage…I have entered the capcha correctly and then I get the “enter sms or email pop up”…I enter sms and then confirm and that’s when the service error occurs…and that’s the exact point where I copied the log.

Again…when the enter sms or email pop up appears it contains the last entry I made to the previous capcha window…which seems like it’s an error? If I repeat and try again, that last capcha entry is now gone and the field is blank.

I have tried entering sms “sms” email “email” and none of those get anything but that error message at the bottom of my screen.

I sent you link to full log…rebooted, opened notification, entered capcha, tried to enter sms…got the error message…that’s it.

Alan made a change and I tested it…i was no longer prompted for sms or email…just signed me on. Hopefully, he will add it and update the files for everyone. Note: we really aren’t sure if we solved it or if Amazon stopped requesting to send me a special code…but Alan might want some additional testers.

Next issue/question…the default lovelace card for Alexa has a line to enter “text to speak”. That doesn’t work. Does anyone have an updated card…or managed to get the default card actually speaking through Alexa.

This isn’t critical to my installation, but it’s something that should work.

No, unfortunately not.
I created an input text and used the card lovelace text input row together with a script.
Works great

I have the same issue you had. What change was made to get this working?

This is the card:
image
This is the script:

instant_message:
  sequence:
  - service: notify.alexa_media
    data_template:
       target: '{{ states.input_select.message_target.state }}'
       data:
         type: announce
       message: '{{ states.input_text.text1.state }}'

Input_Text:

input_text:
  text1:
    name: manual_message
    initial: 'Hier den Text eingeben'

the input_select:

  message_target:
    name: Art des Rundrufs
    options:
      - "media_player.unten"
      - "media_player.haus"
    initial: "media_player.haus"
    icon: mdi:speaker-wireless

The lovelace code:

entities:
  - entity: input_text.text1
    name: Alexa Rundruf
    type: 'custom:text-input-row'
  - entity: input_select.message_target
    name: Ziel
  - action_name: Ausführen...
    icon: 'mdi:voice'
    name: ' '
    service: script.instant_message
    type: call-service
type: entities

This is, what it looks like:
image

For the broadcast, I created a speaker group in Alexa called “Haus” and added all speakers to it, which should be used when broadcasting. U can create different groups which all appears as device in HA

1 Like

Just to confirm that the

AttributeError: 'NoneType' object has no attribute 'strip'

error is out again on v2.

EDIT: installing 1.4.1, authenticate and ugrading to v2 worked.

ryry623…it was a code change…Alan sent me a new file for testing that worked. I’m sure he’ll respond quickly.

Do you mind updating the wiki with this example?

The issue is here.

Yes of course…

hmmm, sorry. I’m not familiar with that wiki. I created a page. There are now 10 pages available. But I cannot find it again :relaxed: It seems to be in the nirvana…

Ok I got this to work finally, but was wondering if I can have it just discover certain devices. I don’t need it to add all my bulbs and outlets, Fire TV sticks or tablets. Just would like to add my echo dot identities?
Thanks all

Figured it out, sorry to waist everyone’s time. I removed the alexa media account from yami file and restarted home assistant. Then put in alexa media account but just included the echo devices I wanted.
Thank you for all your work

I was able to remove I think all the entities out using the exclude devices comment, but I still see weird entities like switch.living_room_repeat_switch and switch.living_room_do_not_disturb_switch. I am wondering if this is my plugs or smart bulbs.