Echo Devices (Alexa) as Media Player - Testers Needed

Hello all.

Is it possible to have Alexa announce something which includes variables using the

notify.alexa_media

service?

Use case: “It is {current_temperature} in the living room”

If so, can anybody help me with the JSON syntax?

Here you go:

  action:
    - service: notify.alexa_media
      data_template:
        data:
          type: announce
        target:
          - media_player.echo_salotto
        message: >
          Time now is {{states('sensor.time')}}. 
          Outside temperature now is {{states('sensor.dark_sky_apparent_temperature')|round}} degrees 
          and {{states('sensor.livingroom_temp')|round}} degrees in the living room.

Cheers!!

2 Likes

Is this still something that needs changed? My media players are not showing up after entering the captcha. I tried both PLATFORM SCHEMA and PLATFORM_SCHEMA but doesn’t seem to work.

Are you seeing any errors in your logs?

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 442, 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/media_player.py”, line 66, in setup_platform
hass)
File “/config/custom_components/alexa_media/media_player.py”, line 96, in init
self.alexa_api = AlexaAPI(self, login)
File “/usr/local/lib/python3.7/site-packages/alexapy/alexaapi.py”, line 51, in init
csrf = self._session.cookies.get_dict()[‘csrf’]
KeyError: ‘csrf’

See a few posts up…

i did do this, and even tried “PLATFORM_SCHEMA” but neither one worked.

Look here for the fix for that bug.

There’s a bug that we’re still working on for the csrf error. The workaround posted earlier isn’t a complete solution.

1 Like

This change was only required if you are running 0.97 Beta, ignore otherwise.

Yea, I saw that. I’m not on .97 yet so I’ll wait for a fix. Thanks all!

I had to update the alexapy.py file on 96.5 for mine to start working. I was seeing this error. What I did was copied the file to where my main machince could see it then ssh into home assistant and copy the file over the old.

i’m getting the same error message on HA 0.96.5.

Ok, the solution that worked for me after digging around was this.

Download the folder alexapy from https://gitlab.com/keatontaylor/alexapy
Add the folder to your config directory
Delete your pickle file
Reboot HA

Good afternoon!

I’ve been looking for the solution to connect with Alexa for several days, but I can’t.
I have downloaded the folder and copied it to the Hassio config folder, but I still have the same problem.

Can you think of anything?

Can anyone confirm the path to copy the folder in hassio?

What folder did you put the files in? They need to be in custom_components/alexa_media. And did you add the bit to your configuration.yaml file?

which problem do you experience?

the loose files inside the alexa_media folder?
If I put them like this I get the platform error.
and if I leave it in the alexapy folder, the devices do not appear, but it does create the pickle file.

In configuration I have:

alexa_media:
  accounts:
    email: mymail
    password:  mypass
    url: amazon.es

Put them like what? I’m saying the files need to go in custom_components/alexa_media. There’s no where else for them to go.

Your config looks correct. Are you seeing an error in your log?

Now I have managed to get the notification to complete the configuration, and I have entered the SMS verification number, but the devices still do not appear …

I get a csrf error again