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.
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.
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/homeassista...