Use Node Red to send notifications to the last called Alexa

I have Alexa Media Player installed and working great. In Node Red I have my flows I want working and sending notifications/announcements to specific Alexa’s using, Call Service, Notify and then the specific Alexa. I also have a sensor set up in Home Assistant that gives me the last called Alexa.

I would like to send the notifications/announcements to the last called Alexa from the sensor, rather then specific Alexa’s in Node Red.

I’ve started to test with a simple inject that gets the current state of my sensor.last_alexa and sends the payload to a debug node. That all works fine and gives me the name of the last called Alexa, what I don’t know how to do is use that payload in the call service node I use to send announcements.

I’m sure this is a simple answer and I tried searching, but wasn’t sure exactly how to word my searches and came up empty. Any help would be greatly appreciated.

Thanks!

Since you already have the payload with the latest alexa called. Just pass it to a node like this.

[{"id":"25da7361.46c6dc","type":"api-call-service","z":"8fac164d.889228","name":"Alexa Alert","server":"d177950.2a5aa68","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media","entityId":"","data":"{\"message\":\"message\",\"data\":{\"type\":\"announce\",\"method\":\"all\"},\"target\":[\"{{payload}}\"]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1950,"y":699,"wires":[[]]},{"id":"d177950.2a5aa68","type":"server","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Here i have made the a notify alexa media service with the payload as the target device.

1 Like

Thank you! It worked perfectly! I appreciate the help.