Echo Devices (Alexa) as Media Player - Testers Needed

Looks great, I do have a question about guard mode. I am in US, and have not enabled guard mode yet because I was waiting for this. But I dont know what to do with it? :slight_smile:

I dont currently have an alarm panel set up, or really know much about that. I do set an input_select to armed away, etc and use that state for a few automations. Not sure where to start, but super exited to play with this.

Thanks as always

I just started Guard mode (In Sweden but with a US account). Open youtube and search for broken glass. Play it and check when you get a alexa notification in your phone. I suppose you can not trigger anything in HA as the state is either armed or not armed. Yoy can however configure Guard in alexa to turn on a light (it could be a dummy sensor light). If you use presence in HA you can start Guard when you leave the house, if guard is triggered it will turn on the dummy light and if this light is on you can send any notifications like MQTT or start your local alarm system. Maybe there are other ways but just starting the Guard mode is Great. Thanks @keatontaylor for all the work.

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