Hi everybody, I made a script in HA to ask alexa who’s at home. The script for the notification is triggered by a phrase in alexa and works fine so far. But the problem is: I have more than one alexa and I can only hard code, which device will answer me (in the example it’s media_player.schlafzimmer). Better solution would be: The device that receives the trigger, answers me. Any ideas for solution? Thank you very much.
Here the script in HA:
sequence:
- if:
- condition: state
entity_id: person.nina
state: home
then:
- service: notify.alexa_media
data:
message: Nina
data:
type: announce
method: speak
target: media_player.schlafzimmer
- if:
- condition: state
entity_id: person.jonas
state: home
then:
- service: notify.alexa_media
data:
message: Jonas
data:
type: announce
method: speak
target: media_player.schlafzimmer
- if:
- condition: state
entity_id: person.ellen
state: home
then:
- service: notify.alexa_media
data:
message: Ellen
data:
type: announce
method: speak
target: media_player.schlafzimmer
- if:
- condition: state
entity_id: person.elke
state: home
then:
- service: notify.alexa_media
data:
message: Elke
data:
type: announce
method: speak
target: media_player.schlafzimmer
- if:
- condition: state
entity_id: person.admin
state: home
then:
- service: notify.alexa_media
data:
message: Hannes
data:
type: announce
method: speak
target: media_player.schlafzimmer
- if:
- condition: state
entity_id: person.antje
state: home
then:
- service: notify.alexa_media
data:
message: Antje
data:
type: announce
method: speak
target: media_player.schlafzimmer
mode: queued
icon: mdi:account-group
max: 10
And here the routine in alexa: