Echo Devices (Alexa) as Media Player - Testers Needed

Same error here.

v.1.3.1 fro HACS

HASSIO ver 0.96.5

Hello,
with the new Update i can not get an output from sensor attributes. tts text and sensor output is working, only attributes output. anyone with the same issues?

Here is my Code:

- id: 'XXX'
  alias: (Wetter) Sturmwarnung
  trigger:
  - entity_id: sensor.dwd_weather_warnings_current_warning_level
    platform: state
    to: '1'
  - entity_id: sensor.dwd_weather_warnings_current_warning_level
    platform: state
    to: '2'
  - entity_id: sensor.dwd_weather_warnings_current_warning_level
    platform: state
    to: '3'
  - entity_id: sensor.dwd_weather_warnings_current_warning_level
    platform: state
    to: '4'
  - entity_id: sensor.dwd_weather_warnings_current_warning_level
    platform: state
    to: '20'
  - entity_id: sensor.dwd_weather_warnings_current_warning_level
    platform: state
    to: '10'
  condition:
  - after: 07:00
    before: '22:00'
    condition: time
  - condition: state
    entity_id: group.alltrackdevices
    state: home
  action:
    service: notify.alexa_media
  - data_template:
      data:
        type: tts
      target: media_player.alexa_1
      message: Achtung! {{states.sensor.dwd_weather_warnings_current_warning_level.attributes.warning_1_headline}}.
        {{states.sensor.dwd_weather_warnings_current_warning_level.attributes.warning_1_description}}.
        {{states.sensor.dwd_weather_warnings_current_warning_level.attributes.warning_1_instruction}}.
  - data:
      entity_id: media_player.alexa_1
      volume_level: '0.3'
    service: media_player.volume_set
  - data:
      entity_id: media_player.alexa_2
      volume_level: '0.5'
    service: media_player.volume_set
  - data_template:
      data:
        type: tts
      target: media_player.alexa_2
      message: Achtung! {{states.sensor.dwd_weather_warnings_current_warning_level.attributes.warning_1_headline}}.
        {{states.sensor.dwd_weather_warnings_current_warning_level.attributes.warning_1_description}}.
        {{states.sensor.dwd_weather_warnings_current_warning_level.attributes.warning_1_instruction}}.
    service: notify.alexa_media

Same error here.

v.1.3.1 fro HACS

HASSIO ver 0.96.5 (docker)

log:
2019-07-27 21:34:38 ERROR (MainThread) [homeassistant.components.alarm_control_panel] Error while setting up platform alexa_media

Not mine, but this might help. Last post.

2 Likes

:+1::+1:
Thanks for the pointer.

Thanks @erad2018, tested and working now. KeyError:‘csrf’ gone!

1 Like

ok, it all works :grinning:
I noticed that the cookie must be deleted and the reCAPTCHA procedure repeated.
thank you all :kissing_heart:

Its working for me after installing: ( https://github.com/keatontaylor/alexa_media_player/issues/258 ).
Dont forget to delete the .pickle after installing!

I am new to adding a media player device and have a basic question. I have everything installed according to the new directions and think it will work but…
How do I create an entity called “media_player.YOUR_ECHO_1”
All I see is an entity called “device_tracker.echo_office”

Thank you

The entity will be created automatically when the custom component is loaded.
“media_player.YOUR_ECHO_1" is an example, it will be the actual name of your echo device, such as “media_player.carltons_echo”

Sorry for my ignorance or inexperience.
All the files were created after install under custom_components>alexa_media (including pycache).
I still do not see any entity starting with media_player, except my Roku ( media_player.5123_roku_ultra)
I installed the files using HACS. I also now have 3 dots setup under the alexa skills configuration.

What am I not doing.

I have a very similar issue. I can see “notify.alexa_media_downstairs_dot”, so it has picked the device up, but it is not available as a media player.

I also have a bunch of notify.alexa_media… as well.

Make sure you have the following in your config.yaml

alexa_media:
  accounts:
    - email: YOUR EMAIL FOR AMAZON ACCOUNT
      password: YOUR AMAZON PASSWORD
      url: amazon.com

Hi, I have updated “hass” from 0.95.0 to 0.96.5 and now media_player has an error and does not appear
de log dump is:
File “/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py”, line 93, in setup_platform hass)
File “/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py”, line 115, in init
self.alexa_api = AlexaAPI(self, login)
File “/srv/homeassistant/lib/python3.6/site-packages/alexapy/alexaapi.py”, line 51, in init
csrf = self._session.cookies.get_dict()[‘csrf’]
KeyError: ‘csrf’

I just uninstalled the config.yaml data, HACS setup and the pickle file.
Rebooted.
Reinstalled HACS,and my confi.yaml.

alexa_media:
  accounts:
    - email: !secret notification_recipient
      password: !secret amazon
      url: amazon.com

rebooted again.
Went to notification and entered the captcha info.
All looks correct but still no media devices are present.

I do not know what else to do.
Anyone have any ideas.

Problem is now solved. After deleting the file ofer a dozen times and restarting, I found this link on a post and it worked for me. all my devices are set up.

Thanks for the help

Hi, @alandtse
Seems to be an issue in 0.97 beta release… media players are no longer present

Possible reason - https://github.com/home-assistant/home-assistant/pull/25436

> 2019-08-01 10:09:36 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform alexa_media.media_player: Platform not found (cannot import name 'MEDIA_PLAYER_SCHEMA' from 'homeassistant.components.media_player' (/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py)).

As a temp fix, changed the wording “MEDIA_PLAYER_SCHEMA” to “PLATFORM SCHEMA” on line 15/16 of the media_player.py in the CC folder.

`

Thanks Grant for the heads up and proposed fix. I’ll be headed home soon so I’ll be able to look at all the issues that broke while I was traveling the last few weeks.

2 Likes