Node-Red Flow Samples/Sharing

Title: Control lights specific to room with Alexa using same phrase

Summary: This allows you to use a single command to any Alexa and she will turn on lights based on which Alexa you are speaking.

Details: This flow allows for me to say "Illuminate" (Wesley Snipes in The Demolition Man); "Lumos Maxima" (Harry Potter), or "Make it light" to any Alexa and she will turn on the lights specific to the Alexa that I am speaking. With the node-red-contrib-alexa-remote2 node palette, there is a node that listens and msg.payload.description.summary is a summary of what she heard. The 1st Switch Node determines if she heard one of the phrases and acts appropriately. The Listening Node also provides msg.payload.deviceSerialNumber which is specific to each of the Alexas. The 2nd Switch Node determines which device to send command(s) based on Serial Number of device

I have a second flow that turns lights off to "Deluminate"; "Make it Dark" or "Lumos Minima". My third one will turn on appropriate fan to low when I say "It is hot in here".

I know this is not a complicated flow but the Listening Node in alexa-remote2 palette is powerful in this way and I thought some that installed it might not realize all of the information that it generates into a debug node. I recommend setting up the Listening Node and a Debug node (showing complete message object) and looking closely at the result in the debug window when you speak to Alexa. You might be surprised.

Note: You MUST also create a Routine in Alexa app with same name as the word/phrase you are using in flow and make it perform a 5 second wait. Otherwise, Alexa will try on her own to figure out what you mean and go looking out on the "interwebs". The 5 second wait won't affect the speed of your flow.

EDIT 9 MONTHS LATER: Instead of creating a bunch of dummy routines, you should be able to instead create an Alexa Q&A Blueprint and all of the phrase variations can all be in that one skill, thereby eliminating all of the dummy routines. See my post #461 below.

[{"id":"1dd953c7.b02acc","type":"alexa-remote-event","z":"f7404a38.ee3e88","name":"","account":"f3ed7c17.a3729","event":"ws-device-activity","x":170,"y":1700,"wires":[["3b54ccd6.116214"]]},{"id":"3b54ccd6.116214","type":"switch","z":"f7404a38.ee3e88","name":"Light It Up; Illuminate: or Lumos Maxima","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"cont","v":"light it up","vt":"str"},{"t":"cont","v":"illuminate","vt":"str"},{"t":"cont","v":"lumos maxima","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":460,"y":1700,"wires":[["1c465de.e0a58a2"],["1c465de.e0a58a2"],["1c465de.e0a58a2"]]},{"id":"5abca6ca.45a228","type":"hubitat command","z":"f7404a38.ee3e88","name":"Ainsleys Fan Bulb ON","server":"e2175bd0.e82808","deviceId":"681","command":"on","commandArgs":"","x":1200,"y":1740,"wires":[[]]},{"id":"678d6870.abe8e8","type":"hubitat command","z":"f7404a38.ee3e88","name":"Declans Fan Bulb ON","server":"e2175bd0.e82808","deviceId":"347","command":"on","commandArgs":"","x":1160,"y":1880,"wires":[[]]},{"id":"9228e75e.a045d8","type":"hubitat command","z":"f7404a38.ee3e88","name":"Living Room ON","server":"e2175bd0.e82808","deviceId":"2185","command":"on","commandArgs":"","x":1100,"y":1440,"wires":[[]]},{"id":"401d936c.30afcc","type":"hubitat command","z":"f7404a38.ee3e88","name":"Master Bedroom Bulb ON","server":"e2175bd0.e82808","deviceId":"582","command":"on","commandArgs":"","x":1210,"y":1580,"wires":[[]]},{"id":"68d93176.6f7f6","type":"hubitat command","z":"f7404a38.ee3e88","name":"Kitchen ON","server":"e2175bd0.e82808","deviceId":"485","command":"on","commandArgs":"","x":1110,"y":1480,"wires":[[]]},{"id":"a8df8300.8d8b4","type":"hubitat command","z":"f7404a38.ee3e88","name":"Dining Room ON","server":"e2175bd0.e82808","deviceId":"37","command":"on","commandArgs":"","x":1150,"y":1520,"wires":[[]]},{"id":"de322c3c.8bca9","type":"hubitat command","z":"f7404a38.ee3e88","name":"Reading Nook ON","server":"e2175bd0.e82808","deviceId":"3142","command":"on","commandArgs":"","x":1190,"y":1620,"wires":[[]]},{"id":"ab9685bb.4a8cf8","type":"hubitat command","z":"f7404a38.ee3e88","name":"Master Lamp ON","server":"e2175bd0.e82808","deviceId":"967","command":"on","commandArgs":"","x":1190,"y":1660,"wires":[[]]},{"id":"84f133e3.265","type":"hubitat command","z":"f7404a38.ee3e88","name":"Ainsleys Lamp ON","server":"e2175bd0.e82808","deviceId":"852","command":"on","commandArgs":"","x":1190,"y":1780,"wires":[[]]},{"id":"f974442.d233cb8","type":"hubitat command","z":"f7404a38.ee3e88","name":"Ainsleys Night Light ON","server":"e2175bd0.e82808","deviceId":"851","command":"on","commandArgs":"","x":1210,"y":1820,"wires":[[]]},{"id":"3b8d1b62.9ac5c4","type":"hubitat command","z":"f7404a38.ee3e88","name":"Declans Lamp ON","server":"e2175bd0.e82808","deviceId":"40","command":"on","commandArgs":"","x":1130,"y":1920,"wires":[[]]},{"id":"11ade24c.5da0ee","type":"hubitat command","z":"f7404a38.ee3e88","name":"Declans Night Light ON","server":"e2175bd0.e82808","deviceId":"329","command":"on","commandArgs":"","x":1130,"y":1960,"wires":[[]]},{"id":"1c465de.e0a58a2","type":"switch","z":"f7404a38.ee3e88","name":"Which Device?","property":"payload.deviceSerialNumber","propertyType":"msg","rules":[{"t":"eq","v":"G000MW0474520JG4","vt":"str"},{"t":"eq","v":"90F0071863140022","vt":"str"},{"t":"eq","v":"G0014B05949214EG","vt":"str"},{"t":"eq","v":"G090LF1073240EBM","vt":"str"},{"t":"eq","v":"G090LF11822302U5","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":740,"y":1700,"wires":[["9228e75e.a045d8","68d93176.6f7f6","a8df8300.8d8b4"],["401d936c.30afcc","de322c3c.8bca9","ab9685bb.4a8cf8"],["401d936c.30afcc","de322c3c.8bca9","ab9685bb.4a8cf8"],["5abca6ca.45a228","84f133e3.265","f974442.d233cb8"],["11ade24c.5da0ee","3b8d1b62.9ac5c4","678d6870.abe8e8"]],"outputLabels":["LIVING ROOM","MASTER BEDROOM","ANTIQUE RADIO ECHO FLEX","AINSLEYS BEDROOM","DECLANS DOT"]},{"id":"f3ed7c17.a3729","type":"alexa-remote-account","z":"","name":"ALEXA-192.168.68.139","authMethod":"proxy","proxyOwnIp":"192.168.68.139","proxyPort":"3456","cookieFile":"authFile","refreshInterval":"3","alexaServiceHost":"pitangui.amazon.com","amazonPage":"amazon.com","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"on"},{"id":"e2175bd0.e82808","type":"hubitat config","z":"","name":"HUBITAT HUB","usetls":false,"host":"192.168.68.124","port":"80","appId":"2569","nodeRedServer":"http://192.168.68.139:1880","webhookPath":"/hubitat/webhook","autoRefresh":false}]

EDIT: Since posting this originally, issues have arisen with the alexa2-remote palette. Instead, please use node-red-contrib-alexa-applestrudel which was forked from alexa2-remote.

11 Likes