Echo Devices (Alexa) as Media Player - Testers Needed

I’ll try it tonight. I was trying on 88.2.

that sounds like a good idea, I was about to try this but my problems just got alot bigger …
on restarting, my pi did not want to restart again. It’s dead! Not a total surprise, the signs were there.
Luckily I did a back up pre-HA update so I’ll start a fresh install. Maybe it’s time to upgrade to a NUC
Thanks for all the tips, I’ll get HA back up and I’m sure all will be fine. I’ll set up SSH though, always handy to have.

How to see if the installed alexapy is the correct one? Is there a command to know this?

I can’t seem to figure out the syntax for using the notify announce feature in an automation.

Here is the automation that i attempted to modify from a formerly working one to the new syntax:

- alias: Notification Test Weekly TTS
  initial_state: 'on'
  trigger:
    platform: time
    at: '12:15:00'
  condition:
    condition: time
    weekday:
      - wed
  action:
    - service: notify.alexa_media
      target: 
        - media_player.computer_room_dot
      type: announce 
      message: "This is a weekly test of the announcing system."

Here is the error I get:

“Invalid config for [automation]: [target] is an invalid option for [automation]. Check: automation->action->0->target. (See /config/configuration.yaml, line 457). Please check the docs at https://home-assistant.io/components/automation/

I tried to change the action to this and it passes the config check but it then gets errors when I trigger it manually:

  action:
    - service: notify.alexa_media
      data:
        target: 
          - media_player.computer_room_dot
        type: announce 
        message: "This is a weekly test of the announcing system."

and here is the error:

2019-03-13 14:29:16 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.notification_test_weekly_tts. Invalid data for call_service at pos 1: extra keys not allowed @ data['type']

If I call the notify manually from the dev service page using the json syntax from the example page on the github it works fine.

Does anyone have an example of a good working notification announcement used in an automation?

I run hassio on a raspberry pi 3b+ and everything’s fine.

alexa_test_announce:
  sequence:
    - service: notify.alexa_media
      data:
        target: media_player.yourecho
        #title: My title for Echo show
        message: "Test"
        data:
          type: announce
          method: all # or speak or show
1 Like

Ah, thanks. I see I missed the second “data:”. It passed and worked! :grinning:

pip list | grep alexapy

pip3 list | grep alexapy

I get this:

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

I just verified Hassio replaces the homeassistant docker container on upgrade, removing alexapy.

I just went from 0.89.1 to 0.89.2 and need to reinstall alexapy.

In this case, how come that I don’t have it installed and all is working fine in the alexa_media and notify_alexa?

2 Likes

When I first installed it , I had log error. Possibly only used for the captcha?

I am working on testing the functionality now after I reinstalled alexapy. I never tested this before.

I don’t use hassio but I use docker and when I update HA it destroys the container and rebuilds it and I’ve never had to manually load alexapy.

Raspi back up and the component is working, notify seems to be working well too

1 Like

I’m on Hassio 0.89.1 and version 1.2.1
Routine doesn’t trigger if there’s more then 1 emulated_hue lights in them. I can have an endless amount of actions set in the routine, but it only triggers if there is not more then 1 emulated_hue switch.
Log:

Wed Mar 13 2019 23:22:04 GMT+0100 (Midden-Europese standaardtijd)
'operationPayload'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1133, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1155, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 188, in handle_service
    self._platforms.values(), func, call, service_name
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 278, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 294, in _handle_service_platform_call
    await func(entity, data)
  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/media_player.py", line 586, in play_media
    self.alexa_api.run_routine(media_id)
  File "/config/deps/lib/python3.7/site-packages/alexapy/alexaapi.py", line 149, in run_routine
    ['deviceType']) = self._device._device_type
KeyError: 'operationPayload'

Did someone else encounter this?

Just an fyi:

I’m using hassio on a pi. Upgraded to 0.89.1. Then upgraded this component to 1.2.0. Everything works. I’m really confused on why people using hassio are having to manually install or update alexapy.

Going to watch this thread for a while before going to HA 0.89.2 and 1.2.1 of this component.

On Hassio 0.89.1 I had the log error that alexapy was missing and indeed it was not in the hassio container on my Raspian installation. After I updated to 0.89.2 I noticed the plugin was missing so I reinstalled.
I did not get a chance to test on 0.89.1 but it works on 0.89.2.

The wiki lists a media_player.alexa service but I just have media_player.alexa_tts
I was hoping to use this to trigger alexa routines controlling my Amazon plug.

Assuming the email is correct, that’s normal behavior if you’ve logged in successfully before. I may be missing context on the question though.

That’s a bug. Please file an issue and I can look into it. I may need more logs though. It only happens with emulated hues and not other items? Does it work if you run the Routine with the Alexa App?

Assuming you don’t use announce, you’ll be fine at 1.2.0. We fixed a pretty silly bug to get to 1.2.1.

I actually don’t know how hass.io’s behavior so I’m also curious to understand why sometimes it’s installing alexapy or not. If people are using custom_updater to update alexa_media, I know that forces an install of the dependency. Maybe that’s the difference.

In a venv, my experience is HA will load components_component dependencies automatically. Maybe it’s trying in hass.io and has a bug?

That’s a typo. It should be media_player.alexa_tts. However, that will be deprecated in 1.3.x in favor of the notification component so you should switch to that formulation moving forward.

1 Like

Oh ok. I did use custom_updater to update alexa_media. Maybe that IS why I had no issues.