Echo Devices (Alexa) as Media Player - Testers Needed

2.2.1 is out.

Two bug fixes of note:

  1. We have fixed the ConnectionReset errors where it worked until you did a restart. At this point I think all the weird issues we got by moving async should be gone? I don’t think you’ll need to go to 1.4.1, but . . .*
  2. Media state updates broke somehow and are now fixed.

Also I went ahead and updated switches so they have a relevant icon and also properly go unavailable if you’re in a state where they won’t do anything (i.e., no queue to manipulate).

Please note if clicking configure on the integrations page doesn’t work for you with an imported configuration.yaml, you can manually add your integration as a workaround. There is a fix that is staged but wasn’t released yet.

For those on hassio, you may have to restart 2-3 times before HA will load the dependencies. HACS will solve this problem too. You should really be on HACS. Why aren’t you on HACS?

*While you shouldn’t need 1.4.1 any more, please note you can edit options in HACS 14.x to view more than 5 releases by changing the Integration Options.

Finally, want to thank some people for helping provide translations or debugging with me as I tried multiple theories for the ConnectionReset issues:

Fix

  • bump alexapy to 1.2.1 (f6da0d0) (fixes #369)
  • add retries to setup_config entries (0d68043) (fixes #362, fixes #354)
  • disable update before add to avoid warning on disabled entities (bbede43) (fixes #317)
  • add relevant icons to switches (a66364d)
  • add availability state to switches (fd44b7c)
  • fix handling of filter options (1a53b98)

Full changelog.

As always, please use the the Wiki and FAQ if you need instructions or have questions. Also, please help in documenting features in the wiki since this thread is basically unsearchable now. We also use GitHub for bug reports/feature requests .

2 Likes

Im confused about the best way to exclude/remove entities without using configuration.yaml. I removed some devices using the entity registry and now have an empty box.

So How would I get rid of Tracys Alexa Apps? I’m showing everywhere since I’ll try any tips on that next.

Also are the shuffle and repeat switches always going to show unavailble unless I’m playing music? I have an automation that checks for unavailable devices so I know if stuff stops working, and this really screws that up.

Otherwise, great work, this is probably one of my favorite integrations.

That is probably an issue to raise with HA as it’s an interaction between the device_registry and entity_registry. In truth, they probably need to add some of the features for the entity_registry to the integrations page so you can control entities from there. The integrations page is showing you the devices that have multiple entities under it. Perhaps one solution for HA to implement is to hide or minimize a device that has all it’s entities disabled.

Alternatively, if you use the exclude_devices filter during integration setup by entering Tracey's Alexa Apps,Everywhere (notice no spaces and case sensitive), it should avoid creating the device/entities entirely.

Yes; per the entity states documentation, this is supposed to be the behavior if the entity becomes uncontrollable which happens if the music queue disappears. You may need to update your automations to allow ignores as I think other entities may end up doing this. (Not unsympathetic as I use your lock package so appreciate your mastery of automations).

We could try to expose an option on how to treat switches when unavailable but likely lower priority than some of the feature requests I’ve been sitting on for months (e.g., alarms, shopping list) :sweat:. Perhaps we can add the option to hide them and then you can use the hidden property to choose to ignore it.

1 Like

How do you do that? Maybe since mine was already in the configuration.yaml when I started it was not an option? Either way, what are the steps to exclude items

Remove the integration and manually readd it. You’ll see the option there.

1 Like

What about multiroom volume control? Is it possible to have many echos grouped together and then have a ”master” volume control that controls all echos? Like this guy did: Alexa master volume control
Also with better fine tuning possibilitys for the volume controls.

Also, is it possible to change which echo that should be playing music?
Like a button for each echo to be activated?

Would be really great for multiroom useage!

You can create a group of devices in the alexa app and add the echos you want.
This group will be automatically shown in HASS as media_player.
Try to raise or decreas volume like for all other devices.
That’s what I would do.

Did I miss something in the update with 2.2.1? I often get notifications in HACS when I update an integration that I may need to reconfigure. I also glanced at the change log when I updated and didn’t see anything that looked major. However when my alarm didn’t go off this morning I checked the logs and saw that HA could not find notify.alexa_media. I found this forum post which then alerted me to the fact that I would have to reconfigure the integration, which did indeed go without a hitch.

Hi all,

the configuration form is empty. Any advice please?

HA: 0.97.2
Alexa_media: 2.2.1

Logs:
grep alexa home-assistant.log | less

2019-09-24 10:50:12 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for alexa_media which has not been tested by Home Assistant. This component might cause stability problems
, be sure to disable it if you do experience issues with Home Assistant.
2019-09-24 10:50:15 DEBUG (MainThread) [homeassistant.bootstrap] Setting up {'device_tracker', 'tplink', 'hue', 'onboarding', 'cloud', 'ssdp', 'tts', 'input_boolean', 'logbook', 'zone', 'input_datetime', '
frontend', 'script', 'websocket_api', 'person', 'lovelace', 'config', 'sensor', 'system_health', 'met', 'webhook', 'history', 'vacuum', 'sun', 'updater', 'tuya', 'auth', 'automation', 'duckdns', 'group', '
alexa_media', 'default_config', 'http', 'zeroconf', 'mobile_app', 'api', 'map'}
2019-09-24 10:50:17 INFO (MainThread) [homeassistant.setup] Setting up alexa_media
2019-09-24 10:50:17 INFO (MainThread) [homeassistant.setup] Setup of domain alexa_media took 0.0 seconds.
2019-09-24 10:50:17 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=alexa_media>
2019-09-24 10:50:17 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Creating new login
2019-09-24 10:50:17 DEBUG (MainThread) [alexapy.alexalogin] Trying to load pickled cookie from file /home/homeassistant/.homeassistant/[email protected]
2019-09-24 10:50:18 DEBUG (MainThread) [alexapy.alexalogin] cookie loaded: <class 'dict'> {'session-id': '260-3434880-8246605', 'session-id-time': '2197537201l', 'ubid-acbde': '262-1885261-7052166', 'sessi
on-token': 'YY1Whb6Bye5o6EZW3qwoxCiU7sDEVp1lO7b4tPFoGZ+MRiTWraEfWoUFSUt5A+cM5GTCwPbmCRoBdzsLGwp7EDEZTj/MsBZpWr590mmg6DsDMGZj9MjtM8LEtkRMsJLpaPPACDknCifkIE+qMPfZGMqGwkWU4tg/j25eQwh7ekKnslmdpJ4ac2sXJkjQcvTwx
taRByiEJmIejx7pgR78N6SfRINU8KUO1MtXdYkwrno=', 'x-acbde': 'ic93wP3hoyKhJXZXmgs0mnbUXsUft7XK4ze@@GQ5lJ?xwhDtLaoAl1P7vBz4WVTl', 'at-acbde': 'Atza|IwEBIC0DERRmhMwvGN8xwiUnzWvwq3Y44FFC8H3utjRqqJ9spWsgJxvonPEXXd
woKC0mJnQzb1UE8QbzYzE0r64TNbk-wela2pEwRwu0CpkW10jTtb_m325B4KPZDF0wCWvtzAZ_7X8eoW4E9187ZYU-463QMhVF1BG9AdyNMHsVdvnCorVet10kq1XW2HfWDmRjLorKkebT4Tt1XE4hqoCgd5GEAN9e1_ya0EnajvWc3G0i9su_EwoEEbENyydgRCL-ts8gkVI
ILoNvf1dWnB08B-SpZ_-K0N_ecEuzPSEggr1f_9pJvMW-VxCXlloFpW5bLqJw0c5FyxTGuBmqqnmJahLL3feCK37pfhs5ZXGZa7WXQ2SCitm4uHOR1VOoIGmYSdZSWCBWYo0LIJNny8DI-mjw', 'sess-at-acbde': 'AqKzEQ5i1GsUwd7hL3LQrpwhFDhY5ojw6LBXtKN
X6n4=', 'sst-acbde': 'Sst1|PQHmkMQztRx_4Wun6I4H1aRBC7YVjV7hl0iAoVbiJP3Pe50OvuvBO-XBSIQEheQtIdff6k2SvUUZKxj2vSxsbx4h9egC8kzn2BqD7omRjX23Yz6nFjzFxqDKJk9uQo9k4J-Ii_5XKbGSVbj2II4Ijb1RchwxR58L3uf_kYoZXGs5lol8YN
m0sunLYVtpmeav0k5XgIniSVbsxmhEYg8EX-HyMUI-xdsBNkl4ljBs9r1uPJn4O6nA6-X6e2_TYXuMReruWvEK8mula4jKjby4X-hZ9H7WHSBFAWoduh0bCwIIvUa5c4PidjQgYtpexWlwL-rwUtqwKNzq7ZgscCh8t3WxkQ', 'csrf': '568438813'}
2019-09-24 10:50:20 DEBUG (MainThread) [alexapy.alexalogin] Found dict cookie
2019-09-24 10:50:20 DEBUG (MainThread) [alexapy.alexalogin] Loaded 9 cookies
2019-09-24 10:50:22 DEBUG (MainThread) [alexapy.alexalogin] GET: redirected from
https://alexa.amazon.de/api/bootstrap
2019-09-24 10:50:22 DEBUG (MainThread) [alexapy.alexalogin] GET:
https://www.amazon.de/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.de/api/bootstrap&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee
_de&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0& with
2019-09-24 10:50:22 DEBUG (MainThread) [alexapy.alexalogin] Not logged in: An exception of type ContentTypeError occurred. Arguments:
2019-09-24 10:50:22 DEBUG (MainThread) [alexapy.alexalogin] No valid cookies for log in; using credentials
2019-09-24 10:50:23 DEBUG (MainThread) [alexapy.alexalogin] GET: redirected from
https://alexa.amazon.de
2019-09-24 10:50:23 DEBUG (MainThread) [alexapy.alexalogin] GET:
https://www.amazon.de/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.de/&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee_de&openid.mo
de=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0& with
<CIMultiDictProxy('Host': 'www.amazon.de', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', 'Accept': 'text/html,applicati
on/xhtml+xml, application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': '*', 'Referer': 'https://www.amazon.de/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.de/api/bootstrap&openid.identity=http:/
/specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee_de&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&', 'Accept-Encoding': 'gzip, deflate', 'Cookie': 'session-token="Bc+yuSiMMeXt0viKO37PRYI+5JVQnTjQOV8V924WLiIKVZilTNcAY7/Ot2qAIWY9/wylx5wvpP4bj+oLu/5WNVAbLmd6IZWNkbtj/99R6Gx3VN/r4BkzmUsxpwKoOMB9p356uW9ayRzPemKmRmyllQ8822SdXrCbZwhtFN4u4P4z8hRNCs+wpzde2OUrZi3aFSWHQhxK3Hh4ufrQbhU/vwEBKsmPmxUOslj+wiSYmH4="; ubid-acbde=262-1885261-7052166')>
2019-09-24 10:50:23 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.de/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.de/&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee_de&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&
2019-09-24 10:50:23 DEBUG (MainThread) [alexapy.alexalogin] Found standard login page
2019-09-24 10:50:23 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.de/ap/signin
2019-09-24 10:50:23 DEBUG (MainThread) [alexapy.alexalogin] Preparing post to https://www.amazon.de/ap/signin Captcha: None SecurityCode: None Claimsoption: None  AuthSelectOption: None VerificationCode: None
2019-09-24 10:50:24 DEBUG (MainThread) [alexapy.alexalogin] POST:
<CIMultiDictProxy('Host': 'www.amazon.de', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml, application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': '*', 'Referer': 'https://www.amazon.de/ap/signin?showRmrMe=1&openid.return_to=https://alexa.amazon.de/&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=amzn_dp_project_dee_de&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&', 'Accept-Encoding': 'gzip, deflate', 'Cookie': 'session-id=259-0378558-4932951; session-id-time=2200035022l; session-token="Bc+yuSiMMeXt0viKO37PRYI+5JVQnTjQOV8V924WLiIKVZilTNcAY7/Ot2qAIWY9/wylx5wvpP4bj+oLu/5WNVAbLmd6IZWNkbtj/99R6Gx3VN/r4BkzmUsxpwKoOMB9p356uW9ayRzPemKmRmyllQ8822SdXrCbZwhtFN4u4P4z8hRNCs+wpzde2OUrZi3aFSWHQhxK3Hh4ufrQbhU/vwEBKsmPmxUOslj+wiSYmH4="; ubid-acbde=262-1885261-7052166', 'Content-Length': '749', 'Content-Type': 'application/x-www-form-urlencoded')>
2019-09-24 10:50:24 DEBUG (MainThread) [alexapy.alexalogin] Processing https://www.amazon.de/ap/signin
2019-09-24 10:50:24 DEBUG (MainThread) [alexapy.alexalogin] Error message: Wichtige Mitteilung!
2019-09-24 10:50:24 DEBUG (MainThread) [alexapy.alexalogin] Captcha requested
2019-09-24 10:50:24 DEBUG (MainThread) [alexapy.alexalogin] Found post url to https://www.amazon.de/ap/signin
2019-09-24 10:50:24 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Testing login status: {'error_message': 'Wichtige Mitteilung!\n            Zum besseren Schutz Ihres Kontos geben Sie bitte nochmals Ihr Passwort ein, und geben Sie dann die Zeichen ein, die in der Abbildung unten gezeigt werden.\n          ', 'captcha_required': True, 'captcha_image_url': 'https://opfcaptcha-prod.s3.amazonaws.com/5d84f354069f4e8191d2f8c7b969f1a9.jpg?AWSAccessKeyId=AKIA5WBBRBBB3EQNKAH5&Expires=1569315324&Signature=PStIlrKD86kKCCc8L6HJjJ5G%2F1U%3D'}
2019-09-24 10:50:24 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Creating config_flow to request captcha
2019-09-24 10:50:24 DEBUG (MainThread) [custom_components.alexa_media.config_flow] show_form captcha {'email': '[email protected]', 'url': 'amazon.de', 'captcha_image': '[![captcha](https://opfcaptcha-prod.s3.amazonaws.com/5d84f354069f4e8191d2f8c7b969f1a9.jpg?AWSAccessKeyId=AKIA5WBBRBBB3EQNKAH5&Expires=1569315324&Signature=PStIlrKD86kKCCc8L6HJjJ5G%2F1U%3D)](https://opfcaptcha-prod.s3.amazonaws.com/5d84f354069f4e8191d2f8c7b969f1a9.jpg?AWSAccessKeyId=AKIA5WBBRBBB3EQNKAH5&Expires=1569315324&Signature=PStIlrKD86kKCCc8L6HJjJ5G%2F1U%3D)', 'message': '\n> Wichtige Mitteilung!\n            Zum besseren Schutz Ihres Kontos geben Sie bitte nochmals Ihr Passwort ein, und geben Sie dann die Zeichen ein, die in der Abbildung unten gezeigt werden.\n          '} {} OrderedDict([('password', <class 'str'>), ('captcha', <class 'str'>)])

Thanks! That is one way to go, unfortunately that way is not really what I would like as this group volume will change all volumes to the same level. I would like all echos to change volume with same volume difference.

If I have for example my echos at volume 2, 5 and 7, changing master volume one step would change all to 3,6 and 8…

Also a more fine tuning volume would be nice, like 1-100 instead of 1-10 steps. Thats what this guy did with his script: Alexa master volume control

So I guess it would be possible to integrate with this excellent Echo plugin! :slight_smile:

Hello guys.

Since a week ago I worked with Alexa Media Player installed manually (I think?), then I switched on HACS with the release of 2.2.0 and I’ve also (few days ago, with the launch of 2.2.0) removed the configuration lines and went with the integration which worked perfectly.

However, this morning my Home Assistant is stuck with the “Loading data” message and the log says 2019-09-24 12:45:42 WARNING (MainThread) [homeassistant.components.switch] Setup of platform alexa_media is taking over 10 seconds..

I didn’t change anything and I’m sure it auto-updated the component during the night, causing now this issue. I’ve no idea how to deactivate the integration via ssh since it’s not in my configuration anymore. Any suggestions?

Thanks

EDIT: Okay, I restarted the whole Raspberry and now everything works fine. I did restart home assistant multiple times prior to this, and it wasn’t working…
I’ll leave this message here, with the risk of seeming like an idiot: it still may be useful for someone (and I would also be interested in knowing which was the problem anyway…)

Hi All,

What is de maximum length of text that can be pushed to Alexa ?
And is it possible to use “title” as well?
“volume_level”, “type” I know. but what else then this can you use?

You can easily make this your own. Just create a new Input_number (slide) and connect it (using my formula) to the volume controls from the single entities in the group.

FYI: If you are using Spotify, just change the volume with the Spotify mediaplayer. It uses the same logic of volume management.

Sadly setting the exposed group of the Plugin to a volume will instantly set all entities in the Group to this same Volume Level. But as far as i know, this is inline with how Echo works in the App.

Sorry, I have no solution for that

I don’t know the maximum length, but I do have an automation that cycles through all my devices looking for those that are on or open and builds up a “message” string of all those devices (and this string can get rather large), and pushes it to Alexa using notify.alexa and tts. Alexa has not had any issue with this.

2.2.1 might fix that issue

Refresh your browser cache.

This might be a bit offtopic, sorry about that.

But is it possible to trigger Alexa ask a question, for example “Do you want to turn on the tv?”, and act based on my answer?

I have this done with follow part in configuration.yaml

smart_home:
  endpoint: https://api.eu.amazonalexa.com/v3/events
  client_id: !secret alexa_client_id
  client_secret: !secret alexa_client_secret
  filter:
    include_entities:
      - light.livingroom_all
      - light.dressoir_all
      - light.hallway
      - light.balcony
      - light.kitchen_all

Follow the tutorial on this page:

2.3.0 is out.

Two features in this release:

  1. Notifications are now exposed as sensors. This means you can see upcoming alarms, timers, and reminders. For those of you who understand templates, share anything you create on the Wiki!
  2. We have a clear_history service to delete voice history (thanks to macbury who submitted this months ago and I finally added it). Use at your own risk since there isn’t an undo. Also read the warning in the docs if you’re using last_called sensors while deleting history.

Also added fixes for the integrations page and added additional logic to catch expired logins. As that’s hard to test, I’ll need logs if it doesn’t work for you.

You should really be on HACS. *While you shouldn’t need 1.4.1 any more, please note you can edit options in HACS 14.x to view more than 5 releases by changing the Integration Options.

Feature

  • add clear_history service (ecbc8b6)
  • add logic to catch login errors (6633598)
  • add basic notifications sensors (465b2ca) (resolves #144)

Fix

  • update to alexapy 1.3.0 (64c5d8f) (fixes #387)
  • catch connection errors in config_flow and inform user (ef06760)
  • prompt for login on disconnect (cb3a8fb)
  • fix bug where unable to relogin using configurator (81a7127)
  • fix bug where import configuration not resumed (6579b6f)

Full changelog.

As always, please use the the Wiki and FAQ if you need instructions or have questions. Also, please help in documenting features in the wiki since this thread is basically unsearchable now. We also use GitHub for bug reports/feature requests .

1 Like