Title - Randomized greeting/departure announcement
Summary - This one will take a little bit of work to convert to the HE node pallet, but somebody adventurous can give it a go (I'm looking at you @aaiyar since you've got the wait conditions with loops figured out ). I have lots of fun with this one.
This is triggered by presence arrival/departure for 2 people. Checks who arrived (or both) within the past 5 minutes, chooses a randomized arrival greeting, waits for door to open and then close and speaks the random greeting on Alexa. Could easily be expanded to support more people by expanding the names in the unsafe-function node.
Picture -
Flow
[{"id":"fe22ec90.1f7b4","type":"ha-get-entities","z":"43efc72.aa76338","server":"94fdcfdf.a00b","name":"","rules":[{"property":"entity_id","logic":"includes","value":"switch.mike_presence, switch.ashley_presence","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"},{"property":"timeSinceChangedMs","logic":"lt","value":"300000","valueType":"num"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":130,"y":460,"wires":[["dce1b1d1.9a685"]]},{"id":"dce1b1d1.9a685","type":"template","z":"43efc72.aa76338","name":"Format Names","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.attributes.friendly_name}}","output":"str","x":300,"y":460,"wires":[["c675d5c9.a6bdd8"]]},{"id":"c675d5c9.a6bdd8","type":"join","z":"43efc72.aa76338","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":460,"wires":[["eef7b7e8.d8c558"]]},{"id":"eef7b7e8.d8c558","type":"unsafe-function","z":"43efc72.aa76338","name":"Random Message","func":"var device=msg.payload\nmsg.payload = {};\nmsg.payload.domain = {};\nmsg.payload.service = {};\nmsg.payload.data = {};\nmsg.payload.data.data = {};\nmsg.payload.data.data.type = {};\nmsg.payload.data.message = {};\n\nif (device == 'Mike - Presence') {\n var name = 'Mike';\n var isAre = 'is';\n} else if (device === 'OTHER - Presence') {\n var name = 'OTHER';\n var isAre = 'is';\n} else if (device == 'Mike - Presence, OTHER - Presence' || device == 'OTHER - Presence, Mike - Presence') {\n var name ='Mike and OTHER';\n var isAre = 'are';\n}\n\nvar messageOpening = [\n "Welcome Home",\n "How you doing",\n "What's up",\n "Long time no see",\n "Hey",\n "Nice to see you",\n "Look who's home, it's",\n "Nice to have you back",\n "Howdy do",\n "What's going on",\n "How is everything",\n "It's feels like ages since I've seen you",\n "Where have you been hiding",\n "How's it hanging",\n "What's cookin",\n "What's shakin",\n "Greetings and salutations",\n "How goes it",\n "What's happening",\n "How goes it",\n "Roll out the red carpet for"\n];\n\nvar messageClosing = [\n "in the house! Ooo oooo",\n "here.",\n "home.",\n "joining the party",\n "crashing the party",\n "gracing us with their presence",\n "dropping anchor",\n "dropping in",\n "making the scene",\n "barging in",\n "showing up",\n "blowing in",\n "appearing",\n "breezing in",\n "rolling in",\n "popping in",\n "finally home"\n];\n\n\nvar randomOpening = messageOpening[Math.floor(Math.random()*messageOpening.length)];\nvar randomClosing = messageClosing[Math.floor(Math.random()*messageClosing.length)];\nvar message = randomOpening + " " + name + "." + " " + name + " " + isAre + " " + randomClosing\n\nmsg.payload.domain = "notify"\nmsg.payload.service = "alexa_media_front_entrance_echo_dot"\nmsg.payload.data.data.type = "announce"\nmsg.payload.data.message = message\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":460,"wires":[["b4e71139.15e7b"]]},{"id":"b4e71139.15e7b","type":"ha-wait-until","z":"43efc72.aa76338","name":"Door Opens","server":"94fdcfdf.a00b","outputs":2,"entityId":"binary_sensor.garage_door","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"5","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":790,"y":460,"wires":[["e9446d66.c088b"],[]]},{"id":"e9446d66.c088b","type":"ha-wait-until","z":"43efc72.aa76338","name":"Door Closes","server":"94fdcfdf.a00b","outputs":2,"entityId":"binary_sensor.garage_door","entityIdFilterType":"exact","property":"state","comparator":"is","value":"off","valueType":"str","timeout":"5","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":950,"y":460,"wires":[["9a733390.064f4"],[]]},{"id":"9a733390.064f4","type":"api-call-service","z":"43efc72.aa76338","name":"Speak Message","server":"94fdcfdf.a00b","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media_front_entrance_echo_dot","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1120,"y":460,"wires":[[]]},{"id":"b1e2d385.f986d","type":"ha-get-entities","z":"43efc72.aa76338","server":"94fdcfdf.a00b","name":"","rules":[{"property":"entity_id","logic":"includes","value":"switch.mike_presence, switch.ashley_presence","valueType":"str"},{"property":"state","logic":"is","value":"off","valueType":"str"},{"property":"timeSinceChangedMs","logic":"lt","value":"300000","valueType":"num"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":130,"y":560,"wires":[["c069c1d8.2ffeb"]]},{"id":"c069c1d8.2ffeb","type":"template","z":"43efc72.aa76338","name":"Format Names","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.attributes.friendly_name}}","output":"str","x":300,"y":560,"wires":[["b1e03b81.244208"]]},{"id":"b1e03b81.244208","type":"join","z":"43efc72.aa76338","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":560,"wires":[["ee858f3e.2a157"]]},{"id":"ee858f3e.2a157","type":"unsafe-function","z":"43efc72.aa76338","name":"Random Message","func":"var device=msg.payload\nmsg.payload = {};\nmsg.payload.domain = {};\nmsg.payload.service = {};\nmsg.payload.data = {};\nmsg.payload.data.data = {};\nmsg.payload.data.data.type = {};\nmsg.payload.data.message = {};\n\nif (device == 'Mike - Presence') {\n var name = 'Mike';\n var hasHave = 'has';\n} else if (device === 'OTHER - Presence') {\n var name = 'OTHER';\n var hasHave = 'has';\n} else if (device == 'Mike - Presence, OTHER - Presence' || device == 'OTHER - Presence, Mike - Presence') {\n var name ='Mike and OTHER';\n var hasHave = 'have';\n}\n\nvar messageOpening = [\n "Goodbye",\n "See you later",\n "Bye",\n "Live long and prosper",\n "Farewell",\n "Hope you have a great time",\n "Take care",\n "Smell you later",\n "Adios",\n "Caio",\n "Au revoir",\n "Sayonara",\n "Ta Ta for now",\n "Catch you later",\n "To-da-loo",\n "See you in the funny papers",\n "Toodles",\n "Godspeed",\n "So long",\n "Cheerio",\n "Arrivederci"\n];\n\nvar messageClosing = [\n "left the building",\n "gone out",\n "popped out",\n "left",\n "buggered off",\n "departed",\n "split",\n "vamoosed",\n "high tailed it",\n "escaped",\n "eight-six'd it",\n "bid farewell",\n "flaked off",\n "took a hike",\n "withdrawn",\n "exited",\n "vanished",\n "disappeared",\n "evacuated",\n "retreated",\n "taken their leave"\n];\n\n\nvar randomOpening = messageOpening[Math.floor(Math.random()*messageOpening.length)];\nvar randomClosing = messageClosing[Math.floor(Math.random()*messageClosing.length)];\nvar message = randomOpening + " " + name + "." + " " + name + " " + hasHave + " " + randomClosing\n\nmsg.payload.domain = "notify"\nmsg.payload.service = "alexa_media_front_entrance_echo_dot"\nmsg.payload.data.data.type = "announce"\nmsg.payload.data.message = message\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":560,"wires":[["904ffb9e.c47158"]]},{"id":"904ffb9e.c47158","type":"delay","z":"43efc72.aa76338","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":780,"y":560,"wires":[["8cf021e4.e7e3e"]]},{"id":"8cf021e4.e7e3e","type":"api-call-service","z":"43efc72.aa76338","name":"Speak Message","server":"94fdcfdf.a00b","version":1,"debugenabled":false,"service_domain":"notify","service":"alexa_media_front_entrance_echo_dot","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":940,"y":560,"wires":[[]]},{"id":"893c5b2b.7de1f8","type":"comment","z":"43efc72.aa76338","name":"Announce departue","info":"","x":150,"y":520,"wires":[]},{"id":"46989487.63407c","type":"comment","z":"43efc72.aa76338","name":"Announce arrival","info":"","x":140,"y":420,"wires":[]},{"id":"94fdcfdf.a00b","type":"server","z":"","name":"Home Assistant","addon":true}]