Watson IoT Chatbot with GrovePi

A chatbot capable of activating peripherals with voice control using IBM watson services

[{"id":"bbeaec92.6ae148","type":"microPi","z":"60bbfd36.a6b204","name":"microPi","filename":"/home/pi/demo.wav","domain":"http://localhost:1880/getAudio","rate":"16000","bitwidth":"16","endian":"little","encoding":"signed-integer","channels":"1","silence":"5","debug":"false","mode":"","x":555,"y":359,"wires":[["195c4593.4ca8da"],["407b286c.1a8058","3b0698b6.9c30f8"],["df0b4ec9.17c168"]]},{"id":"8260d2d4.aad1f8","type":"inject","z":"60bbfd36.a6b204","name":"record","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":125,"y":499,"wires":[["bbeaec92.6ae148"]]},{"id":"78dafa8f.4c094c","type":"inject","z":"60bbfd36.a6b204","name":"stop","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"x":125,"y":539,"wires":[["bbeaec92.6ae148"]]},{"id":"5a20e2f8.4818fc","type":"http in","z":"60bbfd36.a6b204","name":"","url":"/record","method":"post","swaggerDoc":"","x":137,"y":340,"wires":[["7c302957.37777"]]},{"id":"5a29c60c.512058","type":"http in","z":"60bbfd36.a6b204","name":"","url":"/stop","method":"post","swaggerDoc":"","x":135,"y":379,"wires":[["7c302957.37777"]]},{"id":"7c302957.37777","type":"function","z":"60bbfd36.a6b204","name":"","func":"if(msg.payload.recording == \"true\") {\n    return {payload:true};\n} else if(msg.payload.recording == \"false\"){\n    return {payload:false};\n}\n","outputs":1,"noerr":0,"x":285,"y":359,"wires":[["bbeaec92.6ae148"]]},{"id":"195c4593.4ca8da","type":"debug","z":"60bbfd36.a6b204","name":"Raw L16 Wave Stream","active":false,"console":"false","complete":"true","x":885,"y":299,"wires":[]},{"id":"407b286c.1a8058","type":"debug","z":"60bbfd36.a6b204","name":"Wav File as a Buffer and metadata","active":false,"console":"false","complete":"true","x":915,"y":359,"wires":[]},{"id":"df0b4ec9.17c168","type":"debug","z":"60bbfd36.a6b204","name":"Status Messages","active":false,"console":"false","complete":"true","x":865,"y":419,"wires":[]},{"id":"e8d81088.a2a09","type":"rpi-gpio in","z":"60bbfd36.a6b204","name":"","pin":"40","intype":"down","debounce":"1000","read":true,"x":125,"y":219,"wires":[["6c8b9d4d.e88834"]]},{"id":"6c8b9d4d.e88834","type":"function","z":"60bbfd36.a6b204","name":"","func":"if(msg.payload === 1)\n{ return {payload:true}; } \nelse \n{ return {payload:false}; }","outputs":1,"noerr":0,"x":285,"y":219,"wires":[["bbeaec92.6ae148"]]},{"id":"bee29747.5672c","type":"comment","z":"60bbfd36.a6b204","name":"Watson IoT Chatbot","info":"","x":165,"y":79,"wires":[]},{"id":"2b92844d.b7b504","type":"comment","z":"60bbfd36.a6b204","name":"Manual Triggers","info":"","x":155,"y":459,"wires":[]},{"id":"3b0698b6.9c30f8","type":"watson-speech-to-text","z":"60bbfd36.a6b204","name":"","continuous":true,"speakerlabels":false,"lang":"en-US","langhidden":"en-US","langcustomhidden":"","band":"BroadbandModel","bandhidden":"","password":"kC33PEJRoxl8","x":949.6299171447754,"y":617.4899940490723,"wires":[["971d9e62.7674"]]},{"id":"e9a6d8d6.3c96a","type":"watson-conversation-v1","z":"60bbfd36.a6b204","name":"IoT-Chatbot","workspaceid":"41dcc06d-964e-420d-8bdc-8346346b6ca2","multiuser":false,"context":false,"x":665,"y":1159,"wires":[["d59eb14b.8fabd","5d765bd6.554f44","7fa01c74.235ee4"]]},{"id":"7fa01c74.235ee4","type":"debug","z":"60bbfd36.a6b204","name":"","active":true,"console":"false","complete":"payload.context","x":871.666748046875,"y":1094,"wires":[]},{"id":"2ad2c5c8.8f69ea","type":"comment","z":"60bbfd36.a6b204","name":"The Iot Chatbot with Watson Conversations","info":"{\n  \"url\": \"https://gateway.watsonplatform.net/conversation/api\",\n  \"password\": \"qUtAULrvRkoL\",\n  \"username\": \"34b7b50f-0d49-4e19-9c50-a19b43aa2be6\"\n}","x":605,"y":959,"wires":[]},{"id":"971d9e62.7674","type":"change","z":"60bbfd36.a6b204","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"transcription","tot":"msg"},{"t":"set","p":"data","pt":"msg","to":"transcription","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"human","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1135,"y":659,"wires":[["4704c47e.166c6c","bbd7fbb3.33066","ef82e9f1.be6e"]]},{"id":"4704c47e.166c6c","type":"debug","z":"60bbfd36.a6b204","name":"","active":false,"console":"false","complete":"payload","x":1285,"y":619,"wires":[]},{"id":"df413168.f91a7","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn on the green led","payloadType":"str","repeat":"","crontab":"","once":false,"x":175,"y":1079,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"d59eb14b.8fabd","type":"change","z":"60bbfd36.a6b204","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.output.text[0]","tot":"msg"},{"t":"set","p":"data","pt":"msg","to":"payload.output.text[0]","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"watson","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1175,"y":1299,"wires":[["bbd7fbb3.33066","3988ff64.6c4d68","8fccdba5.154168","5755650e.c235ec"]]},{"id":"a08a3059.d57938","type":"comment","z":"60bbfd36.a6b204","name":"Speech to Text with Watson","info":"{\n  \"url\": \"https://stream.watsonplatform.net/speech-to-text/api\",\n  \"password\": \"kC33PEJRoxl8\",\n  \"username\": \"c1e266cd-fe6a-4b16-94b9-7f11501d4432\"\n}","x":1035,"y":539,"wires":[]},{"id":"8d0b472f.c069","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Hello","payloadType":"str","repeat":"","crontab":"","once":false,"x":125,"y":1019,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"e0fe5370.75089","type":"debug","z":"60bbfd36.a6b204","name":"Display Color","active":true,"console":"false","complete":"payload","x":1634,"y":1933,"wires":[]},{"id":"fc5518b4.961e5","type":"inject","z":"60bbfd36.a6b204","name":"display color red","topic":"","payload":"Change the display color to red","payloadType":"str","repeat":"","crontab":"","once":false,"x":155,"y":1279,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"628b2bf9.e2bb64","type":"inject","z":"60bbfd36.a6b204","name":"display color yellow","topic":"","payload":"Change the display color to yellow","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1299,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"c3a9e70f.0ae018","type":"inject","z":"60bbfd36.a6b204","name":"display color green","topic":"","payload":"Change the display color to green","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1319,"wires":[["e9a6d8d6.3c96a"]]},{"id":"5c7666f3.bae3c","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn on the blue led","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1099,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"a1482f4.711025","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn on the red led","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1119,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"15e89829.040648","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn on the buzzer","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1379,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"5d765bd6.554f44","type":"function","z":"60bbfd36.a6b204","name":"Context Demultiplexer","func":"global.set('text_input',msg.payload.context.text_input === true ? true : false);\n\nreturn  [\n            {payload:(msg.payload.context.led_green === true ? \"254\" : \"0\")},\n            {payload:(msg.payload.context.led_yellow === true ? \"254\" : \"0\")},\n            {payload:(msg.payload.context.led_red === true ? \"254\" : \"0\")},\n            {payload:(msg.payload.context.buzzer === true ? \"1\" : \"0\")},\n            {payload:(String(msg.payload.context.diplay_color)||false)},\n            {payload:(msg.payload.context.text_input === true ? true : false)},\n            {data:msg.payload.context, topic:context}\n        ];\n","outputs":"7","noerr":0,"x":1215,"y":1759,"wires":[["bbc65043.4d11f"],["16f6a972.173ff7"],["1f75584.4b30da8"],["85855c23.f56b7"],["e0fe5370.75089","f3e12bf.e693cd8"],["5715483d.3b4518"],["dee5a6cd.21029"]]},{"id":"2e8c9788.c5dd1","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn off the green led","payloadType":"str","repeat":"","crontab":"","once":false,"x":175,"y":1179,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"8336893a.190e2","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn off the blue led","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1199,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"878b308e.178a08","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn off the red led","payloadType":"str","repeat":"","crontab":"","once":false,"x":165,"y":1219,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"66e1d49e.374b5c","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"Turn off the buzzer","payloadType":"str","repeat":"","crontab":"","once":false,"x":165.25,"y":1423.75,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"296f9e94.6ca1f2","type":"function","z":"60bbfd36.a6b204","name":"","func":"msg.params.context=\"reset\";\nreturn msg;","outputs":1,"noerr":0,"x":185,"y":959,"wires":[["e9a6d8d6.3c96a","9fdd14b0.ee124"]]},{"id":"6e70ed28.bd8bcc","type":"inject","z":"60bbfd36.a6b204","name":"Reset Context","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":147.5,"y":959,"wires":[["296f9e94.6ca1f2"]]},{"id":"19bf2496.2b0ebb","type":"comment","z":"60bbfd36.a6b204","name":"Restful Triggers","info":"","x":155,"y":299,"wires":[]},{"id":"1ef55773.e74859","type":"comment","z":"60bbfd36.a6b204","name":"GPIO Trigger for Push to Talk","info":"","x":195,"y":179,"wires":[]},{"id":"3717fd48.4a5cfa","type":"comment","z":"60bbfd36.a6b204","name":"Recording Audio with MicroPi","info":"","x":615,"y":219,"wires":[]},{"id":"e8d95f53.f17958","type":"comment","z":"60bbfd36.a6b204","name":"Demo Commands","info":"{\n  \"url\": \"https://gateway.watsonplatform.net/conversation/api\",\n  \"password\": \"qUtAULrvRkoL\",\n  \"username\": \"34b7b50f-0d49-4e19-9c50-a19b43aa2be6\"\n}","x":165,"y":919,"wires":[]},{"id":"5791d6e2.a1082","type":"comment","z":"60bbfd36.a6b204","name":"Text to Speech and Playback in the Browser","info":"{\n  \"url\": \"https://gateway.watsonplatform.net/conversation/api\",\n  \"password\": \"qUtAULrvRkoL\",\n  \"username\": \"34b7b50f-0d49-4e19-9c50-a19b43aa2be6\"\n}","x":1315,"y":1239,"wires":[]},{"id":"547795fe.f3ea54","type":"comment","z":"60bbfd36.a6b204","name":"Context Parsing and Output Logic","info":"{\n  \"url\": \"https://gateway.watsonplatform.net/conversation/api\",\n  \"password\": \"qUtAULrvRkoL\",\n  \"username\": \"34b7b50f-0d49-4e19-9c50-a19b43aa2be6\"\n}","x":1415,"y":1599,"wires":[]},{"id":"acad8ec8.3e0ae","type":"debug","z":"60bbfd36.a6b204","name":"","active":false,"console":"false","complete":"payload","x":2445,"y":879,"wires":[]},{"id":"5b243383.703964","type":"template","z":"60bbfd36.a6b204","name":"Convert to CSV","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{timestamp}},{{topic}},{{data}};","x":1935,"y":859,"wires":[["3a5f19eb.5151c6","31e52a6b.998006","92c46891.0ab7f"]]},{"id":"3a5f19eb.5151c6","type":"debug","z":"60bbfd36.a6b204","name":"","active":false,"console":"true","complete":"true","x":2425,"y":839,"wires":[]},{"id":"9fdd14b0.ee124","type":"change","z":"60bbfd36.a6b204","name":"","rules":[{"t":"set","p":"data","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"human","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":674.9999389648438,"y":1209,"wires":[["bbd7fbb3.33066","df33b36e.d7ef3","81d802da.e040f"]]},{"id":"31e52a6b.998006","type":"file","z":"60bbfd36.a6b204","name":"","filename":"","appendNewline":true,"createDir":true,"overwriteFile":"false","x":2225,"y":919,"wires":[]},{"id":"a98d8d07.0af2f","type":"function","z":"60bbfd36.a6b204","name":"Join Data Streamsfile","func":"var context = this.context.flow;\ncontext.data = context.data || new Object();\n\n//Wait for information and store it when it comes\nswitch (msg.topic) {\n    case \"watson\":\n        context.data.watson = msg.watson;\n        context.data.context = msg.payload.context;\n        msg = null;\n        break;\n    case \"human\":\n        context.data.human = msg.human;\n        msg = null;\n        break;\n    default:\n        msg = null;\n    \tbreak;\n}\n\n\n\n//When all the data bins are filled, send out the information in one clump\nif(context.data.human !== null && context.data.watson !== null) {\n    //create date object from timestamp injected in\n    var dt = new Date(); \n    context.data.timestamp = new Date().toString();\n\n    //Create Filename that data will be saved to\n    msg = new Object();\n    msg.filename = \"/home/pi/IoTChatbot-log.csv\";\n    msg.payload = context.data;\n\treturn msg;\n\tcontext.data=null;\n\t\n} else return null; //msg;\n\n\n\n\n\n\n\n","outputs":1,"noerr":0,"x":1955,"y":899,"wires":[[]]},{"id":"bbd7fbb3.33066","type":"function","z":"60bbfd36.a6b204","name":"Timestamp","func":"    //create date object from timestamp injected in\n    var dt = new Date(); \n    msg.timestamp = new Date().toString();\n\n    msg.filename = \"/home/pi/IoTChatbot-log.csv\";\n\treturn msg;","outputs":1,"noerr":0,"x":1866.4287109375,"y":799.0000610351562,"wires":[["5b243383.703964"]]},{"id":"92c46891.0ab7f","type":"file in","z":"60bbfd36.a6b204","name":"","filename":"","format":"utf8","x":2225,"y":959,"wires":[["acad8ec8.3e0ae"]]},{"id":"dee5a6cd.21029","type":"json","z":"60bbfd36.a6b204","name":"","x":1309.28564453125,"y":1871.8571166992188,"wires":[["bbd7fbb3.33066"]]},{"id":"311029f5.153d5e","type":"watson-speech-to-text-v1-query-builder","z":"60bbfd36.a6b204","name":"","password":"kC33PEJRoxl8","stt-custom-mode":"getCustomisation","stt-custom-model-name":"","stt-base-model":"fr-FR_BroadbandModel","base-model-hidden":"","stt-custom-model-description":"","stt-custom-id":"","stt-corpus-name":"","x":887.2333374023438,"y":679.0332946777344,"wires":[[]]},{"id":"3988ff64.6c4d68","type":"watson-text-to-speech","z":"60bbfd36.a6b204","name":"","lang":"en-US","langhidden":"en-US","voice":"en-US_MichaelVoice","voicehidden":"","format":"audio/wav","password":"T4EzLHPVszBW","x":1246.2333984375,"y":1353.300048828125,"wires":[["19391669.492d62"]]},{"id":"19391669.492d62","type":"speakerpi-output","z":"60bbfd36.a6b204","choose":"filebased","filename":"","channels":"1","bitdepth":"8","samplerate":"22050","name":"","x":1524.2333984375,"y":1410.7666015625,"wires":[]},{"id":"6e75020f.bf033c","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"display some text","payloadType":"str","repeat":"","crontab":"","once":false,"x":154.36666870117188,"y":1505.7666015625,"wires":[["e9a6d8d6.3c96a"]]},{"id":"422a3733.4b1b6","type":"inject","z":"60bbfd36.a6b204","name":"","topic":"","payload":"hello world","payloadType":"str","repeat":"","crontab":"","once":false,"x":135.36666870117188,"y":1541.7666015625,"wires":[["ef82e9f1.be6e"]]},{"id":"8fccdba5.154168","type":"debug","z":"60bbfd36.a6b204","name":"","active":true,"console":"false","complete":"payload","x":1477.0999755859375,"y":1307.566650390625,"wires":[]},{"id":"df33b36e.d7ef3","type":"debug","z":"60bbfd36.a6b204","name":"","active":false,"console":"false","complete":"payload","x":794.388916015625,"y":1281.72216796875,"wires":[]},{"id":"d61cd747.adc848","type":"comment","z":"60bbfd36.a6b204","name":"Logging ","info":"","x":2142.3333740234375,"y":769.952392578125,"wires":[]},{"id":"ef82e9f1.be6e","type":"function","z":"60bbfd36.a6b204","name":"Input Switch by Global Context","func":"var text_input = global.get('text_input');\nif(text_input === true) {\n    var contextMsg = { payload:\"write text\"};\n    contextMsg.params = {context:msg.payload};\n    var text_input = false\n    var display_text = msg.payload;\n    contextMsg.params.context = {input_text: true,text_input:text_input,display_text:display_text};\n    global.set('text_input', false);\n    return [contextMsg,msg];\n} else {\n    return [msg,null];\n}","outputs":"2","noerr":0,"x":1076.0476684570312,"y":857.3809378487722,"wires":[["e9a6d8d6.3c96a"],["5715483d.3b4518"]]},{"id":"5715483d.3b4518","type":"debug","z":"60bbfd36.a6b204","name":"Display Text","active":true,"console":"false","complete":"payload","x":1625.9375,"y":2001.9375,"wires":[]},{"id":"6061a32d.a2dd3c","type":"watson-discovery-v1","z":"60bbfd36.a6b204","name":"","environmentname":"","environment_id":"","collection_id":"","configurationname":"","configuration_id":"","count":"1","query":"","filter":"","aggregation":"","return":"","discovery-method":"listEnvrionments","x":655.8334147135416,"y":1350.8333028157551,"wires":[[]]},{"id":"257a4ae7.18a6de","type":"watson-discovery-v1-query-builder","z":"60bbfd36.a6b204","name":"","password":"","environment":"","environmenthidden":"","collection":"","collectionhidden":"","query1":"","query1hidden":"","queryvalue1":"","queryvalue1hidden":"","query2":"","query2hidden":"","queryvalue2":"","queryvalue2hidden":"","query3":"","query3hidden":"","queryvalue3":"","queryvalue3hidden":"","x":704.1668090820312,"y":1385.8332824707031,"wires":[[]]},{"id":"96166cf3.c12708","type":"watson-translator","z":"60bbfd36.a6b204","name":"","action":"translate","basemodel":"","domain":"news","srclang":"en","destlang":"fr","password":"","custom":"","domainhidden":"","srclanghidden":"","destlanghidden":"","basemodelhidden":"","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":"lparams","ldparamshidden2":"","x":1189.1665649414062,"y":1467.5,"wires":[[]]},{"id":"55a64676.022ea8","type":"watson-tone-analyzer-v3","z":"60bbfd36.a6b204","name":"","tones":"all","sentences":"true","contentType":"false","x":954.1666259765625,"y":744.1666259765625,"wires":[[]]},{"id":"36f68ae6.7f4dc6","type":"watson-discovery","z":"60bbfd36.a6b204","name":"","environmentname":"","environment_id":"","collection_id":"","discovery-method":"listEnvrionments","x":654.1666259765625,"y":1316.2500305175781,"wires":[[]]},{"id":"1a495c92.1c08bb","type":"watson-translate","z":"60bbfd36.a6b204","name":"","action":"translate","basemodel":"","domain":"news","srclang":"en","destlang":"fr","password":"","custom":"","domainhidden":"","srclanghidden":"","destlanghidden":"","basemodelhidden":"","customhidden":"","filetype":"forcedglossary","trainid":"","lgparams2":"lparams","ldparamshidden2":"","x":1199.1666259765625,"y":1496.2499389648438,"wires":[[]]},{"id":"50add4af.e68e74","type":"watson-translate-util","z":"60bbfd36.a6b204","name":"","x":1207.5,"y":1526.25,"wires":[[]]},{"id":"7accc869.c209e8","type":"alchemy-date-extraction","z":"60bbfd36.a6b204","name":"","x":674.1666259765625,"y":1465.8333740234375,"wires":[[]]},{"id":"883602bc.f7101","type":"alchemy-feature-extract","z":"60bbfd36.a6b204","name":"","page-image":"","image-kw":"","feed":"","entity":"","keyword":"","title":"","author":"","taxonomy":"","concept":"","relation":"","pub-date":"","doc-sentiment":"","doc-emotion":"","entity-sentiment":"","entity-emotion":"","x":674.1665344238281,"y":1499.1666259765625,"wires":[[]]},{"id":"6c72dc49.476e04","type":"watson-personality-insights-v3","z":"60bbfd36.a6b204","name":"","inputlang":"en","outputlang":"en","rawscores":false,"consumption":false,"x":2186.8333740234375,"y":998.5,"wires":[[]]},{"id":"1f75584.4b30da8","type":"grovepi-led","z":"60bbfd36.a6b204","name":"LED red D4","pin":"4","set":"","x":1637.00390625,"y":1775.81640625,"wires":[]},{"id":"5755650e.c235ec","type":"play audio","z":"60bbfd36.a6b204","name":"","voice":"3","x":1483.37890625,"y":1360.359375,"wires":[]},{"id":"81d802da.e040f","type":"play audio","z":"60bbfd36.a6b204","name":"","voice":"3","x":989.765625,"y":1183.75,"wires":[]},{"id":"16f6a972.173ff7","type":"grovepi-led","z":"60bbfd36.a6b204","name":"LED blue D3","pin":"3","set":"","x":1644.765625,"y":1717,"wires":[]},{"id":"bbc65043.4d11f","type":"grovepi-led","z":"60bbfd36.a6b204","name":"LED green D2","pin":"2","set":"","x":1660.765625,"y":1663,"wires":[]},{"id":"85855c23.f56b7","type":"grovepi-buzzer","z":"60bbfd36.a6b204","name":"BUZZER D5","pin":"5","x":1630.00390625,"y":1836.08203125,"wires":[]},{"id":"5de1415e.44e5e","type":"grovepi-lcd-rgb","z":"60bbfd36.a6b204","name":"","x":1806.01171875,"y":1889.046875,"wires":[]},{"id":"f3e12bf.e693cd8","type":"function","z":"60bbfd36.a6b204","name":"","func":"switch (msg.payload) {\n    case \"green\": return [0,255,0];\n    case \"yellow\": return [0,0,255];\n    case \"red\": return [255,0,0];\n    default: return null;\n}\n","outputs":1,"noerr":0,"x":1623.37890625,"y":1889.01953125,"wires":[["5de1415e.44e5e","9f571040.2febd"]]},{"id":"9f571040.2febd","type":"debug","z":"60bbfd36.a6b204","name":"Display Color","active":true,"console":"false","complete":"payload","x":1826.765625,"y":1824.5,"wires":[]},{"id":"1ea5f49e.e65c3b","type":"grovepi-sound","z":"60bbfd36.a6b204","name":"Sound Sensor","pin":"0","x":127.01171875,"y":611.33203125,"wires":[["a8fea125.2ec91","4d13c991.3aa438"]]},{"id":"a8fea125.2ec91","type":"switch","z":"60bbfd36.a6b204","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"","vt":"num"}],"checkall":"true","outputs":1,"x":280.375,"y":605.921875,"wires":[[]]},{"id":"4d13c991.3aa438","type":"debug","z":"60bbfd36.a6b204","name":"","active":true,"console":"false","complete":"payload","x":299.765625,"y":644.25,"wires":[]},{"id":"6f84a0ae.98de","type":"grovepi-button","z":"60bbfd36.a6b204","name":"","pin":"6","x":298.00390625,"y":543.7421875,"wires":[["bbeaec92.6ae148"]]}]
MWals

Flow Info

created 4 months, 3 weeks ago

Node Types

Core
  • change (x3)
  • comment (x11)
  • debug (x13)
  • file (x1)
  • file in (x1)
  • function (x8)
  • http in (x2)
  • inject (x17)
  • json (x1)
  • rpi-gpio in (x1)
  • switch (x1)
  • template (x1)
Other

Tags

  • Chatbot
  • Alexa
  • IBM
  • Watson
  • iot
  • Grovepi
  • GrovePi+
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option