-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sues Alerter
1 lines (1 loc) · 12.2 KB
/
Sues Alerter
1
[{"id":"358dfc2d.7681c4","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"503681cd.7eedd8","type":"ui_tab","z":"","name":"Radio Control","icon":"settings input antenna"},{"id":"addfc647.16035","type":"ui_group","z":"","name":"Default","tab":"503681cd.7eedd8","disp":false,"width":"6","collapse":false},{"id":"b60726ee.8f3b28","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":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"},"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"}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"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":"723d9e6a.681e58","type":"serial-port","z":"","serialport":"/dev/ttyS0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"ÿÿÿ","bin":"false","out":"char","addchar":true},{"id":"fcd3b63d.f150f","type":"serial-port","z":"","serialport":"/dev/ttyS0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"50","bin":"bin","out":"time","addchar":true},{"id":"4d974e8e.7c1638","type":"twilio-api","z":"","name":"twillo","sid":"AC3f74afba3dd38ad9d5b12e1ff2c9f6f7","from":"+447480539176"},{"id":"f71d1184.704648","type":"serial out","z":"358dfc2d.7681c4","name":"","serial":"723d9e6a.681e58","x":690,"y":400,"wires":[]},{"id":"19ca2525.5cac8b","type":"serial in","z":"358dfc2d.7681c4","name":"","serial":"fcd3b63d.f150f","x":60,"y":20,"wires":[["2dd93e6a.8d4832"]]},{"id":"2dd93e6a.8d4832","type":"switch","z":"358dfc2d.7681c4","name":"Page","property":"payload.1","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":60,"wires":[["cc50abe.1a577d8"],["a9a8c4d2.746b08"]]},{"id":"cc50abe.1a577d8","type":"switch","z":"358dfc2d.7681c4","name":"Button","property":"payload.2","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":60,"wires":[["9c5be858.aea7"],["2e0136be.ca96b2"]]},{"id":"9c5be858.aea7","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"8","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":40,"wires":[["924bc352.4b8d18","63222cf8.1fe174"]]},{"id":"2e0136be.ca96b2","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"9","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":80,"wires":[["924bc352.4b8d18","63222cf8.1fe174"]]},{"id":"a9a8c4d2.746b08","type":"switch","z":"358dfc2d.7681c4","name":"Button","property":"payload.2","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"5","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":160,"wires":[["f71f641e.7a2f18"],["f3159412.f30de"],["6354c3d.82f26bc"]]},{"id":"f71f641e.7a2f18","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":120,"wires":[["924bc352.4b8d18","63222cf8.1fe174"]]},{"id":"f3159412.f30de","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":160,"wires":[["924bc352.4b8d18","63222cf8.1fe174"]]},{"id":"6354c3d.82f26bc","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":200,"wires":[["924bc352.4b8d18","63222cf8.1fe174"]]},{"id":"209d6872.e72758","type":"function","z":"358dfc2d.7681c4","name":"Page 1","func":"s_object = \"page 1\";\nvar arr = [];\nfor (var i = 0, l = s_object.length; i < l; i ++) {\n var ascii = s_object.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0xFF);\narr.push(0xFF);\narr.push(0xFF);\nmsg.payload = new Buffer(arr);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":360,"wires":[["f71d1184.704648"]]},{"id":"f766871d.3301b","type":"function","z":"358dfc2d.7681c4","name":"Page 2","func":"s_object = \"page 2\";\nvar arr = [];\nfor (var i = 0, l = s_object.length; i < l; i ++) {\n var ascii = s_object.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0xFF);\narr.push(0xFF);\narr.push(0xFF);\nmsg.payload = new Buffer(arr);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":400,"wires":[["f71d1184.704648"]]},{"id":"c91ebb8e.e03d18","type":"function","z":"358dfc2d.7681c4","name":"Page 0","func":"s_object = \"page 0\";\nvar arr = [];\nfor (var i = 0, l = s_object.length; i < l; i ++) {\n var ascii = s_object.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0xFF);\narr.push(0xFF);\narr.push(0xFF);\nmsg.payload = new Buffer(arr);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":320,"wires":[["f71d1184.704648"]]},{"id":"20a69060.353ad8","type":"function","z":"358dfc2d.7681c4","name":"Callout","func":"s_object = \"callout.txt=\";\ns_text = msg.payload;\nvar arr = [];\nfor (var i = 0, l = s_object.length; i < l; i ++) {\n var ascii = s_object.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0x22);\nfor (var i = 0, l = s_text.length; i < l; i ++) {\n var ascii = s_text.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0x22);\narr.push(0xFF);\narr.push(0xFF);\narr.push(0xFF);\nmsg.payload = new Buffer(arr);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":440,"wires":[["f71d1184.704648"]]},{"id":"86864cc1.d82b5","type":"inject","z":"358dfc2d.7681c4","name":"","topic":"","payload":"test","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":440,"wires":[["796505db.022134"]]},{"id":"970f1d41.934ba","type":"function","z":"358dfc2d.7681c4","name":"Standby","func":"s_object = \"standby.txt=\";\ns_text = msg.payload;\nvar arr = [];\nfor (var i = 0, l = s_object.length; i < l; i ++) {\n var ascii = s_object.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0x22);\nfor (var i = 0, l = s_text.length; i < l; i ++) {\n var ascii = s_text.charCodeAt(i);\n arr.push(ascii);\n}\narr.push(0x22);\narr.push(0xFF);\narr.push(0xFF);\narr.push(0xFF);\nmsg.payload = new Buffer(arr);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":480,"wires":[["f71d1184.704648"]]},{"id":"7189b028.cba5d","type":"inject","z":"358dfc2d.7681c4","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":480,"wires":[["290be86b.e67c28"]]},{"id":"70867f5f.054dc8","type":"inject","z":"358dfc2d.7681c4","name":"","topic":"","payload":"test","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":400,"wires":[["f766871d.3301b"]]},{"id":"aaa32666.af0fe8","type":"inject","z":"358dfc2d.7681c4","name":"","topic":"","payload":"test","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":360,"wires":[["209d6872.e72758"]]},{"id":"ad7ea13.7d447e","type":"inject","z":"358dfc2d.7681c4","name":"","topic":"","payload":"test","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":320,"wires":[["c91ebb8e.e03d18"]]},{"id":"c0105968.b5a21","type":"function","z":"358dfc2d.7681c4","name":"","func":"var str = msg.payload;\nvar typeIndex = str.search(\"Type:\");\nvar whenIndex = str.search(\"When:\");\nvar rvIndex = str.search(\"RV:\");\nvar locIndex = str.search(\"Loc:\");\nvar sentIndex = str.search(\"Sent:\");\nvar pleaseIndex = str.search(\"Please\");\nvar linkIndex = str.search(\"https://\");\nvar toRVIndex = str.search(\"To RV\");\n\nvar type = str.substring(typeIndex + 6, whenIndex);\nvar when = str.substring(whenIndex + 6, rvIndex);\nvar rv = str.substring(rvIndex + 4, locIndex);\nvar loc = str.substring(locIndex + 5, sentIndex);\nvar sent = str.substring(sentIndex + 6, pleaseIndex);\nvar link = str.substring(linkIndex, toRVIndex - 1);\n\nmsg.type = type\nmsg.when = when\nmsg.rv = rv\nmsg.loc = loc\nmsg.sent = sent\nmsg.link = link\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":240,"wires":[["56917ee6.c38fa"]]},{"id":"a650d945.f5b7","type":"switch","z":"358dfc2d.7681c4","name":"","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"ATTENDANCE REQUEST","vt":"str"},{"t":"cont","v":"Please Stand Down","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":170,"y":260,"wires":[["c0105968.b5a21","209d6872.e72758"],[],[]]},{"id":"1e8827a.e84ca58","type":"e-mail in","z":"358dfc2d.7681c4","name":"","protocol":"IMAP","server":"imap.gmail.com","useSSL":true,"port":"993","box":"INBOX","disposition":"Read","repeat":"15","x":50,"y":260,"wires":[["a650d945.f5b7"]]},{"id":"56917ee6.c38fa","type":"template","z":"358dfc2d.7681c4","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{type}} at {{loc}}. RV at {{rv}}","output":"str","x":390,"y":440,"wires":[["20a69060.353ad8"]]},{"id":"924bc352.4b8d18","type":"trigger","z":"358dfc2d.7681c4","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":760,"y":200,"wires":[["262298a7.64bb8"]]},{"id":"262298a7.64bb8","type":"switch","z":"358dfc2d.7681c4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":890,"y":200,"wires":[["f766871d.3301b"],["c91ebb8e.e03d18","290be86b.e67c28"]]},{"id":"796505db.022134","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"type","pt":"msg","to":"Person in the Water","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":70,"y":520,"wires":[["6d1ce812.1097b"]]},{"id":"6d1ce812.1097b","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"loc","pt":"msg","to":"Rochester Bridge","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":520,"wires":[["f10a0ff0.eb5b3"]]},{"id":"f10a0ff0.eb5b3","type":"change","z":"358dfc2d.7681c4","name":"","rules":[{"t":"set","p":"rv","pt":"msg","to":"Medway CRE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":520,"wires":[["56917ee6.c38fa"]]},{"id":"63222cf8.1fe174","type":"twilio out","z":"358dfc2d.7681c4","twilio":"4d974e8e.7c1638","twilioType":"sms","url":"","number":"+447537415757","name":"","x":770,"y":40,"wires":[]},{"id":"6ae4204f.4b9b3","type":"function","z":"358dfc2d.7681c4","name":"","func":"\nvar str = msg.payload;\n\nvar nextHWIndex = str.search(\"Next High Tide:\");\nvar nextLWIndex = str.search(\"Next Low Tide:\");\n\nvar nextHW = str.substring(nextHWIndex + 39, nextHWIndex + 48);\nvar nextLW = str.substring(nextLWIndex + 38, nextLWIndex + 47);\n\n\n\n\nmsg.nextHW = nextHW\nmsg.nextLW = nextLW\nmsg.payload = \"HW in:\" + nextHW + \" \" +\"LW in:\" + nextLW\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":620,"wires":[["970f1d41.934ba"]]},{"id":"290be86b.e67c28","type":"http request","z":"358dfc2d.7681c4","name":"","method":"GET","ret":"txt","url":"https://www.tidetimes.co.uk/sheerness-tide-times","tls":"","x":330,"y":620,"wires":[["6ae4204f.4b9b3"]]}]