Echo Devices (Alexa) as Media Player - Testers Needed

try it this way instead:

alexa_media:
  accounts:
    - email: [email protected]
      password: XXXXXX
      url: amazon.com

Thanks It should work on 0.88.2 correct? I understand .89 is having issues?
I tried it that way as well.

I think I’m just missing something simple, and probably not related to this plugin.

My error is: ModuleNotFoundError: No module named ‘alexapy’

I see help that says “You’re missing the dependency installation step” but I don’t see such a step in the instructions here (https://github.com/keatontaylor/alexa_media_player/wiki/Configuration#install-dependencies).

I see things like “I forgot to update docker”, which I don’t know how to do, and “pip” which is a command that doesn’t work when I ssh (using the SSH server add-on). I’m running hassio on a raspberry pi.

Any idea what I’m missing? Thanks

The following assumes you are running HassOs on your Raspberry Pi. There are several ways to install Hassio on that device. You may need to do this every time you update Home Assistant because that docker container is replaced with a new one, That is part of how Hassio works.

ssh in to hassio.

At the login prompt use the username root and any password you may have set. If it does not prompt for a password, that is OK.

I get a prompt “hassio >”. Type login. I just get a “#” prompt.

type docker exec -it homeassistant /bin/bash

I get a “bash-4.4#” prompt.

type pip3 install alexapy

After that finishes installing you can type exit a couple of times to logout.

Thanks. It’s actually Hass.io running on the pi. When I install the ssh add-in I get a “core-ssh” prompt. There’s a “hassio” command I can use, but I’m not sure what commands I would use to get the dependencies installed. I’ve been looking around and apparently Hass.io is a “locked down” version. Funny thing is this extension was working in my setup until I upgraded to 88 and the 1.1.0 version.

I’m just trying to translate the comments here into what will work for my Hass.io version. The comments seem to lean towards some other way to run Home Assistant (like HassOS?)

Am I out of luck with this latest version?

OK, what do you get if you type login at the core-ssh prompt?

What port are you using for ssh? I suspect port 2222. Try port 22 and see if you can login as the user pi.

The default password, if it has not been changed, is raspberry

const.py
__init__.py
media_player.py

(note the init py file has TWO underscores before the init and TWO underscores after the init

2 Likes

The > was from me using block code instead of preformatted text when doing this post. Those > are not in my config. FWIW I got it working by downloading the alexa_media folder as a zip file instead of copying the raw files from Github and pasting it in my alexa_media folder.

I get (using ‘pi’ and ‘raspberry’):

   core-ssh:~# login
   core-ssh login: pi
   Password:
   Login incorrect

Root doesn’t work (immediately fails the login). Port 2222 and 22222 also don’t work (I’m on 22). I think, after more research, that I need to follow this (https://developers.home-assistant.io/docs/en/hassio_debugging.html) to get access to the supervisor OS. But even then, I’m not sure I can affect the hass.io container’s libraries.

If I had to guess, after some rudamentary looking at the code and commits, that 1.0.0 created a dependency on the alexapy library, and such dependencies, as it is, are not supported for Hass.io installs. I’ll keep digging into this as time permits. I’m not all that familiar with python but I know a bit about Linux and docker.

Thanks

1 Like

The pip3 command installs the module into the python running in the homeassistant docker container used by hassio. That is why I said you may need to repeat this for every upgrade. To upgrade homeassistant, hassio replaces the homeassistant docker container with one containing the newer version.

1.2.0 is out.
Features:

  • Add notification service. (resolves #51)

Deprecation Warning: media_player.alexa_tts will be deprecated in the next version. Please use the notify.alexa_media service instead. We now support Announce which allows the speech to be synced and displayed on Echo Show or Spot (untested, so feedback appreciated).

NOTE: The repo name has changed on GitHub from custom_component to alexa_media_player. Old links will work but you should consider migrating any links you have (e.g., custom_updater).

Full changelog .

As always, please use the the Wiki and FAQ if you need instructions or have questions. Also, please help in documenting features in the wiki since this thread is basically unsearchable now. We also use GitHub for bug reports/feature requests .

3 Likes

Thanks @alandtse this component is becoming more amazing.

I’m trying to use the notification method like this

{
"message":"test",
"title":"My title",
"data":{"type":"push"},
"target":["my serial number"]
}

using the Alexa serial number of the app on my phone, but I get this error.
I’ve tried with all notification methods, TTS, Announce and Mobile Push.
Using the name of my Alexa devices or, when defined in alexa_media, also the media_player.xxxx naming.

not enough values to unpack (expected 2, got 1)
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/components/notify/__init__.py", line 117, in async_notify_message
    await notify_service.async_send_message(**kwargs)
  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/notify.py", line 137, in send_message
    entities.extend(self.hass.components.group.expand_entity_ids(entities))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/group/__init__.py", line 139, in expand_entity_ids
    domain, _ = ha.split_entity_id(entity_id)
ValueError: not enough values to unpack (expected 2, got 1)

Is there another way to send Mobile Push to the Alexa App on my phone rather than serial number?

Thanks

PS
I’ve got it.
I have to specify any of my Alexa Echo device in Mobile Push and I will get a message in any of the Mobile App that are connected to my account.
So the method should be

{
"message":"test",
"title":"My title",
"data":{"type":"push"},
"target":["my Echo"]        # using name, media_player or serial number
}

and I get the notification on my phone where the Alexa App is installed.

Where you get the exact name of the devices where is installed alexa app?

Is not needed, if you put this in the target field it causes the error.

In any case, if you go on http://alexa.amazon.it you will see there :wink:

Ok, so which is the good syntax to use with the notify service?

You can see it here

The only thing I haven’t understood at the beginning was the Mobile Push.

But in my message, in the PS part I explain what I understood how should work.

Yes i see… you put this: “target”:[“my Echo”]. So what to put in place of my Echo? The real name of the device or what as you say it’s not needed?

As it says in the Wiki page I linked before
* target - The target Alexa devices. This can be the Friendly Name, Serial Number, entity_id, or Home Assistant Group. **Warning:** Mobile Push using groups will result in a push from every Echo device to every Alexa App.

So in my case it should be: “target”:[“Alexa app di Maurizio”] ? With the parenthesys or without?

The new notify tts feature doesn’t work for me.

I tried it in the dev tools and as a script. I also added notify to my config and notify.alexa_media shows up in the services.

My script looks like this:

test_tts:
  sequence:
    - service: notify.alexa_media
      data:
        target: media_player.myechodevice
        message: "Test"
        data:
          type: tts

It doesn’t work in both cases devtool or script. Of course I used this format in the dev tools:

{
"message":"test",
"data":{"type":"tts"},
"target":["group.alexa", "Guest Room", "media_player.kitchen", "serialNumber"]
}

I don’t get an errror.