# Turn on a device based on which Alexa requests it

**URL:** <https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358>\
**Category:** General\
**Created:** [19 April 2019 14:12 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358 "2019-04-19T14:12:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shorage/32/7751_2.png) [@shorage](https://discourse.nodered.org/u/shorage)\
**Post date:** [19 April 2019 14:12 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/1 "2019-04-19T14:12:30Z")

</div>

Hello,

I didnt know where to post this. Basically i am trying to run specific scripts in home assistant based on which alexa "turns on" the device.

If i tell my living room alexa to "turn on front door camera", i want it to run a script in home assistant called "FrontDoorCamCast" and utilize the fact that i know (somehow) the living room alexa asked for it and utilize this information in the script to properly choose which endpoint to cast the camera to.

Is this possible? IS their a way in node red to access the requesting alexa devices ID and pass that information to home assistant to use as a variable to an if else statement determining the endpoint device of the camera cast?

Hope this makes sense.

Thanks

Frank

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [19 April 2019 15:13 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/2 "2019-04-19T15:13:07Z")

</div>

You can see the full message available to an alexa node by attaching a debug node to an alexa node and setting it to display the complete message object.

---

<div class="post-metadata">

**Author:** ![shorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shorage/32/7751_2.png) [@shorage](https://discourse.nodered.org/u/shorage)\
**Post date:** [20 April 2019 01:44 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/3 "2019-04-20T01:44:14Z")

</div>

So i tried what you said, and both of my Echo Dot Gen3s give the same appliance ID. I was hoping for something different to make use of some type of constant from either echo dot and make a determination of its location in the house.

Any ideas?

Thanks for the assist on this.

Frank

please see the following;

msg : Object  
object  
topic: ""  
name: "Living Room Movie"  
\_messageId: "e1ed3a5c-386c-436e-b764-b78877a4913f"  
\_applianceId: "56893"  
\_confId: "2fa69167.590f86"  
command: "TurnOnRequest"  
extraInfo: object  
payload: true  
\_msgid: "d0ff7992.073e98"

msg : Object  
object  
topic: ""  
name: "Living Room Movie"  
\_messageId: "705d1165-194c-4fde-a9f3-0ad1f1ecd234"  
\_applianceId: "56893"  
\_confId: "2fa69167.590f86"  
command: "TurnOnRequest"  
extraInfo: object  
payload: true  
\_msgid: "6823e2b3.d439cc"

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 April 2019 02:00 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/4 "2019-04-20T02:00:36Z")

</div>

Maybe there is something in `msg.extraInfo` you could debug log that and look for clues?

---

<div class="post-metadata">

**Author:** ![shorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shorage/32/7751_2.png) [@shorage](https://discourse.nodered.org/u/shorage)\
**Post date:** [20 April 2019 02:13 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/5 "2019-04-20T02:13:33Z")

</div>

> [@Steve-Mcl](#):
>
> msg.extraInfo

Empty ☹  
Its the only thing i need to feel complete with alexa...

---

<div class="post-metadata">

**Author:** ![shorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shorage/32/7751_2.png) [@shorage](https://discourse.nodered.org/u/shorage)\
**Post date:** [20 April 2019 02:23 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/6 "2019-04-20T02:23:53Z")

</div>

Looking for something like this.

> <https://stackoverflow.com/questions/37755837/get-unique-device-id-for-amazon-echo>

---

<div class="post-metadata">

**Author:** ![shorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shorage/32/7751_2.png) [@shorage](https://discourse.nodered.org/u/shorage)\
**Post date:** [20 April 2019 02:37 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/7 "2019-04-20T02:37:12Z")

</div>

Looks like this is what i am looking for

context.System.device.deviceId

I got the information from here. And this is exactly the issue i am having, i did not want to create a new account for every room and potentially a NodeRed server instance for every room, lol

[https://forums.developer.amazon.com/questions/51286/is-there-a-unique-static-identifier-for-each-alexa.html](https://forums.developer.amazon.com/questions/51286/is-there-a-unique-static-identifier-for-each-alexa.html)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 April 2019 07:09 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/8 "2019-04-20T07:09:46Z")

</div>

But if that isn’t the debug message then it isn’t being returned by the node.

You would need to open an issue on the nodes github page to raise it with the nodes author to see if they can add it

---

<div class="post-metadata">

**Author:** ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)\
**Post date:** [6 January 2020 17:11 UTC](https://discourse.nodered.org/t/turn-on-a-device-based-on-which-alexa-requests-it/10358/9 "2020-01-06T17:11:45Z")

</div>

@shorage did you ever get to the bottom of this?

I want to identify which device received the spoken command, so I can return the output to the same device.
