-
Notifications
You must be signed in to change notification settings - Fork 12
/
base_flows.json
1 lines (1 loc) · 16.8 KB
/
base_flows.json
1
[{"id":"d3b77140.585fb8","type":"tab","label":"Bus","disabled":false,"info":""},{"id":"c077860b.15b2c8","type":"tab","label":"Intents","disabled":false,"info":""},{"id":"4d420064.ac60a","type":"tab","label":"web_chat","disabled":false,"info":""},{"id":"912ce84b.a06ed","type":"tab","label":"Debug","disabled":false,"info":""},{"id":"1304b726.2ed479","type":"websocket-listener","z":"","path":"ws://nodered:[email protected]:6789","wholemsg":"false"},{"id":"43e2b615.4ef62","type":"ui_group","z":"","name":"Mycroft","tab":"68d2c379.6a7e9c","order":1,"disp":true,"width":"6","collapse":false},{"id":"68d2c379.6a7e9c","type":"ui_tab","z":"","name":"NodeRed HiveMind","icon":"dashboard","disabled":false,"hidden":false},{"id":"21ce041.146777c","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","reset":false},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Mycroft Chat","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"583dd526.5ed5e4","type":"ui_tab","z":"","name":"NodeRed HiveMind","icon":"dashboard","disabled":false,"hidden":false},{"id":"3501dbee.62a92c","type":"websocket in","z":"d3b77140.585fb8","name":"mycroft-in","server":"1304b726.2ed479","client":"","x":80,"y":160,"wires":[["503b6747.6d009","e4c60508.8dbfe"]]},{"id":"4ab1d329.e3fd8c","type":"websocket out","z":"d3b77140.585fb8","name":"mycroft-out","server":"1304b726.2ed479","client":"","x":570,"y":460,"wires":[]},{"id":"203beacc.26334e","type":"link out","z":"d3b77140.585fb8","name":"intents-out","links":["f2cf3139.09a1a","d58f5eba.01b87","4dd00d1d.66f08c"],"x":975,"y":120,"wires":[]},{"id":"832f08be.e73c18","type":"link in","z":"d3b77140.585fb8","name":"mycroft-out","links":["6cd02413.50dc4c","6e264383.34f004","1991ff96.63dba","aabdc698.feb8b","fe43b8e9.0dea3","2c755067.fb9e38","4b81b78c.4d184","34a86ce1.3591a4","d065e855.e0e84","ce0f46c1.54f16","6a7b0996.9bbe08","fc603f35.2940b"],"x":135,"y":420,"wires":[["94209cac.18b0c8"]]},{"id":"9f50556.0769fa8","type":"switch","z":"d3b77140.585fb8","name":"filter","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"node_red.fallback","vt":"str"},{"t":"eq","v":"node_red.converse","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":630,"y":120,"wires":[["328cecd8.83516c"],["328cecd8.83516c"]]},{"id":"2810667e.0acf9a","type":"comment","z":"d3b77140.585fb8","name":"Messages from Mycroft","info":"Incoming JSON payloads from Mycroft to Node-Red\n\n\n\t{\"type\": \"node_red.fallback\", \"data\": {\"utterance\": \"<text of utterance>\", \"norm_utt\": \"echo\", \"lang\": \"en-US\"}, \"context\": \t{\"client_name\": \"mycroft_listener\", \"source\": \"audio\", \"destination\": [\"skills\"]}}\n\n\n\t{\"type\": \"node_red.converse\", \"data\": {\"utterance\": \"<text of utterance>\"}, \"context\": {\"client_name\": \"mycroft_listener\", \"source\": \"audio\", \"destination\": [\"skills\"]}}","x":140,"y":40,"wires":[]},{"id":"e4c60508.8dbfe","type":"debug","z":"d3b77140.585fb8","name":"mycroft in","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":240,"y":100,"wires":[]},{"id":"77307c31.72b3e4","type":"comment","z":"d3b77140.585fb8","name":"Messages to Mycroft","info":"Outgoing JSON payloads from Node-Red to to Mycroft (TTS)\n\n\t{\"type\": \"node_red.answer\", \"data\": {\"utterance\": \"<answer from skill>\"},\"context\": {}}\n\n\t{\"type\": \"node_red.intent_failure\", \"data\":{\"utterance\" : \"<text of origional utterance>\"}, \"context\":{}}'}\n","x":350,"y":340,"wires":[]},{"id":"2016af75.cdaf38","type":"debug","z":"d3b77140.585fb8","name":"mycroft-out","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":380,"wires":[]},{"id":"503b6747.6d009","type":"json","z":"d3b77140.585fb8","name":"","property":"payload","action":"","pretty":false,"x":230,"y":160,"wires":[["94c4c102.1669b8"]]},{"id":"d8d35a66.cabb4","type":"link out","z":"d3b77140.585fb8","name":"mycroft_in","links":["eb47310c.240108"],"x":615,"y":220,"wires":[]},{"id":"328cecd8.83516c","type":"function","z":"d3b77140.585fb8","name":"extract utterance","func":"var msg = {payload: msg.payload.data.utterance};\nreturn msg","outputs":"1","noerr":0,"x":830,"y":120,"wires":[["203beacc.26334e"]]},{"id":"3d76151d.e3917a","type":"comment","z":"c077860b.15b2c8","name":"Handle Intents here","info":"Parse the utterance (msg.payload) and do something","x":730,"y":160,"wires":[]},{"id":"1ed3de75.bd73c2","type":"switch","z":"c077860b.15b2c8","name":"intents","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"verge","vt":"str"},{"t":"cont","v":"weather","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":290,"y":260,"wires":[["598b961a.41e87"],["f2bbeabf.d61318"],["34a3e8b6.f16478"]]},{"id":"4dd00d1d.66f08c","type":"link in","z":"c077860b.15b2c8","name":"intents-in","links":["203beacc.26334e"],"x":135,"y":260,"wires":[["1ed3de75.bd73c2","9898edf7.b94d7"]]},{"id":"d065e855.e0e84","type":"link out","z":"c077860b.15b2c8","name":"","links":["832f08be.e73c18"],"x":1315,"y":240,"wires":[]},{"id":"f2bbeabf.d61318","type":"http request","z":"c077860b.15b2c8","name":"http weather","method":"GET","ret":"obj","paytoqs":false,"url":"http://api.openweathermap.org/data/2.5/weather?lat=32.3&lon=-110.9&units=imperial&APPID=bb7088d09238c0f78fc90d2294812257","tls":"","persist":false,"proxy":"","authType":"","x":550,"y":280,"wires":[["ec119168.9330e"]]},{"id":"ec119168.9330e","type":"function","z":"c077860b.15b2c8","name":"select","func":"var msg = {payload: msg.payload.main.temp};\nreturn msg\n\n\n/* incoming payload to this node\n\n{\n\"coord\": {\n\"lon\": -110.9,\n\"lat\": 32.3\n},\n\"weather\": [\n{\n\"id\": 800,\n\"main\": \"Clear\",\n\"description\": \"clear sky\",\n\"icon\": \"01d\"\n}\n],\n\"base\": \"stations\",\n\"main\": {\n\"temp\": 98.31,\n\"feels_like\": 94.05,\n\"temp_min\": 98.01,\n\"temp_max\": 99,\n\"pressure\": 1015,\n\"humidity\": 11\n},\n\"wind\": {\n\"speed\": 1.99,\n\"deg\": 337,\n\"gust\": 5.01\n},\n\"clouds\": {\n\"all\": 0\n},\n\"dt\": 1588193187,\n\"sys\": {\n\"type\": 3,\n\"id\": 2007774,\n\"country\": \"US\",\n\"sunrise\": 1588163906,\n\"sunset\": 1588212184\n},\n\"timezone\": -25200,\n\"id\": 5288786,\n\"name\": \"Catalina Foothills\",\n\"cod\": 200\n}\n\n*/","outputs":"1","noerr":0,"x":750,"y":280,"wires":[["9933c806.d6fd1"]]},{"id":"9933c806.d6fd1","type":"template","z":"c077860b.15b2c8","name":"weather utterance","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Node-Red says the temperature is {{payload}}","output":"str","x":950,"y":280,"wires":[["2b63ddc8.f98bd2"]]},{"id":"598b961a.41e87","type":"http request","z":"c077860b.15b2c8","name":"http news rss","method":"GET","ret":"txt","paytoqs":false,"url":"http://www.theverge.com/rss/full.xml","tls":"","persist":false,"proxy":"","authType":"","x":550,"y":220,"wires":[["bbd957d7.d9d998"]]},{"id":"bbd957d7.d9d998","type":"xml","z":"c077860b.15b2c8","name":"format","property":"payload","attr":"","chr":"","x":690,"y":220,"wires":[["60aa9efa.834558"]]},{"id":"60aa9efa.834558","type":"function","z":"c077860b.15b2c8","name":"select","func":"var msg1 = {payload: msg.payload.feed.entry[0].title};\nvar msg2 = {payload: msg.payload.feed.entry[1].title};\n\nreturn [msg1, msg2];\n\n// attach a debug node to previous node to look at\n// news feed results","outputs":"1","noerr":0,"x":810,"y":220,"wires":[["775a27ea.014898"]]},{"id":"775a27ea.014898","type":"template","z":"c077860b.15b2c8","name":"news utterance","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The leading headline from The Verge, {{payload}}","output":"str","x":960,"y":220,"wires":[["2b63ddc8.f98bd2"]]},{"id":"9898edf7.b94d7","type":"debug","z":"c077860b.15b2c8","name":"utterance","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":300,"y":200,"wires":[]},{"id":"1b8d82f4.a2393d","type":"ui_text_input","z":"4d420064.ac60a","name":"user utterance","label":"","tooltip":"","group":"43e2b615.4ef62","order":2,"width":"6","height":"2","passthru":false,"mode":"text","delay":"0","topic":"","x":220,"y":160,"wires":[["99236ec4.0ce13"]]},{"id":"75bde567.ab956c","type":"ui_text","z":"4d420064.ac60a","group":"43e2b615.4ef62","order":1,"width":"6","height":"3","name":"mycroft utterance","label":"","format":"{{msg.payload}}","layout":"row-center","x":710,"y":80,"wires":[]},{"id":"d5c26b35.4c77d","type":"template","z":"4d420064.ac60a","name":"json payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"type\": \"node_red.query\", \n\"data\":{\"utterances\" : [\"{{payload}}\"]}, \n\"context\":{}}","output":"json","x":630,"y":160,"wires":[["ce0f46c1.54f16"]]},{"id":"149e99ee.e41f3e","type":"switch","z":"4d420064.ac60a","name":"speak filter","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"speak","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":80,"wires":[["d9a62dcf.48053"]]},{"id":"d9a62dcf.48053","type":"function","z":"4d420064.ac60a","name":"extract utterance","func":"var utterance = msg.payload.data.utterance;\n\nvar uout = {payload:utterance}\n\nreturn uout;\n","outputs":1,"noerr":0,"x":490,"y":80,"wires":[["75bde567.ab956c"]]},{"id":"ce0f46c1.54f16","type":"link out","z":"4d420064.ac60a","name":"","links":["832f08be.e73c18"],"x":775,"y":160,"wires":[]},{"id":"eb47310c.240108","type":"link in","z":"4d420064.ac60a","name":"chat_in","links":["d8d35a66.cabb4"],"x":155,"y":80,"wires":[["149e99ee.e41f3e"]]},{"id":"fc603f35.2940b","type":"link out","z":"912ce84b.a06ed","name":"","links":["832f08be.e73c18"],"x":715,"y":220,"wires":[]},{"id":"95f42bd5.f00818","type":"comment","z":"912ce84b.a06ed","name":"ask mycroft - answer in web chat","info":"","x":290,"y":60,"wires":[]},{"id":"c2d0d29b.c07ac","type":"template","z":"912ce84b.a06ed","name":"speak_broadcast","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.tts\",\n\"data\": {\n \"utterance\": \"{{payload}}\"\n},\n\"context\": {}\n}","output":"json","x":490,"y":200,"wires":[["fc603f35.2940b"]]},{"id":"4066f952.c1b6f8","type":"inject","z":"912ce84b.a06ed","name":"say hello world","topic":"","payload":"node-red says hello world","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":180,"y":200,"wires":[["c2d0d29b.c07ac"]]},{"id":"aef28530.19b728","type":"template","z":"912ce84b.a06ed","name":"ask json","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.query\",\n\"data\": {\n \"utterances\": [\"{{payload}}\"]\n},\n\"context\": {}\n}","output":"json","x":440,"y":100,"wires":[["fc603f35.2940b"]]},{"id":"e7034375.6efbe","type":"inject","z":"912ce84b.a06ed","name":"query hello world","topic":"","payload":"node-red says hello world","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":210,"y":100,"wires":[["aef28530.19b728"]]},{"id":"cfc13537.2b6d68","type":"template","z":"912ce84b.a06ed","name":"converse activate","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.converse.activate\",\n\"data\": {},\n\"context\": {}\n}","output":"json","x":410,"y":440,"wires":[["fc603f35.2940b"]]},{"id":"ae6f9a72.c426f","type":"inject","z":"912ce84b.a06ed","name":"enable converse","topic":"","payload":"node-red converse yes","payloadType":"str","repeat":"","crontab":"","once":false,"x":180,"y":440,"wires":[["cfc13537.2b6d68"]]},{"id":"ac53f3a.92e011","type":"template","z":"912ce84b.a06ed","name":"converse deactivate","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.converse.deactivate\",\n\"data\": {},\n\"context\": {}\n}","output":"json","x":400,"y":400,"wires":[["fc603f35.2940b"]]},{"id":"135318ff.e80047","type":"inject","z":"912ce84b.a06ed","name":"disable converse","topic":"","payload":"node-red converse no","payloadType":"str","repeat":"","crontab":"","once":false,"x":180,"y":400,"wires":[["ac53f3a.92e011"]]},{"id":"a7aede98.95286","type":"comment","z":"912ce84b.a06ed","name":"broadcast an utterance (trigger TTS)","info":"","x":300,"y":160,"wires":[]},{"id":"1592b8aa.4f8f8f","type":"comment","z":"912ce84b.a06ed","name":"node-red priority settings (converse on/off)","info":"","x":320,"y":360,"wires":[]},{"id":"16bffa71.256b96","type":"template","z":"912ce84b.a06ed","name":"mic_listen","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.listen\",\n\"data\": {},\n\"context\": {}\n}","output":"json","x":440,"y":300,"wires":[["fc603f35.2940b"]]},{"id":"acfae90d.1e7888","type":"inject","z":"912ce84b.a06ed","name":"listen","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":190,"y":300,"wires":[["16bffa71.256b96"]]},{"id":"feeae91f.54fc68","type":"comment","z":"912ce84b.a06ed","name":"make mycroft listen","info":"","x":310,"y":260,"wires":[]},{"id":"c8c7198d.d49308","type":"comment","z":"d3b77140.585fb8","name":"Utterance -> Intents","info":"Send utterance string for intent parsing","x":790,"y":60,"wires":[]},{"id":"1a2d81e8.6ee82e","type":"comment","z":"d3b77140.585fb8","name":"Raw json -> message handlers","info":"Handle random bus messages\n\nSample usage in webchat","x":770,"y":220,"wires":[]},{"id":"38299783.8ba01","type":"comment","z":"c077860b.15b2c8","name":"Intent Failure","info":"DO NOT DELETE\n\nThis allows mycroft to continue doing its thing, otherwise it will hang waiting for a timeout","x":570,"y":360,"wires":[]},{"id":"2b63ddc8.f98bd2","type":"template","z":"c077860b.15b2c8","name":"speak_payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.speak\",\n\"data\": {\n\"utterance\": \"{{payload}}\"\n},\n\"context\": {}\n}","output":"json","x":1180,"y":240,"wires":[["d065e855.e0e84"]]},{"id":"34a3e8b6.f16478","type":"template","z":"c077860b.15b2c8","name":"intent failure","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n\"type\": \"node_red.intent_failure\",\n\"data\": {\n\"utterance\": \"{{payload}}\"\n},\n\"context\": {}\n}","output":"json","x":550,"y":420,"wires":[["6a7b0996.9bbe08"]]},{"id":"6a7b0996.9bbe08","type":"link out","z":"c077860b.15b2c8","name":"","links":["832f08be.e73c18"],"x":675,"y":420,"wires":[]},{"id":"94c4c102.1669b8","type":"change","z":"d3b77140.585fb8","name":"save context","rules":[{"t":"set","p":"context","pt":"flow","to":"payload.context","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":160,"wires":[["9f50556.0769fa8","d8d35a66.cabb4"]]},{"id":"94209cac.18b0c8","type":"change","z":"d3b77140.585fb8","name":"set context","rules":[{"t":"set","p":"payload.context","pt":"msg","to":"context","tot":"flow"},{"t":"set","p":"payload.context.destination","pt":"msg","to":"context.source","tot":"flow"},{"t":"set","p":"payload.context.source","pt":"msg","to":"NodeRed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":420,"wires":[["4ab1d329.e3fd8c","2016af75.cdaf38"]]},{"id":"99236ec4.0ce13","type":"change","z":"4d420064.ac60a","name":"set context","rules":[{"t":"set","p":"context","pt":"flow","to":"{\"source\": \"NodeRedChat\", \"destination\":\"skills\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":160,"wires":[["d5c26b35.4c77d"]]}]