Echo Devices (Alexa) as Media Player - Testers Needed

I generally understand how the Guard mode works with alexa. What I’m curious about it how to use

Does this turn on/off guard mode? Do I need to configure an alarm control panel? I think it’s saying if I have an alarm control panel, I can somehow integrate this to turn off guard mode when I’m home and on when I’m armed_away? I’m just not familiar with the alarm control panel. I don’t have a local security system, but do use my input select as a condition for some of my automations.

It creates the alarm panel for you. it’s separate from any other alarm panel you might have. I just created an automation to turn on Alexa Guard when my other alarm is turned on.

Though i’m having issues with Alexa Guard atm, see https://github.com/keatontaylor/alexa_media_player/issues/230

1 Like

the guard mode functionality exposes a new entity to your HA that allows you to set the state of Guard Mode in your Alexa system by calling the alarm_control_panel.alarm_arm_away/alarm_arm_home/alarm_disarm services with the new alarm_control_panel.alexa_guard_xxxx entity.

(EDITED for truthiness :slightly_smiling_face:…)

alarm_arm_away or alarm_arm_home will turn on Guard Mode. alarm_disarm or alarm_arm_home will turn off Guard Mode

1 Like

New Settings in NodeRed

OLD settings in NodeRed

2 Likes

I believe “alarm_arm_home” will turn off the guard feature (same as disarm).

1 Like

Ooops. Yeah I got that backwards. Thanks for the correction.

I’m running HASSIO version 094.4 in the UK using the amazon.co.uk domain to enable Alexa as a media player, I have followed the installation instructions in the wiki and am using the latest version of alexa media from the github repo and have added the notify option in the configuration.yaml, the media player side works perfectly (i.e I have volume control etc etc) but the announce & tts notifications will not work no matter what I try. I have tried writing a script and using the service call button in homeassistant using these options:

SERVICE: notify.alexa_media

SERVICE DATA:
{ "message":"test", "data":{"type":"announce","method":"speak"}, "target":["media_player.bedroom_alexa"] }
None of my devices will notify me at all. I have gone in to the Alexa app and checked that the announcement option is turned on for every device. Does anyone have any idea what else could be the problem please?

I resolved this issue by adding the repo to HACS as an integration and it just started working. Not sure what the problem was

Hi everybody! first of all thanks for your projects!

I have problems in the installation. I’ve Home Assistant 0.90.2 running in Windows 7, 64bit. I’ve copied the files in the repository master branch in custom_components\alexa_media and put in configuration.yaml the following lines

alexa_media:
accounts:
- email: [email protected]
password: ***********
url: amazon.it

When I launch homeassistant I receive these errors:

File “C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\importli
b_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 724, in exec_module
File “”, line 860, in get_code
File “”, line 791, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “C:\Users\Gianluca\AppData\Roaming.homeassistant\custom_components\alexa
media_init.py”, line 7

^
SyntaxError: invalid syntax

There is something I could try to solve the issue?

Thank you in advance for your support

Just wanted to say that this was a seemless upgrade. I enabled alexa guard, updated the files from the repository manually, and restarted HA, and everything worked. No issues, no errors. Great work. This is probably the most useful component in my HA system.

3 Likes

I second that. The new guard feature is working flawlessly! Thanks @keatontaylor @alandtse!

5 Likes
  1. Please ensure you copy the files using “raw” mode. It sounds like you saved the webpage which causes the syntax error.
  2. Please use the Preformatted Text option so you can quote your configuration and the logs. Otherwise we lose valuable information like the spacing and part of the error messages. You can do this with the menu item or by typing three back ticks ``` on the line before and after the stuff you are pasting in.
1 Like

Thank you for your reply!

  1. This was the issue. I feel so silly! Before, I saved the files with “right click & save” and thought that they were raw copied, but lot of HTML stuff were inside. Now I copied and pasted raw code.

Unfortunately, it seems I still have an issue. Before, HA closed during start-up, now HA start-up is regular, but it prompts a config error in alexa_media and I cannot discover any configuration device. Below again the alexa_media part in the configuration.yaml

alexa_media:
  accounts:
    - email: [email protected]
      password: *****
      url: amazon.it

And below the log in which some lines are related to alexa_media.

2019-06-28 09:42:18 WARNING (MainThread) [homeassistant.loader] You are using a custom component 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-06-28 09:42:21 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=85 from 2019-06-28 07:39:18.911452)
2019-06-28 09:42:22 ERROR (MainThread) [homeassistant.setup] Error during setup of component alexa_media
Traceback (most recent call last):
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\custom_components\alexa_media\__init__.py", line 173, in setup
    from alexapy import AlexaLogin, __version__ as alexapy_version
ModuleNotFoundError: No module named 'alexapy'
2019-06-28 09:42:22 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UPnP/IGD for upnp
Traceback (most recent call last):
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\config_entries.py", line 302, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\components\upnp\__init__.py", line 134, in async_setup_entry
    config_entry.data.get('udn'))
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\components\upnp\__init__.py", line 81, in async_discover_and_construct
    discovery_infos = await Device.async_discover(hass)
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\components\upnp\device.py", line 32, in async_discover
    discovery_infos = await IgdDevice.async_search(source_ip=local_ip)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\async_upnp_client\profiles\profile.py", line 50, in async_search
    await async_search(async_callback=on_response, source_ip=source_ip)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\async_upnp_client\search.py", line 49, in async_search
    transport, _ = await connect
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 1250, in create_datagram_endpoint
    sock, protocol, r_addr, waiter)
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 447, in _make_datagram_transport
    raise NotImplementedError
NotImplementedError
019-06-28 09:42:18 WARNING (MainThread) [homeassistant.loader] You are using a custom component 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-06-28 09:42:21 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=85 from 2019-06-28 07:39:18.911452)
2019-06-28 09:42:22 ERROR (MainThread) [homeassistant.setup] Error during setup of component alexa_media
Traceback (most recent call last):
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\custom_components\alexa_media\__init__.py", line 173, in setup
    from alexapy import AlexaLogin, __version__ as alexapy_version
ModuleNotFoundError: No module named 'alexapy'
2019-06-28 09:42:22 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UPnP/IGD for upnp
Traceback (most recent call last):
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\config_entries.py", line 302, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\components\upnp\__init__.py", line 134, in async_setup_entry
    config_entry.data.get('udn'))
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\components\upnp\__init__.py", line 81, in async_discover_and_construct
    discovery_infos = await Device.async_discover(hass)
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\site-packages\homeassistant\components\upnp\device.py", line 32, in async_discover
    discovery_infos = await IgdDevice.async_search(source_ip=local_ip)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\async_upnp_client\profiles\profile.py", line 50, in async_search
    await async_search(async_callback=on_response, source_ip=source_ip)
  File "C:\Users\Gianluca\AppData\Roaming\.homeassistant\deps\Python37\site-packages\async_upnp_client\search.py", line 49, in async_search
    transport, _ = await connect
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 1250, in create_datagram_endpoint
    sock, protocol, r_addr, waiter)
  File "C:\Users\Gianluca\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 447, in _make_datagram_transport
    raise NotImplementedError
NotImplementedError

  1. Sorry for that I’m a newbie, I hope this time is correct, thank you for teaching me something new!

Just upgraded to 95.1 and getting the following errors

Fri Jun 28 2019 16:31:07 GMT+0100 (British Summer Time)
Error while setting up platform alexa_media
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/alexa_media/alarm_control_panel.py”, line 34, in setup_platform
hass)
File “/config/custom_components/alexa_media/alarm_control_panel.py”, line 73, in init
[‘LambdaBridge_AAA/OnGuardSmartHomeBridgeService’]
KeyError: ‘LambdaBridge_AAA/OnGuardSmartHomeBridgeService’

Anybody getting same issue

A restart of Home Assistant fixed it for me

Yes, I have same problem, the restart doesn’t help.

Same issue. Restart did not fix it. Running 0.95.1 and the latest version of alexa_media_player.

Configure Alexa Guard in Alexa app and restart HA.

1 Like

Thanks for the help, worked like a champ, Kinda crazy that you have to set it up even though you don’t use it. Oh well! Thanks again @Vlad

The error in your logs is saying it can’t find alexapy. Are you running hassio? You may have to restart HA 2-3 times for it to load the dependency or manually load the dependency using pip install alexapy

Yes that’s a bug with a fix in the works.


Question for the masses, anyone have an Echo Show and has the show option ever worked for with the announce notification function and does it still work? This is the silent one that only displays on the Echo Show without speaking. It was reported as a bug, but in doing some debugging I feel like Amazon may have removed the option to only do a display. I can’t find the option in the Alexa app using routines to create just a show variant and thought it used to exist. I don’t have an Echo Show so I’m not sure if the option will only appear if you have a Echo Show.

1 Like