Pure fun with Alexa and Alexa Skills

Ok, now I am getting there! Good idea to set Alexa to brief mode although it might interfere with other Alexa functions where you want her to be more comprehensive...

But to filter out the parameter msg.payload.conversionDetails.CUSTOMER_TRANSCRIPT does not really help to stop Alexa in her "I dont understand you" answer, or?

I tried to catch the "I dont understand" answer in NR and immediately send out a STOP command to the Alexa device. Did not work. The loop Alexa->NR-Alexa is apparently not fast enough to shut her up.

Now when all this resolved I can start post-processing in NR including the ecolect node. I got some experience in NR so I can find my way there. Your ideas for post-processing will be helpful for that.

For those still playing along at home, I discovered some weird quirks with the change node I was using to convert written text numbers (i.e. "seven") to integers (i.e., "7"). Some numbers like "thirteen" were coming out as "13teen" or "twenty-two" was coming out as "20-2" and "sixty" was coming out as "60ty."

Here is the change node for those that want to play with it...

[{"id":"7961aeca812b34ec","type":"change","z":"b5a44a6b8fa524cc","name":"set numbers","rules":[{"t":"change","p":"values.number","pt":"msg","from":"one-hundred","fromt":"str","to":"100","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-nine","fromt":"str","to":"99","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-eight","fromt":"str","to":"98","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-seven","fromt":"str","to":"97","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-six","fromt":"str","to":"96","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-five","fromt":"str","to":"95","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-four","fromt":"str","to":"94","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-three","fromt":"str","to":"93","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-two","fromt":"str","to":"92","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty-one","fromt":"str","to":"91","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ninty","fromt":"str","to":"90","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-nine","fromt":"str","to":"89","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-eight","fromt":"str","to":"88","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-seven","fromt":"str","to":"87","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-six","fromt":"str","to":"86","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-five","fromt":"str","to":"85","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-four","fromt":"str","to":"84","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-three","fromt":"str","to":"83","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-two","fromt":"str","to":"82","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty-one","fromt":"str","to":"81","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighty","fromt":"str","to":"80","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-nine","fromt":"str","to":"79","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-eight","fromt":"str","to":"78","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-seven","fromt":"str","to":"77","tot":"str"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-six","fromt":"str","to":"76","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-five","fromt":"str","to":"75","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-four","fromt":"str","to":"74","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-three","fromt":"str","to":"73","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-two","fromt":"str","to":"72","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy-one","fromt":"str","to":"71","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventy","fromt":"str","to":"70","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-nine","fromt":"str","to":"69","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-eight","fromt":"str","to":"68","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-seven","fromt":"str","to":"67","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-six","fromt":"str","to":"66","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-five","fromt":"str","to":"65","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-four","fromt":"str","to":"64","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-three","fromt":"str","to":"63","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-two","fromt":"str","to":"62","tot":"str"},{"t":"change","p":"values.number","pt":"msg","from":"sixty-one","fromt":"str","to":"61","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixty","fromt":"str","to":"60","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-nine","fromt":"str","to":"59","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-eight","fromt":"str","to":"58","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-seven","fromt":"str","to":"57","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-six","fromt":"str","to":"56","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-five","fromt":"str","to":"55","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-four","fromt":"str","to":"54","tot":"str"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-three","fromt":"str","to":"53","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-two","fromt":"str","to":"52","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty-one","fromt":"str","to":"51","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifty","fromt":"str","to":"50","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-nine","fromt":"str","to":"49","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-eight","fromt":"str","to":"48","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-seven","fromt":"str","to":"47","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-six","fromt":"str","to":"46","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-five","fromt":"str","to":"45","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-four","fromt":"str","to":"44","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-three","fromt":"str","to":"43","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-two","fromt":"str","to":"42","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty-one","fromt":"str","to":"41","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourty","fromt":"str","to":"40","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-nine","fromt":"str","to":"39","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-eight","fromt":"str","to":"38","tot":"str"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-seven","fromt":"str","to":"37","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-six","fromt":"str","to":"36","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-five","fromt":"str","to":"35","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-four","fromt":"str","to":"34","tot":"str"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-three","fromt":"str","to":"33","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty-two","fromt":"str","to":"32","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thrity-one","fromt":"str","to":"31","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirty","fromt":"str","to":"30","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty nine","fromt":"str","to":"29","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty eight","fromt":"str","to":"28","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty seven","fromt":"str","to":"27","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty six","fromt":"str","to":"26","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty five","fromt":"str","to":"25","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty four","fromt":"str","to":"24","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty three","fromt":"str","to":"23","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty two","fromt":"str","to":"22","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty-one","fromt":"str","to":"21","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twenty","fromt":"str","to":"20","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"nineteen","fromt":"str","to":"19","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eighteen","fromt":"str","to":"18","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seventeen","fromt":"str","to":"17","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"sixteen","fromt":"str","to":"16","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fifteen","fromt":"str","to":"15","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"fourteen","fromt":"str","to":"14","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"thirteen","fromt":"str","to":"13","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"twelve","fromt":"str","to":"12","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eleven","fromt":"str","to":"11","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"ten","fromt":"str","to":"10","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"nine","fromt":"str","to":"9","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"eight","fromt":"str","to":"8","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"seven","fromt":"str","to":"7","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"six","fromt":"str","to":"6","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"five","fromt":"str","to":"5","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"four","fromt":"str","to":"4","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"three","fromt":"str","to":"3","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"two","fromt":"str","to":"2","tot":"num"},{"t":"change","p":"values.number","pt":"msg","from":"one","fromt":"str","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":40,"wires":[["4fdde905e4dc3023"]]}]

So, I did some looking around and found a nifty function node on reddit of all places that works really well. Plus it basically works for all numbers through decillion (which is probably enough). Below is a basic flow I used to turn on my kitchen lights. This flow gets its data from a separate flow that does the verbal Alexa stuff.

I don't know who created the function node, but I thought it was worth sharing for anyone else needing convert text to integers.

[{"id":"b5294d0d812f30c8","type":"group","z":"cd5687adb333d888","name":"Kitchen Lights","style":{"stroke":"#000000","fill":"#bfdbef","label":true,"color":"#000000"},"nodes":["e7cfe992dd452213","cf456a813390bef1","fff663f6920f375b","c2aa48569444891a","4c7cf8357f744af6","ef36e673212b7438","b42f3b4966c03bc6","faffb92b83b98289","41c7284bcd74ba4e","1134238105e132fa","daa49330c5bc3be3","92fc70791ee29f4c","20ca46a708347dae","60764100a0a4b8e8","bc5e2b4a0c8faa25","a7a3cbbbf8cc3faf","8a2e0126d074cdf9","f3a1f6cc3c64519a","85223e825abe6c57","505ecb13a921a73c"],"x":74,"y":1939,"w":1232,"h":322},{"id":"e7cfe992dd452213","type":"inject","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"Off","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":875,"y":2180,"wires":[["b42f3b4966c03bc6"]],"outputLabels":["Off"],"icon":"font-awesome/fa-toggle-off","l":false},{"id":"cf456a813390bef1","type":"link in","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"Kitchen Lights Voice Control","links":["98604b2c7370450c","703a475d0aa7c937"],"x":115,"y":2100,"wires":[["20ca46a708347dae"]],"icon":"font-awesome/fa-bullhorn"},{"id":"fff663f6920f375b","type":"inject","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":875,"y":2020,"wires":[["b42f3b4966c03bc6"]],"outputLabels":["On"],"icon":"font-awesome/fa-toggle-on","l":false},{"id":"c2aa48569444891a","type":"change","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"set state","rules":[{"t":"change","p":"values.state","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"values.state","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"values.state","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":2080,"wires":[["b42f3b4966c03bc6"]]},{"id":"4c7cf8357f744af6","type":"join","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":470,"y":2160,"wires":[["faffb92b83b98289"]]},{"id":"ef36e673212b7438","type":"change","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"set state","rules":[{"t":"change","p":"values.state","pt":"msg","from":"on","fromt":"str","to":"false","tot":"bool"},{"t":"change","p":"values.state","pt":"msg","from":"off","fromt":"str","to":"true","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"values.state","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":2120,"wires":[["b42f3b4966c03bc6"]]},{"id":"b42f3b4966c03bc6","type":"junction","z":"cd5687adb333d888","g":"b5294d0d812f30c8","x":940,"y":2100,"wires":[["41c7284bcd74ba4e"]]},{"id":"faffb92b83b98289","type":"stoptimer-varidelay","z":"cd5687adb333d888","g":"b5294d0d812f30c8","duration":"60","durationType":"num","units":"Minute","payloadtype":"str","payloadval":"off","name":"","reporting":"last_minute_seconds","persist":true,"ignoretimerpass":true,"x":640,"y":2160,"wires":[["ef36e673212b7438"],[],[]]},{"id":"41c7284bcd74ba4e","type":"switch","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1010,"y":2100,"wires":[["daa49330c5bc3be3"],["1134238105e132fa"]]},{"id":"1134238105e132fa","type":"hubitat command","z":"cd5687adb333d888","g":"b5294d0d812f30c8","deviceLabel":"","name":"","server":"","deviceId":"","command":"","commandArgs":"","x":1160,"y":2180,"wires":[[]]},{"id":"daa49330c5bc3be3","type":"hubitat command","z":"cd5687adb333d888","g":"b5294d0d812f30c8","deviceLabel":"","name":"","server":"","deviceId":"","command":"","commandArgs":"","x":1160,"y":2020,"wires":[[]]},{"id":"92fc70791ee29f4c","type":"junction","z":"cd5687adb333d888","g":"b5294d0d812f30c8","x":180,"y":2120,"wires":[["a7a3cbbbf8cc3faf"]]},{"id":"20ca46a708347dae","type":"switch","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"Time? Y/N","property":"values.number","propertyType":"msg","rules":[{"t":"istype","v":"undefined","vt":"undefined"},{"t":"istype","v":"string","vt":"string"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":2080,"wires":[["60764100a0a4b8e8"],["60764100a0a4b8e8","92fc70791ee29f4c"]]},{"id":"60764100a0a4b8e8","type":"junction","z":"cd5687adb333d888","g":"b5294d0d812f30c8","x":420,"y":2080,"wires":[["c2aa48569444891a"]]},{"id":"bc5e2b4a0c8faa25","type":"function","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"Text2Number","func":"var Small = {\n 'zero': 0,\n 'one': 1,\n 'two': 2,\n 'three': 3,\n 'four': 4,\n 'five': 5,\n 'six': 6,\n 'seven': 7,\n 'eight': 8,\n 'nine': 9,\n 'ten': 10,\n 'eleven': 11,\n 'twelve': 12,\n 'thirteen': 13,\n 'fourteen': 14,\n 'fifteen': 15,\n 'sixteen': 16,\n 'seventeen': 17,\n 'eighteen': 18,\n 'nineteen': 19,\n 'twenty': 20,\n 'thirty': 30,\n 'forty': 40,\n 'fifty': 50,\n 'sixty': 60,\n 'seventy': 70,\n 'eighty': 80,\n 'ninety': 90\n};\n\nvar Magnitude = {\n 'thousand': 1000,\n 'million': 1000000,\n 'billion': 1000000000,\n 'trillion': 1000000000000,\n 'quadrillion': 1000000000000000,\n 'quintillion': 1000000000000000000,\n 'sextillion': 1000000000000000000000,\n 'septillion': 1000000000000000000000000,\n 'octillion': 1000000000000000000000000000,\n 'nonillion': 1000000000000000000000000000000,\n 'decillion': 1000000000000000000000000000000000,\n};\n\nvar a, n, g;\n\n\nmsg.values.number = text2num(msg.values.number);\nreturn msg;\n\n\n\n\n\nfunction text2num(s) {\n a = s.toString().split(/[\\s-]+/);\n n = 0;\n g = 0;\n a.forEach(feach);\n return n + g;\n}\n\nfunction feach(w) {\n var x = Small[w];\n if (x != null) {\n g = g + x;\n }\n else if (w == \"hundred\") {\n g = g * 100;\n }\n else {\n x = Magnitude[w];\n if (x != null) {\n n = n + g * x\n g = 0;\n }\n else { \n alert(\"Unknown number: \"+w); \n }\n }\n}\n\nfunction alert(arg0) {\nthrow new Error(\"Function not implemented.\");\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":2160,"wires":[["8a2e0126d074cdf9"]]},{"id":"a7a3cbbbf8cc3faf","type":"change","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"set units","rules":[{"t":"set","p":"units","pt":"msg","to":"values.units","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":2120,"wires":[["4c7cf8357f744af6"]]},{"id":"8a2e0126d074cdf9","type":"change","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"set numbers","rules":[{"t":"set","p":"delay","pt":"msg","to":"values.number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":2200,"wires":[["4c7cf8357f744af6"]]},{"id":"f3a1f6cc3c64519a","type":"comment","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"Light OFF Command in Hubitat","info":"","x":1150,"y":2220,"wires":[]},{"id":"85223e825abe6c57","type":"comment","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"Light ON Command in Hubitat","info":"","x":1160,"y":1980,"wires":[]},{"id":"505ecb13a921a73c","type":"comment","z":"cd5687adb333d888","g":"b5294d0d812f30c8","name":"node-red-contrib-stoptimer-varidelay node","info":"","x":660,"y":2200,"wires":[]}]

I haven't found brief mode to be a problem with the way I use Alexa. In fact, I prefer she say very little unless it's something I've intentionally set up for her to say.

I'm not totally sure about this, but I think the programmed responses in the function nodes are generally what stops Alexa from saying she doesn't understand. If your flow gets to those first, it keeps her from spouting off (most of the time.) :wink:

EDIT: Just to add a bit more to the previous paragraph, one thing I noticed by combing through the debug messages is that often I get back numerous messages from Alexa via the On Device Activity node that aren't expressed verbally by Alexa. I'm certainly no Alexa developer, so I could be totally wrong about this, but it appears that Alexa first try to process the verbal command it receives locally using the blueprint skill then, if it's not successful, it reaches out to the servers to process the information.

So, when I say, Alexa turn on the light in the living room for ten minutes, I'll see messages come back that simply say, "Turn off the light in the living room" (which is something I have in my blueprint skill. Alexa doesn't say it because by then another message has come in prompting the function node to give her the correct message. Every now and then this doesn't happen and she will start to say something (like her I don't understand message) and then the function node message will cut her off. Sometimes she will even get out her complete "I don't understand message" and immediately follow it up with the message she was supposed to say from the function node.

If someone around here knows how to completely stop her from going to the servers without permission all of that nonsense could probably be avoided. There do seem to be some custom nodes out there that do exactly that, but most of them require some kind of log in to someone else's server. I'm already not a fan of sharing info with Amazon, but I'm even less keen on doing that with a total stranger.

Over in the hubitat community there is a large contingent of users who do everything off line and locally. I poke around over there and see if anyone has come up with a solution, as node-red is pretty popular with that group.

I'd love to hear any thoughts any on here has about this and any insight into how Alexa actually does things would be greatly appreciated.

On a slightly related note, if you're tired of the "by the way" BS she does, I have an Alexa routine that I run every day that pauses it. Basically I just created a new routine. I set it up to run everyday at midnight. Under "add action" I just typed, "Alexa, stop by the way." Now, everyday, at midnight, she will send a message indicating she will pause her "by the way" stuff.

any way to control Bass and Treble of the device similar to volume from dashboard?

Hi @DiverRich , i got inspired by you and have no almost all my logic managed via the applestrudel and even figured out on how to mute Alexa :slight_smile:

how to silence Alexa?

  1. make sure you only process valid commands (proceed with otherwise )
    image

  2. do not respond to your own response (starting with "OK, I will" .. see 4)
    image

  3. Send a "Alexa,stop" command to halt all alexa messages
    image

  4. After completing your NLP with ecolect.. just send out a status messgae (starting with "OK,I will" or any other intro you prefer!.. I generate the paylod in the function.

[{"id":"f20ee35d794d5067","type":"function","z":"618ae5b5e96f5c17","g":"1b72ec5a987bd28d","name":"response","func":"let response = "OK,I will " + msg.values.task + " the " + msg.values.device;\n\nif (typeof msg.values.location !== 'undefined') response += " in " + msg.values.location\n\nif (msg.topic=="on_off")\n{\n if (typeof msg.values.settemp !== 'undefined') response += " to " + msg.values.settemp.value\n if (typeof msg.values.setlevel !== 'undefined') response += " to " + msg.values.setlevel;\n\n} else if (msg.topic == "increase")\n{\n if (typeof msg.values.settemp !== 'undefined') response += " by " + msg.values.settemp.value\n if (typeof msg.values.setlevel !== 'undefined') response += " by " + msg.values.setlevel;\n\n}else\n{\n response = "OK,I will check the " + msg.values.device;\n if (typeof msg.values.location !== 'undefined') response += " in the " + msg.values.location\n}\n\nmsg.payload = response;\nreturn msg; ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":,"x":1100,"y":1140,"wires":[["b30293c334c10b2f","b094ade4df4b6314"]]}]

  1. send out your update statement
    image

It works fine for me so far ... I just have to finetune the ECOLECT configuration a bit.

Question on ECOLECT:

  • for me the constructor for DATE, TIME and DATE/TIME is not working (it crashes with undefined constructor message) ... does anybody else has this issue?
  • is there a more recent and supported module for NLP with similar functionality as ECOLECT?

@dynamicdave I did setup a Q&A blueprint originally , but it seems that it does not matter what is in this blueprint as I now manage all requests with ECOLECT ... What is the benefit of the Q&A?

2 Likes

Hello xx_Nexus_xx
could you please post your sample flow as code?
When I try to import it in node-red it throws an error.

Regarding your question about the Q&A.
I guess the idea with the Q&A is avoiding Alexa to complain about unknown commands, but it seems you solved that problem with the stop message, and that is why I'm interested in your sample flow.
Thanks!

Yeah, that was my understanding with the Q&A blueprint as well .. but it did not pass the "WIFE" testing and kept throwing alexa responses.

here is my "Try & Error" code .. (does need clean-up and optimization)

Alexa_QA.json (15.3 KB)

Update: I had muted Alexa too much , now im announcing all Alexa messages which are not covered by my NLP (using fail option and the template)

let me know your experience:

  • does it mute Alexa for you all the time (i had 2 Alexa responses in 24h and need to check why)
  • is the response quick enough (sometimes my 2nd Alexa-Output of response takes a few seconds to execute)

FYI ... it should understand most commands for the device (see ECOLECT module)
e.g:... (the modules to execute the commands are not here!)

  • Alexa, turn on Office Light
  • Alexa, set office light to 10%
  • Alexa, set office light to blue
  • Alexa, turn on the light in the office
  • Alexa, is the light in office on?
  • Alexa, what is the temperature in office?
    etc
1 Like

@xx_Nexus_xx - Nice! This is good stuff. Very smart. I'm looking forward to playing around with this. One problem I'm still trying to fix is after giving Alexa a command, she gives her reply and does the thing, but then about 30 seconds later she repeats her reply. Are you seeing that issue too?

At this point I've managed to get Alexa to control my ceiling/exhaust fans, lights, and hubitat modes. My current project is having her give me custom status reports for things like battery status of fire alarms and contact sensors, or status of open windows and doors, etc. It's still a work in progress though.

I also have issues with the date/time stuff and numbers as well. If you check post reply 86 @dynamicdave and I came up with a novel way of dealing with the time problem. I'm not using specific times for things (yet) so we will have to rely on @dynamicdave to tell us if it's effective.

I also had lots of problems with numbers (integers) in general. I sorted out most of that in reply 101, but later I realized I misspelled the word "forty" in my ecloect node and then duplicated it a bunch. That created some headaches until I figured out what I'd done. :joy:

As for the q&A you're probably right that it's not necessary. I don't see it doing much most of the time. The main exception is for phrases that I haven't incorporated into ecolect yet. For some reason there are still certain phrases that Alexa seems to try to process via the cloud, particularly when I try to set a hubitat node. She will always start to respond that "modes are not supported" and then she cuts herself off and changes the mode as requested. I also have a hell of a time getting her to set my ceiling fans to "medium." She will do high and low all day long. Say "medium" and she plays dumb. And don't even get me started on her inability to understand the word "ludicrous." I honestly have no idea what that's all about. :joy:

yes, I have this issue sometimes .. I'm now adding those alexa phrases in the "Ignore" node
image
this helps to stop those phrases

I had similar problems with numbers ... and solved it with the "STRING" node .. replacing numbers like "forty" with 40 ...at moment I only do increments of 5 .. but it works for me :wink:

my flow is managing HIGH,MEDIUM,LOW nicely .. as well setting colors for light :wink: ... have a more detailed look

1 Like

I have another problem ... the Alexa routine node sometimes takes ages to send out a speak command
image

sometimes this stays in "sending" state for 20-40seconds
image

Anybody else is having this issue ... or does even have a soltion for it ?

Hey Community,
When I try to ask alexa a question and then derive a flow from it, the first thing she always says is:
"I am unfortunately not sure"

and then the flow begins.

or: (just an example)
If I ask: how many people are in the house

Here is a response from an Alexa Answers user.......
.... then the flow begins

Is there any way I can respond to this?

@MrThiemann - I have never heard her say that, but she does seem to have a whole book of programmed excuses for not understanding me. :joy: Do you have an example flow you can post? That might help narrow down the problem.

Hi @MrThiemann , you are in the same boat as all of us :wink: ... welcome to the party .. if you read my previous posts, I attack the issue by sending a "stop" command back to Alexa.. this will stop execution usuallly before it is announce .. sometimes Alex does start :frowning: but will than be stopped :wink:

I have a "ignore" node where I add all the sentences Alexa is anoying me with ...as @DiverRich rightly said , there is whole book of excuses :wink: just add the common part of it as below
image

image

give it a try :wink:

I use the examples from here =) they are amazing !
but I'll show you mine :wink:

[
    {
        "id": "4af9baa52f6636b1",
        "type": "alexa-remote-event",
        "z": "536ecdf8206cbd81",
        "name": "",
        "account": "fecda501cb2f9724",
        "event": "ws-device-activity",
        "x": 3770,
        "y": 1060,
        "wires": [
            [
                "89d0c2c4bf0fde07",
                "dc10cb97c304215c",
                "3983b07be038bb78"
            ]
        ]
    },
    {
        "id": "89d0c2c4bf0fde07",
        "type": "function",
        "z": "536ecdf8206cbd81",
        "name": "Capture question",
        "func": "var 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: device_name,\n        payload: {\n            \"summary\": summary\n        }\n}\n    node.status({text:\"Device_name is \"+ device_name + \" Summary = \" + summary});\n    return msg;\n}\nelse {\n    return null;\n}",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 4010,
        "y": 1060,
        "wires": [
            [
                "8702745c55d4cf58"
            ]
        ]
    },
    {
        "id": "8702745c55d4cf58",
        "type": "debug",
        "z": "536ecdf8206cbd81",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 4250,
        "y": 1060,
        "wires": []
    },
    {
        "id": "dc10cb97c304215c",
        "type": "debug",
        "z": "536ecdf8206cbd81",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 3970,
        "y": 1120,
        "wires": []
    },
    {
        "id": "3983b07be038bb78",
        "type": "switch",
        "z": "536ecdf8206cbd81",
        "name": "",
        "property": "payload.summary",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "turn on telegram",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "turn off telegram",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "turn telegram on",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "turn telegram off",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "how many people are in the house",
                "vt": "str"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "false",
        "repair": false,
        "outputs": 6,
        "x": 3770,
        "y": 1260,
        "wires": [
            [],
            [],
            [],
            [],
            [
                "ae604ccc08a77a53"
            ],
            []
        ]
    },
    {
        "id": "ae604ccc08a77a53",
        "type": "function",
        "z": "536ecdf8206cbd81",
        "name": "",
        "func": "// msg.name =\"study\";\nmsg.payload = \"i dont know\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 3980,
        "y": 1280,
        "wires": [
            [
                "46d2323326c733c4",
                "5a67900add4295c3"
            ]
        ]
    },
    {
        "id": "46d2323326c733c4",
        "type": "alexa-remote-routine",
        "z": "536ecdf8206cbd81",
        "name": "Alexa device",
        "account": "fecda501cb2f9724",
        "routineNode": {
            "type": "speak",
            "payload": {
                "type": "announcement",
                "text": {
                    "type": "msg",
                    "value": "payload"
                },
                "devices": {
                    "type": "msg",
                    "value": "device_name"
                }
            }
        },
        "x": 4250,
        "y": 1280,
        "wires": [
            []
        ]
    },
    {
        "id": "5a67900add4295c3",
        "type": "debug",
        "z": "536ecdf8206cbd81",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 4130,
        "y": 1340,
        "wires": []
    },
    {
        "id": "fecda501cb2f9724",
        "type": "alexa-remote-account",
        "name": "alexa",
        "authMethod": "proxy",
        "proxyOwnIp": "192.168.178.104",
        "proxyPort": "3456",
        "cookieFile": "/home/authFile",
        "refreshInterval": "3",
        "alexaServiceHost": "layla.amazon.de",
        "amazonPage": "amazon.de",
        "acceptLanguage": "de-DE",
        "onKeywordInLanguage": "on",
        "userAgent": "",
        "useWsMqtt": "on",
        "autoInit": "on"
    }
]```

I've been here in the thread all morning =) I haven't been able to read everything yet. but I skimmed your flow briefly.
that would be awesome if that was the key to success.

I try it

Reading through the recent posts on this thread, I can see that people have really "pushed the envelope" on what can be achieved with the language processing node (ecolect). I must admit I gave up on using it when I struggled to get it to understand 'times' and 'numerals'.

The flow posted as item 106 by @xx_Nexus_xx has rekindled my interest in experimenting with ecolect.

1 Like

Hi @dynamicdave , yes the issue with TIME is a bummer :frowning: ...but there are several ways to handle the numerals

  • replace the numerals with the "STRING" node (as I did for testing purposes)
  • put the numerals in as ENUMERATIONS in ECOLECT node (as @DiverRich has done)

I think @DiverRich has as well found a work-around for TIME ... but I have not tested that

yea .. its real fun :slight_smile:

1 Like

Welcome back to the dark side @dynamicdave. :smiling_imp:

1 Like

I bought a set of these LED-floodlights last week and fixed them to other side of the top of my garage wall.

The lights are operated by a Sonoff S26 controlled, via MQTT, by a flow in my home automation system.

At the weekend I thought... "I think I could control them so I could turn them on/off on demand"

It took just under 10-minutes to put this idea into reality (and most of that time was spent in Amazon Blueprints creating the commands).

So I can say say... "Alexa, turn on/off garage drive" and lo-and-behold there is light!!

As shown below, a small enhancement was needed to my NR flow.

turn_on_off_garage_drive

One thing I did a couple of months ago was to capture the 'alexaResponse' as well as 'alexaSummary'.

This is useful as you can 'trap' the single response you get from Blueprints when you ask Alexa to perform a command that has variations.

Here's the code in Capture alexaResponse.

var device_name = msg.payload.name;
var summary = msg.payload.description.summary;

if ((summary == "")) {
    let response = msg.payload.alexaResponse;
    
    msg.payload = {};

    msg = {
        topic: "Alexa_response",
        device_name: device_name,
        payload: {
            "alexaResponse": response
        }
        
    }
    node.status({text:"Device_name is "+ device_name + " AlexaResponse = " + response});
    return msg;
}
else {
    return null;
}

And here's the code in Capture question.

var device_name = msg.payload.name;
var summary = msg.payload.description.summary;

if ((summary != "alexa") && (summary != "")) {
     
    msg.payload = {};

    msg = {
        topic: "Alexa_response",
        device_name: device_name,
        payload: {
            "summary": summary
        }
        
    }
    node.status({text:"Device_name is "+ device_name + " Summary = " + summary});
    return msg;
}
else {
    return null;
}

3 Likes