Alexa what is the tank level?

Any help would be appreciated. I have an ESP8266 that logs a volume in liters (going to change to a percentage but that irrelevant) to an mqtt broker. I have this value in node red and would like to ask Alexa to retrieve it for me.

Any directions on where to start?
Regards

Look at this thread for a start:

Have a look at this thread for some ideas.

I get my ESP8266-based sensors to report their readings, via MQTT, to Node-RED where they are stored either in a database or a global variable. Then using Blueprints I can ask questions like... "Alexa, give me a temperature report" which triggers a corresponding flow. Be careful - this can become ADDICTIVE.

Thanks for the link guys. I've got this far but seem to be stuck getting a response. I've set up the blueprint skill and Alexa responds as per my blueprint but I get nothing on any of my debug nodes. I can inject into routine and she will say it. Authorization seems fine. Any quick insight would be great.

[{"id":"f95a9733d0a01e91","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"1346201638117967","type":"change","z":"f95a9733d0a01e91","name":"Set level","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":260,"wires":[["d845628143fb2d16"]]},{"id":"bf5de66a2cc442ad","type":"mqtt in","z":"f95a9733d0a01e91","name":"","topic":"home/tank/level","qos":"0","datatype":"auto","broker":"51f194ce1591908f","nl":false,"rap":true,"rh":0,"x":340,"y":200,"wires":[["1346201638117967","abea4b4340799cb0"]]},{"id":"097b5e552b807802","type":"debug","z":"f95a9733d0a01e91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":160,"wires":[]},{"id":"d845628143fb2d16","type":"debug","z":"f95a9733d0a01e91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":260,"wires":[]},{"id":"abea4b4340799cb0","type":"change","z":"f95a9733d0a01e91","name":"Set level","rules":[{"t":"set","p":"level","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":160,"wires":[["097b5e552b807802"]]},{"id":"bf44407a.c20d4","type":"alexa-remote-init","z":"f95a9733d0a01e91","name":"","account":"57e78a27.bf542c","option":"initialise","x":480,"y":380,"wires":[["123e6678.5acbaa"]]},{"id":"c7f04444.fed188","type":"inject","z":"f95a9733d0a01e91","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * 3,4,0","once":false,"onceDelay":0.1,"topic":"","payload":"alexa","payloadType":"flow","x":330,"y":380,"wires":[["bf44407a.c20d4"]]},{"id":"123e6678.5acbaa","type":"change","z":"f95a9733d0a01e91","name":"","rules":[{"t":"set","p":"alexa","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":380,"wires":[[]]},{"id":"43e7076457cce46f","type":"alexa-remote-event","z":"f95a9733d0a01e91","name":"","account":"57e78a27.bf542c","event":"ws-device-activity","x":330,"y":520,"wires":[["7182437ec92bea9b","768e6c9cf20d4104"]]},{"id":"7182437ec92bea9b","type":"switch","z":"f95a9733d0a01e91","name":"","property":"payload.alexaResponse","propertyType":"msg","rules":[{"t":"cont","v":"You have","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":520,"wires":[["68e373e443361ed1"]]},{"id":"68e373e443361ed1","type":"alexa-remote-routine","z":"f95a9733d0a01e91","name":"","account":"57e78a27.bf542c","routineNode":{"type":"speakAtVolume","payload":{"type":"regular","text":{"type":"flow","value":"level"},"volume":{"type":"num","value":"50"},"mode":"set","devices":{"type":"msg","value":"payload.name"}}},"x":750,"y":520,"wires":[["858641443cf844e6"]]},{"id":"858641443cf844e6","type":"debug","z":"f95a9733d0a01e91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":580,"wires":[]},{"id":"768e6c9cf20d4104","type":"debug","z":"f95a9733d0a01e91","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":580,"wires":[]},{"id":"51f194ce1591908f","type":"mqtt-broker","name":"Home-Assistant-Mosquitto","broker":"192.168.1.202","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"57e78a27.bf542c","type":"alexa-remote-account","name":"Amazon-Alexa","authMethod":"proxy","proxyOwnIp":"192.168.1.202","proxyPort":"3456","cookieFile":"Alexa_init","refreshInterval":"3","alexaServiceHost":"alexa.amazon.com.au","amazonPage":"amazon.com.au","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"on"}]

Try this simple flow to get you started.


It should capture your question and the device_name
You'll need to adjust the credentials in the 'initialise' node to match your geographical location, IP, etc..

[{"id":"9d5de8e11c041b38","type":"alexa-remote-init","z":"fc2ffed5c7a37e1d","name":"","account":"65fc5fb4b8d06bdd","option":"initialise","x":140,"y":560,"wires":[[]]},{"id":"5154915a06305640","type":"alexa-remote-event","z":"fc2ffed5c7a37e1d","name":"","account":"65fc5fb4b8d06bdd","event":"ws-device-activity","x":170,"y":620,"wires":[["2c68ef53.23d3f8","b0ba2ae16f1145bf"]]},{"id":"919a026a168f7e5f","type":"debug","z":"fc2ffed5c7a37e1d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":620,"wires":[]},{"id":"2c68ef53.23d3f8","type":"function","z":"fc2ffed5c7a37e1d","name":"Capture question","func":"var alexa_device_name = msg.payload.name;\nvar summary = msg.payload.description.summary;\n\n if ((summary != \"alexa\") && (summary != \"\")) {\n     \n    msg.payload = {};\n\n    msg = {\n        topic: \"Alexa_response\",\n        device_name: alexa_device_name,\n        payload: {\n            \"summary\": summary\n        }\n    }\n    flow.set(\"alexa_device_name\",alexa_device_name);\n    node.status({text:\"Device_name is \"+ alexa_device_name + \" Summary = \" + summary});\n    return msg;\n}\nelse {\n    return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":620,"wires":[["962a99e7.3a24d","919a026a168f7e5f","0b32c2a7297d89cc","5b9f3f09a10285ab","da9a0917d09f933d"]]},{"id":"b0ba2ae16f1145bf","type":"debug","z":"fc2ffed5c7a37e1d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":560,"wires":[]},{"id":"1e3f9d93f42df6b8","type":"inject","z":"fc2ffed5c7a37e1d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":500,"wires":[["9d5de8e11c041b38","d0cb70a27ade1f8e"]]},{"id":"65fc5fb4b8d06bdd","type":"alexa-remote-account","name":"Amazon acct","authMethod":"proxy","proxyOwnIp":"192.168.1.158","proxyPort":"3456","cookieFile":"/home/pi/amazon_alexa.txt","refreshInterval":"3","alexaServiceHost":"alexa.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-GB","onKeywordInLanguage":"","userAgent":"","useWsMqtt":"on","autoInit":"on"}]

Awesome, Thanks Dave. From that I have got it to work and can probably expand on from there.

Quick question. I can't seem to set a file path to save the authentication to. I have created a new file at /home/alexa_init.txt but it still complains about no such file. Any tips?

Does that file actually exist?? If you are running on a RPi, have you done a 'touch' to create it??

The path you are using is owned by root so..
Probably a better path for the file would be.. /home/pi/alexa_init.txt

Here's some code to help you start formatting a report-message. I've taken it from a flow I have that reports the temperature of a set of four Raspberry Pi(es) if one of them goes above a certain value. You could adapt it and insert your flow variables. Notice the use of <break time='0.25s'> to create pauses in the message which makes it sound more natural. Have fun.

var hostname = flow.get("hostname");
var ip_address = flow.get("ip_address");
var cpu_temperature = flow.get("cpu_temperature");

var message = "<break time='0.25s'/> Here's your report on your raspberry pie<break time='0.5s'/>";
    
message += "hostname is <break time='0.1s'/>"+hostname+ "<break time='0.25s'/>";
message += "IP address is <break time='0.1s'/>"+ip_address+ "<break time='0.25s'/>";
message += "CPU core temperature is <break time='0.1s'/>"+cpu_temperature+ "degrees sea <break time='0.25s'/>";

// This the footer for the message
message += "<break time='0.75s'/> that's the end of the report";

msg.payload = message;
return msg;

You do not have to save the authorization to file you can save to context storage, you can retrieve it from context in an inject node and feed it back into the init node to restore authorization
e.g.

[{"id":"e63c03b3.745b48","type":"inject","z":"d629013b.18a518","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"86400","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"alexa","payloadType":"flow","x":100,"y":1460,"wires":[["89e02d64.da77c8"]]},{"id":"89e02d64.da77c8","type":"alexa-remote-init","z":"d629013b.18a518","name":"","account":"c8738129.d902c","option":"initialise","x":290,"y":1460,"wires":[["fc0183e2.5e7c2"]]},{"id":"fc0183e2.5e7c2","type":"change","z":"d629013b.18a518","name":"","rules":[{"t":"set","p":"alexa","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1460,"wires":[["421c02e9.68fdec"]]},{"id":"c8738129.d902c","type":"alexa-remote-account","name":"alexa remote 2","authMethod":"proxy","proxyOwnIp":"localhost","proxyPort":"3456","cookieFile":"","refreshInterval":"14","alexaServiceHost":"layla.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-GB","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

Awesome, that helps. I can now ask Alexa either what percentage or how many liters there are in the tank. However I have an issue with the whole thing when HA or Node-Red restarts. Seems it requires me to go through the whole, open a webpage and sign in process which is not ideal. Unsure if this will happen after a length of time either.

I'll throw what I've got working here incase anyone feels like taking a quick look
Thanks again

[{"id":"0b6dc4faf464f97f","type":"tab","label":"ALEXA","disabled":false,"info":""},{"id":"412ab35f50a0b24f","type":"alexa-remote-event","z":"0b6dc4faf464f97f","name":"","account":"0df2185d1ca3e00b","event":"ws-device-activity","x":150,"y":580,"wires":[["e218999550953731"]]},{"id":"e218999550953731","type":"function","z":"0b6dc4faf464f97f","name":"Capture question","func":"var alexa_device_name = msg.payload.name;\nvar summary = msg.payload.description.summary;\n\n if ((summary != \"alexa\") && (summary != \"\")) {\n     \n    msg.payload = {};\n\n    msg = {\n        topic: \"Alexa_response\",\n        device_name: alexa_device_name,\n        payload: {\n            \"summary\": summary\n        }\n    }\n    flow.set(\"alexa_device_name\",alexa_device_name);\n    node.status({text:\"Device_name is \"+ alexa_device_name + \" Summary = \" + summary});\n    return msg;\n}\nelse {\n    return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":580,"wires":[["3e7965049a6580fc"]]},{"id":"3e7965049a6580fc","type":"switch","z":"0b6dc4faf464f97f","name":"","property":"payload.summary","propertyType":"msg","rules":[{"t":"cont","v":"how many liters do we have","vt":"str"},{"t":"cont","v":"how much water do we have","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":580,"wires":[["b23a25fa8eeb625b"],["51ea62eb5d649fd5"]],"info":"Setup a question in BLUEPRINTS with a response. Use that response to format a reply with correct information"},{"id":"ba285db584768ea3","type":"alexa-remote-routine","z":"0b6dc4faf464f97f","name":"","account":"0df2185d1ca3e00b","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"msg","value":"payload"},"devices":{"type":"flow","value":"alexa_device_name"}}},"x":1000,"y":580,"wires":[[]]},{"id":"51ea62eb5d649fd5","type":"function","z":"0b6dc4faf464f97f","name":"Format response","func":"var percent = flow.get(\"percent\");\n\nvar message = \"<break time='0.25s'/>\" +percent+ \"remaining\"\n    \nmsg.payload = message;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":600,"wires":[["ba285db584768ea3"]]},{"id":"b903a663bb1c75f2","type":"comment","z":"0b6dc4faf464f97f","name":"RESPOND TO QUESTION","info":"","x":170,"y":520,"wires":[]},{"id":"349d58c7eeb8ba50","type":"comment","z":"0b6dc4faf464f97f","name":"GRAB MQTT VALUES AND SET TO FLOW VARIABLES","info":"","x":270,"y":320,"wires":[]},{"id":"814bf0f99bc9a9c2","type":"inject","z":"0b6dc4faf464f97f","name":"Refresh once an hour","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"7","topic":"","payloadType":"date","x":200,"y":160,"wires":[["9388f745d62a36df"]]},{"id":"9388f745d62a36df","type":"alexa-remote-init","z":"0b6dc4faf464f97f","name":"","account":"0df2185d1ca3e00b","option":"refresh","x":440,"y":160,"wires":[[]]},{"id":"e63c03b3.745b48","type":"inject","z":"0b6dc4faf464f97f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"86400","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"alexa","payloadType":"flow","x":170,"y":80,"wires":[["89e02d64.da77c8"]]},{"id":"89e02d64.da77c8","type":"alexa-remote-init","z":"0b6dc4faf464f97f","name":"","account":"0df2185d1ca3e00b","option":"initialise","x":360,"y":80,"wires":[["fc0183e2.5e7c2"]]},{"id":"fc0183e2.5e7c2","type":"change","z":"0b6dc4faf464f97f","name":"","rules":[{"t":"set","p":"alexa","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":80,"wires":[[]]},{"id":"2099fc69d9302d9b","type":"mqtt in","z":"0b6dc4faf464f97f","name":"","topic":"home/tank/percent","qos":"2","datatype":"auto","broker":"51f194ce1591908f","nl":false,"rap":true,"rh":0,"inputs":0,"x":150,"y":440,"wires":[["950925ea0ce4095a"]]},{"id":"730193bdf1f7300a","type":"debug","z":"0b6dc4faf464f97f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":440,"wires":[]},{"id":"950925ea0ce4095a","type":"change","z":"0b6dc4faf464f97f","name":"Set percent","rules":[{"t":"set","p":"percent","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":440,"wires":[["730193bdf1f7300a"]]},{"id":"b23a25fa8eeb625b","type":"function","z":"0b6dc4faf464f97f","name":"Format response","func":"var level = flow.get(\"level\");\n\nvar message = \"<break time='0.25s'/>\" +level+ \"remaining\"\n    \nmsg.payload = message;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":560,"wires":[["ba285db584768ea3"]]},{"id":"4556313d8ed51dc5","type":"mqtt in","z":"0b6dc4faf464f97f","name":"","topic":"home/tank/level","qos":"2","datatype":"auto","broker":"51f194ce1591908f","nl":false,"rap":true,"rh":0,"inputs":0,"x":140,"y":380,"wires":[["df14265ee07a12dc"]]},{"id":"448d7b7b259f0fe8","type":"debug","z":"0b6dc4faf464f97f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":380,"wires":[]},{"id":"df14265ee07a12dc","type":"change","z":"0b6dc4faf464f97f","name":"Set level","rules":[{"t":"set","p":"level","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":380,"wires":[["448d7b7b259f0fe8"]]},{"id":"0df2185d1ca3e00b","type":"alexa-remote-account","name":"Amazon-Alexa","authMethod":"proxy","proxyOwnIp":"192.168.1.202","proxyPort":"3456","cookieFile":"","refreshInterval":"3","alexaServiceHost":"alexa.amazon.com.au","amazonPage":"amazon.com.au","acceptLanguage":"en-US","onKeywordInLanguage":"","userAgent":"","useWsMqtt":"on","autoInit":"on"},{"id":"51f194ce1591908f","type":"mqtt-broker","name":"Home-Assistant-Mosquitto","broker":"192.168.1.202","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

Turn Auto Init off in your remote2 config. The inject nodes with the saved authentication will do that for you.

Auto Init
on to initialise the account everytime the node starts or has changed

But you are not saving to file so it should be Off.

Thanks! :grinning:

I'll give that a shot

Damn. Seems it just reverts to wanting me to sign in :sleepy:
Do I need the refresh cookie part? As soon as I inject that, it asks me to sign in. Will remove it and see what happens overnight. Seeing as I'm running this all on a pi with HA, do I need to visit the login on the pi itself? I have just been going to the webpage and signing in on my PC...

Have you edited your settings json and made your context store persistent? Working with context : Node-RED

I login on another device, when i do i enter the ip of the device running node-red.
I do not refresh cookie.
I use a catch node to wait for errors, if found i use a change node to load saved authentication and feed that to the initialise node.

First time i initialise i have to enter user and pass at ip:3456, after that all i need to do is press the inject button if the catch fails. Have only had to press inject again once in six months.

Ahh, no I had not! Thanks again for all the help

Sorry guys. Thought I had it but am being hung up on one thing it seems. In the 'device name' of the routine speak I cannot pass a flow.variable, in this case flow.alexa_device_name which is set in the function node. I press 'done' and it reverts to nothing. It seems this is causing no response.

Anyone know how to get the device name of the Alexa that was to in there so it responds only on that one and not a specific one?

[{"id":"32e7ac53d12a7210","type":"debug","z":"0b6dc4faf464f97f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":640,"wires":[]},{"id":"9f7068ac6505e230","type":"debug","z":"0b6dc4faf464f97f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800.0094604492188,"y":642.0056762695312,"wires":[]},{"id":"9fee98e14df11b6d","type":"debug","z":"0b6dc4faf464f97f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":640,"wires":[]},{"id":"a47e750a0fe3cb96","type":"alexa-remote-event","z":"0b6dc4faf464f97f","name":"","account":"0df2185d1ca3e00b","event":"ws-device-activity","x":150,"y":560,"wires":[["338e7cd4a0ef4763"]]},{"id":"338e7cd4a0ef4763","type":"function","z":"0b6dc4faf464f97f","name":"Capture question","func":"var alexa_device_name = msg.payload.name;\nvar summary = msg.payload.description.summary;\n\n if ((summary != \"alexa\") && (summary != \"\")) {\n     \n    msg.payload = {};\n\n    msg = {\n        topic: \"Alexa_response\",\n        device_name: alexa_device_name,\n        payload: {\n            \"summary\": summary\n        }\n    }\n    flow.set(\"alexa_device_name\",alexa_device_name);\n    node.status({text:\"Device_name is \"+ alexa_device_name + \" Summary = \" + summary});\n    return msg;\n}\nelse {\n    return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":560,"wires":[["c9ec0913115de891","32e7ac53d12a7210"]]},{"id":"c9ec0913115de891","type":"switch","z":"0b6dc4faf464f97f","name":"","property":"payload.summary","propertyType":"msg","rules":[{"t":"cont","v":"how many liters do we have","vt":"str"},{"t":"cont","v":"tank level","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":560,"wires":[["c3c9d2dedf06abbc"],["c869f1a947a5a82b","9f7068ac6505e230"]],"info":"Setup a question in BLUEPRINTS with a response. Use that response to format a reply with correct information"},{"id":"45c47815fd69e3cc","type":"alexa-remote-routine","z":"0b6dc4faf464f97f","name":"","account":"0df2185d1ca3e00b","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"msg","value":"payload"},"devices":{"type":"msg","value":"device_name"}}},"x":1020,"y":560,"wires":[["4189151769df9f8d"]]},{"id":"c869f1a947a5a82b","type":"function","z":"0b6dc4faf464f97f","name":"Format response","func":"var percent = flow.get(\"percent\");\n\nvar message = +percent+ \"remaining\"\n    \nmsg.payload = message;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":580,"wires":[["45c47815fd69e3cc","9fee98e14df11b6d"]]},{"id":"c3c9d2dedf06abbc","type":"function","z":"0b6dc4faf464f97f","name":"Format response","func":"var level = flow.get(\"level\");\n\nvar message = \"<break time='0.25s'/>\" +level+ \"remaining\"\n    \nmsg.payload = message;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":540,"wires":[["45c47815fd69e3cc"]]},{"id":"4189151769df9f8d","type":"debug","z":"0b6dc4faf464f97f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1210,"y":560,"wires":[]},{"id":"0df2185d1ca3e00b","type":"alexa-remote-account","name":"Amazon-Alexa","authMethod":"proxy","proxyOwnIp":"192.168.1.202","proxyPort":"3456","cookieFile":"","refreshInterval":"3","alexaServiceHost":"alexa.amazon.com.au","amazonPage":"amazon.com.au","acceptLanguage":"en-US","onKeywordInLanguage":"","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

[EDIT] - Seems it is passed along as 'msg.device_name' ..... I think. Not so great at node-red

Why set it to a flow var, use msg.payload.name or msg.payload.data.device.deviceName directly and pass it along with the message.
using msg.device_name works. I have slimmed down the flow to the min and added data to inject node

[{"id":"ec84cc30.949638","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"recordKey\":\"A32#2\",\"recordType\":\"VOICE_HISTORY\",\"timestamp\":1639469977032,\"customerId\":\"AB\",\"device\":{\"deviceName\":\"Lounge\",\"deviceEntityId\":null},\"isBinaryFeedbackProvided\":false,\"isFeedbackPositive\":false,\"utteranceType\":\"GENERAL\",\"domain\":\"Global\",\"intent\":\"WhatTimeIntent\",\"skillName\":\"\",\"voiceHistoryRecordItems\":[{\"recordItemKey\":\"163LF16-0\",\"recordItemType\":\"CUSTOMER_TRANSCRIPT\",\"utteranceId\":\"V.cedfeb90aLPM/0\",\"timestamp\":1639469976366,\"transcriptText\":\"computer what's the time\",\"agentVisualName\":\"\",\"personsInfo\":[]},{\"recordItemKey\":\"163946D#34-2\",\"recordItemType\":\"ALEXA_RESPONSE\",\"utteranceId\":\"A31/12/14/08/DEVICE_UNSPECIFIED/19:36::TNIH_2V.cedfefc2-9dba-4f23-8568-d2bbbc32b90aLPM/0\",\"timestamp\":1639469977034,\"transcriptText\":\"The time is 8:19 am.\",\"agentVisualName\":\"\",\"personsInfo\":[]}],\"personsInfo\":[]},\"conversionDetails\":{\"CUSTOMER_TRANSCRIPT\":[{\"recordItemKey\":\"6-0\",\"recordItemType\":\"CUSTOMER_TRANSCRIPT\",\"utteranceId\":\"21/12/14/08/DEVICE_UNSPECIFIED/19:36::TNIH_2V.cedfefc2-9dba-4f23-8568-d2bbbc32b90aLPM/0\",\"timestamp\":1639469976366,\"transcriptText\":\"computer what's the time\",\"agentVisualName\":\"\",\"personsInfo\":[]}],\"ALEXA_RESPONSE\":[{\"recordItemKey\":\"163469977034-2\",\"recordItemType\":\"ALEXA_RESPONSE\",\"utteranceId\":\"021/12/14/08/DEVICE_UNSPECIFIED/19:36::TNIH_2V.cedfefc2-9dba-4f23-8568-d2bbbc32b90aLPM/0\",\"timestamp\":1639469977034,\"transcriptText\":\"The time is 8:19 am.\",\"agentVisualName\":\"\",\"personsInfo\":[]}]},\"deviceType\":\"F\",\"creationTimestamp\":1639469977032,\"deviceSerialNumber\":\"D\",\"name\":\"Lounge\",\"description\":{\"summary\":\"computer what's the time\"},\"alexaResponse\":\"The time is 8:19 am.\",\"destinationUserId\":\"Q\"}","payloadType":"json","x":210,"y":1020,"wires":[["338e7cd4a0ef4763"]]},{"id":"338e7cd4a0ef4763","type":"function","z":"c791cbc0.84f648","name":"Capture question","func":"var alexa_device_name = msg.payload.name;\nvar summary = msg.payload.description.summary;\n\n if ((summary != \"alexa\") && (summary != \"\")) {\n     \n    msg.payload = {};\n\n    msg = {\n        topic: \"Alexa_response\",\n        device_name: alexa_device_name,\n        payload: {\n            \"summary\": summary\n        }\n    }\n    flow.set(\"alexa_device_name\",alexa_device_name);\n    node.status({text:\"Device_name is \"+ alexa_device_name + \" Summary = \" + summary});\n    return msg;\n}\nelse {\n    return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":420,"y":1040,"wires":[["32e7ac53d12a7210","c3c9d2dedf06abbc"]]},{"id":"32e7ac53d12a7210","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":450,"y":1140,"wires":[]},{"id":"c3c9d2dedf06abbc","type":"function","z":"c791cbc0.84f648","name":"Format response","func":"var level = flow.get(\"level\");\n\nvar message = \"<break time='0.25s'/> 23 remaining\"\n    \nmsg.payload = message;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":1040,"wires":[["4189151769df9f8d","45c47815fd69e3cc"]]},{"id":"4189151769df9f8d","type":"debug","z":"c791cbc0.84f648","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1150,"y":1040,"wires":[]},{"id":"45c47815fd69e3cc","type":"alexa-remote-routine","z":"c791cbc0.84f648","name":"","account":"c8738129.d902c","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"msg","value":"payload"},"devices":{"type":"msg","value":"device_name"}}},"x":1190,"y":1100,"wires":[[]]},{"id":"c8738129.d902c","type":"alexa-remote-account","name":"alexa remote 2","authMethod":"proxy","proxyOwnIp":"localhost","proxyPort":"3456","cookieFile":"","refreshInterval":"14","alexaServiceHost":"layla.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-GB","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

This is what I do...
Screen Shot 12-14-21 at 09.08 AM

Thanks again you two :slightly_smiling_face: . After I wrote that I studied it a bit further and worked out 'device_name' worked. All seems to be robust as of now so will put it to the test.
Merry Christmas

Glad it's working for you.
Now you can start having some fun sending personalised message to Alexa.

Merry Christmas to you too.

Small potatoes I have 12 echoes :wink: There is no hiding from her!

1 Like