Echo Devices (Alexa) as Media Player - Testers Needed

Tags: #<Tag:0x00007f7c6e01afd0>

Issue solved! Thank you so much for your work on this project.

Perhaps this has been mentioned before, but regarding the last_called attribute;
I have two echos now with this attribute set as true (they do have different timestamps). This use to not be the case, where only one would show as true, but its been a few releases since I tested it.

I do have my echos associated with two Amazon accounts, but they both are and have been set to use the same account ever since I started using this custom component.
I’m running 2.5.1 on 104.0.

And only one account is used by the component?

Yes, only one account is listed under the component’s configuration:

    - email: !secret alexa_user
      password: !secret alexa_passwd

I’m seeing this too, running 2.5.1 on 0.104.0b5 . I just updated to 2.5.1 this morning, thinking it might have fixed what I was seeing, so I’m pretty sure it was in 2.5.0 as well.

Last Alexa only working for me in v2.4.1. Both v2.5.0 and v2.5.1 not working

Great work on Alexa,
why are all the, switches repeats, dnd, shuffle etc unavailable, the only thing avaliable is the media player.
How can i stop them from being created in the first place as i cant workout why i would ever use them. And they just fill up my list of devices in Alexa.
I rather prefer the ability to use the media_player stop service.

This should be fixed in 2.5.2.

If everything is unavailable all the time that’s a bug. In that case check your region.

Do not disturb switches should always be available. The repeat/shuffle switches are only available when the media player is playing certain media that support them.

If you don’t use them, you can either disable the entity in HA or in the config.

Hey on another reboot after update to 104.1 the dnd became available. I did have them all disabled but was seeing all these log entries about it was unable to update entity as it is disabled. Having 13 echos, 3 shows, 3 subs, 4 fire tv and all the wha groups, and stereo pairs theres alot of these switches.

Last called now working for me in v2.5.2, thanks!

I have alexa integration inactive…

I have HASSIO 0.104.1 and alexa_media_player 2.5.2

I don’t find alexapy library so I tried to install it using pip3 command but it returned this error:

Collecting alexapy
  Using cached
Collecting aiohttp
  Using cached
Collecting simplejson
  Using cached
Collecting yarl
  Using cached
Collecting bs4
  Using cached
Collecting requests
  Using cached
Collecting certifi
  Using cached
Collecting backoff
  Using cached
Collecting aiofiles
  Using cached
Collecting multidict<5.0,>=4.5
  Using cached
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting async-timeout<4.0,>=3.0
  Using cached
Collecting attrs>=17.3.0
  Using cached
Collecting chardet<4.0,>=2.0
  Using cached
Collecting idna>=2.0
  Using cached
Collecting beautifulsoup4
  Using cached
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached
Collecting soupsieve>=1.2
  Using cached
Building wheels for collected packages: multidict
  Building wheel for multidict (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.8 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/ build_wheel /tmp/tmpbhucbwp2
       cwd: /tmp/pip-install-iexeel3s/multidict
  Complete output (43 lines):
  * Accellerated build *
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.8
  creating build/lib.linux-armv7l-3.8/multidict
  copying multidict/ -> build/lib.linux-armv7l-3.8/multidict
  copying multidict/ -> build/lib.linux-armv7l-3.8/multidict
  copying multidict/ -> build/lib.linux-armv7l-3.8/multidict
  copying multidict/ -> build/lib.linux-armv7l-3.8/multidict
  copying multidict/ -> build/lib.linux-armv7l-3.8/multidict
  running egg_info
  writing multidict.egg-info/PKG-INFO
  writing dependency_links to multidict.egg-info/dependency_links.txt
  writing top-level names to multidict.egg-info/top_level.txt
  reading manifest file 'multidict.egg-info/SOURCES.txt'
  reading manifest template ''
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files found matching 'multidict/_multidict.html'
  warning: no previously-included files found matching 'multidict/*.so'
  warning: no previously-included files found matching 'multidict/*.pyd'
  warning: no previously-included files found matching 'multidict/*.pyd'
  no previously-included directories found matching 'docs/_build'
  writing manifest file 'multidict.egg-info/SOURCES.txt'
  copying multidict/__init__.pyi -> build/lib.linux-armv7l-3.8/multidict
  copying multidict/_multidict.c -> build/lib.linux-armv7l-3.8/multidict
  copying multidict/py.typed -> build/lib.linux-armv7l-3.8/multidict
  creating build/lib.linux-armv7l-3.8/multidict/_multilib
  copying multidict/_multilib/defs.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
  copying multidict/_multilib/dict.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
  copying multidict/_multilib/istr.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
  copying multidict/_multilib/iter.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
  copying multidict/_multilib/pair_list.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
  copying multidict/_multilib/views.h -> build/lib.linux-armv7l-3.8/multidict/_multilib
  running build_ext
  building 'multidict._multidict' extension
  creating build/temp.linux-armv7l-3.8
  creating build/temp.linux-armv7l-3.8/multidict
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c multidict/_multidict.c -o build/temp.linux-armv7l-3.8/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing -pedantic
  error: command 'gcc' failed with exit status 1
  ERROR: Failed building wheel for multidict
  Running clean for multidict
Failed to build multidict
ERROR: Could not build wheels for multidict which use PEP 517 and cannot be installed directly

Managed to get the timer and reminder sensors working and now I want to show them on the UI (I have a wall mounted tablet). Anyone got any suggestions on the best Lovelace card to use? I like the Entities card as it shows the countdown although it doesn’t say what the timer is for (if you’ve named it). Also, it always shows even if there is no timer (or reminder) set as they always show as unavailable. Any way to show this only when there’s an active timer/reminder? Thanks


i wrote a script which I exposed to alexa in order to ask which timer are active.
I have 6 echos collected in a group before.
Perhaps it can push you into the right direction:

  - service: alexa_media.update_last_called
  - delay: '00:00:01'  
  - service: notify.alexa_media
      target: '{{states.sensor.last_called_alexa.state}}'
        type: tts
      message: >
        {%if states | selectattr('entity_id','in',state_attr('group.all_alexa_sensors','entity_id')) | selectattr('state','eq','unavailable') | list | count | int == 18 %}
            There is no timer, alarm or reminder set
        {% else %}
           {%- for entity_id in if states(entity_id) != 'unavailable' -%}
            {% if loop.first %} the following times are set {% elif loop.last %} and {% else %} , {% endif -%}
             {{ state_attr(entity_id,'friendly_name') + ' in  ' }} {{( (as_timestamp(states(entity_id)) - as_timestamp(now())) / 60) |int }} Minutes
           {%- endfor %}
        {% endif %}

By the way: my wife likes to get the minutes left and not the time of getting valid :slight_smile:

Thanks Pirol_62 I like your script and I’ll have to give it a crack as it is pretty cool. It’s not quite what I’m looking for though as this (I presume) will get alexa to announce all active timers etc when you ask. I want to be able to walk past the tablet and see the timers set and the remaining time without having to ask.

Last called now working for me in v2.5.2, as well!! thanks!

1 Like

Ditto on last_called working in 2.5.2 . Thank you SO much for quick response!

I’m currently putting in some logic to skip creation of illogical switches or to hide them when you can’t use them.
In that vein, would people want timers/alarms/notifications to be hidden from the UI if there isn’t any detected? You would still be able to access them in scripts.

1 Like

Good idea, makes sense and enforces the focus on that, what we want to know

I’d love to have a lovelace card that could show all active timers and reminders and show the card only when they’re active. I’ve partially managed this with the following

show_empty: false
  type: entities
    - entity_id: sensor.*_next_timer
    - entity_id: sensor.*_next_reminder
    - state: unavailable

It works pretty well but only shows the timer or reminder that’s due next and not the detail of it. It would be great to have it show all active reminders and timers with the details pulled from the code. I can see that the timer/reminder info is there but no idea how to grab it and put it into a card.

Just some thoughts for the much cleverer people than me out there to consider :slight_smile:

My issue was with the cookie that I exported and saved to /tmp per the instructions on github. I found that I had to make a cookie for instead of