Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

19
Make home assistant use the last Alexa device used.
Post Body

So I found a way to make the Alexa media player integration use the last device used. A good use case is that I setup a goodnight routine where it'll turn off the light and check to make sure the doors are closed, if they're open it'll give an announcement on device that I said goodnight on that the door is open. You can also use it for actionable notifications. To do it, you just have to setup a template sensor using the code below as an example.

- platform: template
  sensors:
    last_alexa:
      entity_id:
        - media_player.bedroom_echo
        - media_player.bedroom_show
        - media_player.dining_room_echo
        - media_player.kid_s_room_echo
        - media_player.living_room_echo
      value_template: >
        {{ states.media_player | selectattr('attributes.last_called', 'eq', True) | map(attribute='entity_id') | first }}

Then to use it just set the target as '{{ states.sensor.last_alexa.state }}' You will have to use data_template instead of data in your automation or script.

Author
Account Strength
100%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
6,148
Link Karma
95
Comment Karma
5,925
Profile updated: 3 days ago
Posts updated: 4 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago