Alexa Notification any time a sensor opens

I understand the concept but cant seem to find the correct way to capture the name of whichever devices opens at the time, and pass that to Alexa to notify via:

{
    "message": "{{any sensor}} is open...",
    "data": {
        "type": "announce"
    }
}

Hi there,

I have this set up in a "Alexa, ready to leave the house) routine :slight_smile:

Basically, the sensor goes to a switch , that reports on open. I then set a message payload to be the name of the sensor:

Screenshot 2020-12-15 at 14.37.43

I then join all these together with a comma afterwards an a space:

Screenshot 2020-12-15 at 14.32.32

which then outputs the doors/windows open to a function, then to alexa:

Is this the type of thing you mean?

mb

EDIT: There may be a cleaner way of doing it, but this works for me :slight_smile:

Possibly…so I want to capture any/all state changes, and if its a specific group of sensors…capture say, the friendly name, of that sensor that just opened, then pass that to a service call to Alexa notify that “sensor has just been opened…”

I just need to capture that sensor name, and pass it into the

{
    "message": "{{sensor name here}} is open...",
    "data": {
        "type": "announce"
    }
}

I think the easiest way is to do something similar to what i have done. Basically have a switch with output a string of ‘on’ or ‘off’ (or whatever open is for the particular sensor) and when the ‘on’ is triggered, set the new message.payload as say “Lounge Door”.

You then have a string and a name to push into the alexa speech.

I know what i mean to say but I don’t think i have explained it and I hope it makes sense!

mb

EDIT: In my example above Alexa replies, "Please check the xxx,xxxx,xxx sensor "