diff --git a/flow.json b/flow.json index 2e7f325..5042c94 100644 --- a/flow.json +++ b/flow.json @@ -1 +1 @@ -[{"id":"60528a1b.f32364","type":"tab","label":"Startup *","disabled":false,"info":"Used to setup system variables. \r\n\r\nThe main bulk of the flow is activated on boot\r\n\r\n* Set IP Address- Gets the system IP address, adds it to global.ip and also sets /ip in the json DB\r\n* Set system ID - Gets system ID from json DB and sets global.sysID - This is used to filter messages\r\n* Set Email Address - Gets last email from json DB and sets global.to\r\n* Add Power on Message to DB - Writes to DB when system Powers on\r\n* Set Serial Number - Gets Serial from json DB and sets global.serial\r\n* Set Software Version - Gets S/W Version from json DB and sets global.sw\r\n* Set Hardware Version - Gets H/W Version from json DB and sets global.hw\r\n* Set Firmware Version - Gets F/W Version from json DB and sets global.fw\r\n* Set Password - Gets system Password from json DB and sets global.password\r\n* Set Left Header Links - Gets json List of modules for main pages from json DB and sets global.left. Used to set contents list on main pages\r\n* Set Settings Links - Gets json List of settings pages for settings pages from json DB and sets global.setings_list. Used to set contents list on settings pages\r\n* Set sort by - Sets default sort coloum to \"index\" on boot\r\n* Set sort direction - Sets default sort direction to \"ASC\" on boot\r\n\r\nAlso on this Flow is the webpage that is served if a user tries to access a page they are not licenced for. this can be triggered from any page by a link node.\r\n\r\nFinally there is a collection of default data nodes. These add the injected data into the json DB. They only need to be ran once to populate the json DB\r\n\r\n* /sw,/hw,/fw - Used to set the versions shown on the settings pages\r\n* sysID - Used to set the system ID Filter\r\n* Modules - contains a JSON string used to set the Links to main pages and their displayed Names\r\n* Serial - Used to set the system serial number\r\n* Password - Used to set the default system password - 1234 at this time\r\n* Settings - contains a JSON string used to set the Links to settings pages and their displayed Names"},{"id":"e3cbac21.52804","type":"tab","label":"Receive Page & Add to DB Regex","disabled":false,"info":"This Flow does the following\r\n1. Recvied the page either from \r\n * LRS TX-7470-C232 (RS232 Node needed before. Switch node recommended to filter out startup messages and send confirmations)\r\n * RX1\r\nthis is currently changed by changing the nodes\r\n2. Checks msg.sysID matched global.sysID\r\n3. Forms SQL query to add page to DB\r\n4. Checks if msg.Status = Attended\r\n * If True changes status in DB from active to Handled Also updates late messages to handled\r\n * If False Outputs to other Flows.\r\n\r\nAlso on this flow are some example pager messages that can be injected manually.** to be removed in final version!**"},{"id":"23c43518.b3ff0a","type":"tab","label":"Pager Dynamic Display","disabled":false,"info":"When /display or / is accessed this flow builds a webpage by setting the page title, injecting the JS and HTML.\r\nEvery Second the inject node fires which queries the DB for all data with a status of Active or Late. This Data is phrased to work out the Display style and t oconvert the TS to local time. THis is then built into HTML code using Mustache to loop through the Data. Once completethis HTML Data is pushed to the webpage via a Websocket.\r\n\r\nWhen the user clicks on one of the lines of data, its Index is sent via websocket, This is tested to see if its not 'Open' (Sent by the webpage onload to refresh data) The status of the record matching the index is updated to manaully handled in the DB.\r\n\r\nWhen a new page is added to the DB the Link node is triggered to play a noise using the websocket"},{"id":"b8bd1cc3.4827","type":"tab","label":"First Aid Display","disabled":false,"info":""},{"id":"a6d65e53.c700b","type":"tab","label":"Conference Room","disabled":false,"info":""},{"id":"d0e2bfbf.dfe3f","type":"tab","label":"Table Display","disabled":false,"info":""},{"id":"9939c833.99b318","type":"tab","label":"Split Screen","disabled":false,"info":"When /display or / is accessed this flow builds a webpage by setting the page title, injecting the JS and HTML.\r\nEvery Second the inject node fires which queries the DB for all data with a status of Active or Late. This Data is phrased to work out the Display style and t oconvert the TS to local time. THis is then built into HTML code using Mustache to loop through the Data. Once completethis HTML Data is pushed to the webpage via a Websocket.\r\n\r\nWhen the user clicks on one of the lines of data, its Index is sent via websocket, This is tested to see if its not 'Open' (Sent by the webpage onload to refresh data) The status of the record matching the index is updated to manaully handled in the DB.\r\n\r\nWhen a new page is added to the DB the Link node is triggered to play a noise using the websocket"},{"id":"4ff720ae.e74bd","type":"tab","label":"Big Display","disabled":false,"info":""},{"id":"c8c5b763.cd1498","type":"tab","label":"Location Split","disabled":false,"info":""},{"id":"5f1f2b21.5baa74","type":"tab","label":"Browser Paging","disabled":false,"info":""},{"id":"b209c94d.26d798","type":"tab","label":"Log Display Daily","disabled":false,"info":""},{"id":"1c96dbb1.1bc354","type":"tab","label":"Log Display Full","disabled":false,"info":""},{"id":"53e35596.381c0c","type":"tab","label":"Quick Page","disabled":false,"info":""},{"id":"da0e8c29.a0583","type":"tab","label":"Free Page","disabled":false,"info":""},{"id":"b00e2d77.a9931","type":"tab","label":"Export","disabled":false,"info":""},{"id":"38ad3d43.e07282","type":"tab","label":"Login","disabled":false,"info":""},{"id":"ce69645.1231098","type":"tab","label":"Settings Menu","disabled":false,"info":""},{"id":"aefd70ef.7eada","type":"tab","label":"Set Alias","disabled":false,"info":""},{"id":"53762a60.6160b4","type":"tab","label":"Set Quick Page","disabled":false,"info":""},{"id":"d0562e73.de681","type":"tab","label":"Set Flash Pattern Effects","disabled":false,"info":""},{"id":"69336e92.97cdb","type":"tab","label":"System Settings","disabled":false,"info":""},{"id":"7c3dbf78.7885c","type":"tab","label":"SMS Settings","disabled":false,"info":""},{"id":"3c78672c.9cb1f8","type":"tab","label":"Engineer Settings","disabled":false,"info":""},{"id":"ba76d305.cf8ad","type":"tab","label":"DB Utilities","disabled":false,"info":""},{"id":"dad6f0f1.28177","type":"tab","label":"TX-7470-232 Controls","disabled":false,"info":""},{"id":"fa19d7ed.b2f408","type":"tab","label":"SMS RX and TX","disabled":false,"info":""},{"id":"643aaaf4.e44594","type":"tab","label":"Flow 1","disabled":true,"info":""},{"id":"c9436af2.6cae48","type":"tab","label":"Smart Repeater","disabled":true,"info":""},{"id":"b7fc24bc.f191b8","type":"tab","label":"IP Settings","disabled":true,"info":""},{"id":"ca9def01.26ba2","type":"subflow","name":"Send Page","info":"","in":[{"x":220,"y":160,"wires":[{"id":"d19364d9.208968"},{"id":"d51608e.09159f8"},{"id":"33ff1e8e.291482"},{"id":"fb44d9db.726018"}]}],"out":[]},{"id":"8f4a2a74.1d74a8","type":"subflow","name":"Receive Page LRS","info":"","category":"input","in":[{"x":60,"y":40,"wires":[{"id":"32b7704c.e1af"},{"id":"305e69b.97a0f96"}]}],"out":[{"x":1160,"y":120,"wires":[{"id":"349d8d25.ff88c2","port":0}]}]},{"id":"e61361fa.da19a","type":"subflow","name":"Send SMS","info":"","category":"","in":[{"x":360,"y":80,"wires":[{"id":"10de6977.bb8d37"}]}],"out":[{"x":640,"y":480,"wires":[{"id":"10de6977.bb8d37","port":0},{"id":"c0ac4507.b28cb8","port":0},{"id":"69592b7b.5ce814","port":0},{"id":"a0e3fbb3.2826c8","port":0},{"id":"220aa1d8.3e212e","port":0},{"id":"611f59c8.8b6658","port":0}]}]},{"id":"6824b2bf.b1e0fc","type":"subflow","name":"INIT SMS","info":"","category":"","in":[{"x":400,"y":120,"wires":[{"id":"4325240c.074bfc"}]}],"out":[{"x":780,"y":260,"wires":[{"id":"4325240c.074bfc","port":0},{"id":"267d0776.a38468","port":0},{"id":"b1c6a3b8.dcb17","port":0}]}]},{"id":"8ad92631.0da208","type":"websocket-listener","z":"","path":"/log-full/send","wholemsg":"true"},{"id":"c0402614.f01608","type":"websocket-listener","z":"","path":"/log-daily/receive","wholemsg":"true"},{"id":"32989c5a.d6ee14","type":"websocket-listener","z":"","path":"/log-full/receive","wholemsg":"true"},{"id":"fd38eee5.8bd8a","type":"sqlitedb","z":"","db":"./CaptureCall.db","mode":"RWC"},{"id":"e1c85b2c.abed18","type":"json-db-collection","z":"","name":"","collection":"settings","save":true},{"id":"d9d1357a.d4f118","type":"websocket-listener","z":"","path":"/display/receive","wholemsg":"true"},{"id":"95962f80.19ef3","type":"websocket-listener","z":"","path":"/display/send","wholemsg":"false"},{"id":"c7526c07.3fd51","type":"websocket-listener","z":"","path":"/log-daily/send","wholemsg":"true"},{"id":"c78d8a51.8b8ed8","type":"websocket-listener","z":"","path":"/export/send","wholemsg":"true"},{"id":"b7dfd67b.7d7948","type":"websocket-listener","z":"","path":"/export/receive","wholemsg":"true"},{"id":"18f900b5.35f87f","type":"websocket-listener","z":"","path":"/alert/global/prompt","wholemsg":"true"},{"id":"4d6db4a9.f35a1c","type":"websocket-listener","z":"","path":"/table/receive","wholemsg":"true"},{"id":"c2e44b88.6a4e78","type":"websocket-listener","z":"","path":"/table/send","wholemsg":"false"},{"id":"5d6eb2f4.fc698c","type":"serial-port","z":"","serialport":"/dev/ttyUSB-USBSERIAL","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"0x0D","bin":"false","out":"char","addchar":true,"responsetimeout":"10000"},{"id":"5e6c9ab1.74ef04","type":"websocket-listener","z":"","path":"/firstaid/receive","wholemsg":"true"},{"id":"addfeab3.3935e8","type":"websocket-listener","z":"","path":"/firstaid/send","wholemsg":"false"},{"id":"b03253f0.29251","type":"websocket-listener","z":"","path":"/quickpage/receive","wholemsg":"true"},{"id":"25343a6d.90cb36","type":"websocket-listener","z":"","path":"/quickpage/send","wholemsg":"false"},{"id":"d7115ac0.1e2888","type":"websocket-listener","z":"","path":"/login/send","wholemsg":"false"},{"id":"f92c2145.f46df","type":"websocket-listener","z":"","path":"/login/receive","wholemsg":"true"},{"id":"4f629706.3fbcb8","type":"websocket-listener","z":"","path":"/beep","wholemsg":"true"},{"id":"a0127eb8.b242b","type":"websocket-listener","z":"","path":"/setFP/send","wholemsg":"false"},{"id":"4f808f22.bd9c5","type":"websocket-listener","z":"","path":"/setFP/receive","wholemsg":"true"},{"id":"a08ab62d.cf01f8","type":"websocket-listener","z":"","path":"/split-screen/receive/one","wholemsg":"true"},{"id":"2dd9c4a8.1fbccc","type":"websocket-listener","z":"","path":"/split-screen/receive/two","wholemsg":"true"},{"id":"1bd09651.1c7e5a","type":"websocket-listener","z":"","path":"/split-screen/send","wholemsg":"false"},{"id":"a446718.a7f529","type":"websocket-listener","z":"","path":"/alias/receive/one","wholemsg":"true"},{"id":"f2da83eb.80921","type":"websocket-listener","z":"","path":"/alias/receive/two","wholemsg":"true"},{"id":"7d649c17.1d11a4","type":"websocket-listener","z":"","path":"/setQP/receive","wholemsg":"true"},{"id":"c91ee09b.1a258","type":"websocket-listener","z":"","path":"/setQP/send","wholemsg":"false"},{"id":"a0966341.283ff","type":"websocket-listener","z":"","path":"/system/send","wholemsg":"false"},{"id":"91b7d145.fc4e5","type":"websocket-listener","z":"","path":"/alert/global","wholemsg":"false"},{"id":"cc73b91d.aaa738","type":"websocket-listener","z":"","path":"/alias/send","wholemsg":"false"},{"id":"1a6bd275.73c88e","type":"websocket-listener","z":"","path":"/split-screen/receive","wholemsg":"true"},{"id":"e69cdd08.ba509","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"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"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":"4586ec4f.d85214","type":"websocket-listener","z":"","path":"/alert/export","wholemsg":"false"},{"id":"52036df9.0cfb64","type":"websocket-listener","z":"","path":"/alert/system/prompt","wholemsg":"false"},{"id":"15d62cbe.d62773","type":"websocket-listener","z":"","path":"/bar/receive","wholemsg":"true"},{"id":"7b602086.fa4f5","type":"websocket-listener","z":"","path":"/bar/send","wholemsg":"false"},{"id":"c2dca4df.1b2b98","type":"websocket-listener","z":"","path":"/conference/receive","wholemsg":"true"},{"id":"1a6d181c.211418","type":"websocket-listener","z":"","path":"/conference/send","wholemsg":"false"},{"id":"a6feaa7b.4b5558","type":"websocket-listener","z":"","path":"/location/send","wholemsg":"false"},{"id":"39f67bec.0b2fe4","type":"websocket-listener","z":"","path":"/location/receive","wholemsg":"true"},{"id":"654f3d23.7221e4","type":"websocket-listener","z":"","path":"/browserpage/receive","wholemsg":"true"},{"id":"922ce017.72c01","type":"websocket-listener","z":"","path":"/browserpage/send","wholemsg":"false"},{"id":"846cfc61.5ccfe","type":"websocket-listener","z":"","path":"/browserpage/receive/one","wholemsg":"true"},{"id":"bd6c3af.5c6d0c8","type":"serial-port","z":"","serialport":"/dev/ttyUSB-SMS_00","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"50","bin":"false","out":"time","addchar":false,"responsetimeout":""},{"id":"4c9759dc.0c6338","type":"serial-port","z":"","serialport":"/dev/ttyUSB-TRX1","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"50","bin":"false","out":"time","addchar":false,"responsetimeout":"10000"},{"id":"5ea533e5.c35b8c","type":"ui_group","z":"","name":"IP Settings","tab":"ac8c41d4.15972","disp":true,"width":"6","collapse":false},{"id":"ac8c41d4.15972","type":"ui_tab","z":"","name":"Settings","icon":"settings"},{"id":"ad147099.a69c3","type":"serial-port","serialport":"/dev/ttyS2","serialbaud":"1200","databits":"7","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":"false"},{"id":"9c75d562.473268","type":"websocket-listener","z":"","path":"/settings_list","wholemsg":"true"},{"id":"dc2bb776.c508d8","type":"websocket-listener","z":"","path":"/sms/send","wholemsg":"false"},{"id":"97aed89c.6c8d08","type":"websocket-listener","z":"","path":"/sms/receive/one","wholemsg":"true"},{"id":"2ca8999c.456256","type":"websocket-listener","z":"","path":"/sms/receive/two","wholemsg":"true"},{"id":"6c8b92a7.84a82c","type":"e-mail","z":"b00e2d77.a9931","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"CaptureCall System","x":1280,"y":1000,"wires":[]},{"id":"da56f422.c45fe8","type":"csv","z":"b00e2d77.a9931","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\n","temp":"Index, Call Point, Message, ReceivedTime, Status, StatusTime, ExportedTime, Recipient, System ID","skip":"0","x":890,"y":1020,"wires":[["e981d4fd.f427d8","8551674f.20b3f8"]]},{"id":"3f8aac1f.7c3ae4","type":"template","z":"b00e2d77.a9931","name":"Export All","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT \n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log`\nORDER BY `rxTime` DESC;","output":"str","x":340,"y":1060,"wires":[["f8461b70.bd71c8"]]},{"id":"e981d4fd.f427d8","type":"change","z":"b00e2d77.a9931","name":"Setup mail content","rules":[{"t":"set","p":"attachments","pt":"msg","to":"[{\t \"filename\": 'log.csv', \t \"content\": $$.payload\t}]","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"CaptureCall System Log","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Attached is the requested information from your CaptureCall system.","tot":"str"},{"t":"set","p":"to","pt":"msg","to":"to","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":1020,"wires":[["6c8b92a7.84a82c"]]},{"id":"a32b6729.85e8e8","type":"http in","z":"b00e2d77.a9931","name":"","url":"/export","method":"get","upload":false,"swaggerDoc":"","x":90,"y":200,"wires":[["cf30e34b.c1eb2"]]},{"id":"af06c87d.56a788","type":"comment","z":"b00e2d77.a9931","name":"Build Webpage","info":"","x":100,"y":40,"wires":[]},{"id":"cc70f131.afde4","type":"template","z":"b00e2d77.a9931","name":"Export New","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT\n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log` WHERE `exported` IS NULL","output":"str","x":350,"y":1020,"wires":[["f8461b70.bd71c8"]]},{"id":"f8a9f08f.97c9b","type":"template","z":"b00e2d77.a9931","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `log` SET `exported`= '{{timestamp}}'","output":"str","x":680,"y":820,"wires":[["1526f69b.ff5f29"]]},{"id":"f8461b70.bd71c8","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":530,"y":1020,"wires":[["2e1d4886.bea1a8"]]},{"id":"1526f69b.ff5f29","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":820,"wires":[[]]},{"id":"c3f8d5d0.283858","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Your eMail has been Sent","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":700,"wires":[["75f1d35f.d07dac","a5a593bb.63b9d"]]},{"id":"463f8c6f.4fd364","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Send Failed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":660,"wires":[["68d64bf.54ca2b4","d08f4aa4.66b1b8"]]},{"id":"9f4bb9c9.b550f8","type":"status","z":"b00e2d77.a9931","name":"","scope":["6c8b92a7.84a82c"],"x":80,"y":680,"wires":[["ba578bde.7214f8"]]},{"id":"ba578bde.7214f8","type":"switch","z":"b00e2d77.a9931","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"email.status.sendfail","vt":"str"},{"t":"eq","v":"email.status.sending","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":230,"y":680,"wires":[["463f8c6f.4fd364"],[],["c3f8d5d0.283858"]]},{"id":"3013dfe1.3ed01","type":"comment","z":"b00e2d77.a9931","name":"Catch Email Send Errors","info":"","x":130,"y":600,"wires":[]},{"id":"86082327.d62aa","type":"link in","z":"b00e2d77.a9931","name":"","links":["721569cb.074f58","8dc6af04.088a3"],"x":235,"y":1020,"wires":[["cc70f131.afde4"]]},{"id":"223b37e8.4b69d8","type":"link in","z":"b00e2d77.a9931","name":"","links":["2c82e51a.004a9a","9b0374d2.8917a8","34e0ce95.1b5ca2"],"x":235,"y":1060,"wires":[["3f8aac1f.7c3ae4"]]},{"id":"fed99ff9.b9bb1","type":"comment","z":"b00e2d77.a9931","name":"Send Email","info":"","x":90,"y":900,"wires":[]},{"id":"666f148c.df226c","type":"csv","z":"b00e2d77.a9931","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\n","temp":"Index, Call Point, Message, ReceivedTime, Status, StatusTime, ExportedTime, Recipient, System ID","skip":"0","x":890,"y":980,"wires":[["4ea4678b.48f808","8551674f.20b3f8"]]},{"id":"4ea4678b.48f808","type":"change","z":"b00e2d77.a9931","name":"Setup mail content","rules":[{"t":"set","p":"attachments","pt":"msg","to":"[{\t \"filename\": 'log.csv', \t \"content\": $$.payload\t}]","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"CaptureCall Daily Digest","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Attached is the requested information from your CaptureCall system.","tot":"str"},{"t":"set","p":"to","pt":"msg","to":"to","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":980,"wires":[["6c8b92a7.84a82c"]]},{"id":"94f5535a.df3bc","type":"template","z":"b00e2d77.a9931","name":"Export New","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT\n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log` WHERE `exported` IS NULL","output":"str","x":350,"y":980,"wires":[["445e65fd.5881dc"]]},{"id":"445e65fd.5881dc","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":530,"y":980,"wires":[["4df235b.7c5c0cc"]]},{"id":"f3405690.0119c8","type":"inject","z":"b00e2d77.a9931","name":"Export New Every Day","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"x":150,"y":980,"wires":[["94f5535a.df3bc","ebaeeace.a4f718","430823b4.54fdcc"]]},{"id":"a61b2d01.623e8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":120,"wires":[]},{"id":"c7008ce.9220c7","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":80,"wires":[["6f129008.96182"]]},{"id":"7e6e6b94.b4a724","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `log` ( \t`index`\tINTEGER PRIMARY KEY AUTOINCREMENT, \t`capcode`\tINTEGER, \t`pagerNumber`\tINTEGER, \t`sysID`\tINTEGER, \t`group`\tTEXT, \t`content`\tTEXT, \t`msgPart1`\tTEXT, \t`msgPart2`\tTEXT, \t`sender`\tTEXT, \t`rxTime`\tINTEGER, \t`status`\tINTEGER, \t`statusTime`\tREAL, \t`exported`\tINTEGER, \t`FP`\tTEXT, \t`payload`\tTEXT, \t`T/R`\tINTEGER );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":80,"wires":[["c7008ce.9220c7"]]},{"id":"6f129008.96182","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":80,"wires":[]},{"id":"ec443c0d.8626c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":240,"wires":[["24bd4830.57f6e8"]]},{"id":"9d1e6dbe.d89e2","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":240,"wires":[["ec443c0d.8626c"]]},{"id":"aed60ae.6b45df8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":120,"wires":[["a61b2d01.623e8"]]},{"id":"c8181b2e.7db228","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":120,"wires":[["aed60ae.6b45df8"]]},{"id":"b0a6ba65.a7d928","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":160,"wires":[]},{"id":"8b6bd144.83a25","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":160,"wires":[["b0a6ba65.a7d928"]]},{"id":"df2babd6.b81898","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":160,"wires":[["8b6bd144.83a25"]]},{"id":"4df235b.7c5c0cc","type":"function","z":"b00e2d77.a9931","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \nvar rxtime = new Date(msg.payload[i].rxTime);\nvar statusTime = new Date(msg.payload[i].statusTime);\nvar exportedTime = new Date(msg.payload[i].exported);\n\nif (msg.payload[i].exported === null) {\n msg.payload[i].ExportedTime = \"n/a\"\n} else {\nmsg.payload[i].ExportedTime = exportedTime\n}\n\nmsg.payload[i].StatusTime = statusTime\nmsg.payload[i].ReceivedTime = rxtime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":980,"wires":[["666f148c.df226c"]]},{"id":"75f1d35f.d07dac","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":780,"wires":[["582b503f.5fb22","f8a9f08f.97c9b"]]},{"id":"2e1d4886.bea1a8","type":"function","z":"b00e2d77.a9931","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \nvar rxtime = new Date(msg.payload[i].rxTime);\nvar statusTime = new Date(msg.payload[i].statusTime);\nvar exportedTime = new Date(msg.payload[i].exported);\n\nif (msg.payload[i].exported === null) {\n msg.payload[i].ExportedTime = \"n/a\"\n} else {\nmsg.payload[i].ExportedTime = exportedTime\n}\n\nmsg.payload[i].StatusTime = statusTime\nmsg.payload[i].ReceivedTime = rxtime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":1020,"wires":[["da56f422.c45fe8"]]},{"id":"24bd4830.57f6e8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":240,"wires":[]},{"id":"2fd5e4ed.597f5c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":200,"wires":[]},{"id":"37e42e66.009442","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":200,"wires":[["2fd5e4ed.597f5c"]]},{"id":"d201839b.347","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":200,"wires":[["37e42e66.009442"]]},{"id":"8551674f.20b3f8","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":940,"wires":[]},{"id":"1d4b9b6.2e75565","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":280,"wires":[["8b82ced7.840b7"]]},{"id":"f3efd6bc.d319a8","type":"inject","z":"ba76d305.cf8ad","name":"Clear Old Records","topic":"DELETE FROM `log` WHERE `index` IN (SELECT `index` FROM `log` ORDER BY `index` DESC LIMIT -1 OFFSET 2000) AND `exported` IS NOT NULL;","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":280,"wires":[["1d4b9b6.2e75565"]]},{"id":"8b82ced7.840b7","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":280,"wires":[]},{"id":"a352da15.0d4288","type":"template","z":"b00e2d77.a9931","name":"Clear Old Records","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `log` WHERE `index` IN (SELECT `index` FROM `log` ORDER BY `index` DESC LIMIT -1 OFFSET 2000) AND `exported` IS NOT NULL;","output":"str","x":510,"y":940,"wires":[["b59b1f4c.0ec78"]]},{"id":"b59b1f4c.0ec78","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":690,"y":940,"wires":[[]]},{"id":"ebaeeace.a4f718","type":"delay","z":"b00e2d77.a9931","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":940,"wires":[["a352da15.0d4288"]]},{"id":"582b503f.5fb22","type":"template","z":"b00e2d77.a9931","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export Successful','Export Successful', '{{timestamp}}', '{{timestamp}}');","output":"str","x":680,"y":780,"wires":[["5c50a3a4.23c89c"]]},{"id":"5c50a3a4.23c89c","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":780,"wires":[[]]},{"id":"ecca07b5.9ea578","type":"template","z":"b00e2d77.a9931","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export Failed','Export Failed', '{{timestamp}}', '{{timestamp}}');","output":"str","x":680,"y":620,"wires":[["b09e3e3f.0fe09"]]},{"id":"b09e3e3f.0fe09","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":620,"wires":[[]]},{"id":"33c3ae31.e41c62","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Daily Export Triggered','Daily Export Triggered to {{global.to}}', '{{timestamp}}', '{{timestamp}}');","output":"str","x":490,"y":900,"wires":[["e7b2f01e.3fbbf"]]},{"id":"e7b2f01e.3fbbf","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":900,"wires":[[]]},{"id":"68d64bf.54ca2b4","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":620,"wires":[["ecca07b5.9ea578"]]},{"id":"430823b4.54fdcc","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":900,"wires":[["33c3ae31.e41c62"]]},{"id":"bc4b27b0.6d1478","type":"link out","z":"e3cbac21.52804","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1815,"y":220,"wires":[]},{"id":"c94a9d48.9c2c","type":"link out","z":"e3cbac21.52804","name":"Add to DB","links":["a7862417.604e88","c7eb5365.d6ebd","562eef1b.5da85","8452a925.e651d8","ac279afc.5d13b8","81bc9a1b.ba8868","70de8433.1ad6bc","39c86da3.17b292","65839b56.756164"],"x":1175,"y":240,"wires":[]},{"id":"65be70e.baef89","type":"comment","z":"e3cbac21.52804","name":"Add to DB","info":"","x":1320,"y":180,"wires":[]},{"id":"f00ef931.2b7e68","type":"hostip","z":"60528a1b.f32364","name":"Host IP","x":420,"y":160,"wires":[["7ece05b1.f644dc","88463608.a1be98"]]},{"id":"88463608.a1be98","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"ip","pt":"global","to":"payload[0].address","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":120,"wires":[[]]},{"id":"66e288bb.f91b28","type":"inject","z":"60528a1b.f32364","name":"Initiate Global Variables","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"0","x":190,"y":160,"wires":[["f00ef931.2b7e68","7a7e9dde.7b8004","577e3b25.879e44","b6c859b7.94b658","75e740cb.10229","d57eea24.248848","1ecf1066.91d79","64152e36.bad9a","702ec949.a6b798","b97ab582.64ca48","e9329103.798d6","2787e72e.d4af98","5ea3efa2.1fb7a","6579a230.6630bc","ee5d6812.a72308"]]},{"id":"9a7d50bd.7cef2","type":"comment","z":"60528a1b.f32364","name":"Save IP Address","info":"","x":880,"y":160,"wires":[]},{"id":"7fda91ad.06b69","type":"template","z":"60528a1b.f32364","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload') \nVALUES ('0', '0', '{{global.sysID}}', '0', 'Power On ({{global.ip}})', 'n/a', 'System','{{payload}}', 'Power On', '{{payload}}', 'n/a', 'n/a');","output":"str","x":580,"y":200,"wires":[["64f95549.289fdc"]]},{"id":"64f95549.289fdc","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":200,"wires":[[]]},{"id":"7a7e9dde.7b8004","type":"delay","z":"60528a1b.f32364","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":430,"y":200,"wires":[["7fda91ad.06b69"]]},{"id":"adbc8745.6a7b98","type":"comment","z":"60528a1b.f32364","name":"Write Power On Message to Log","info":"","x":950,"y":200,"wires":[]},{"id":"8ef3cc6f.9a91a","type":"template","z":"60528a1b.f32364","name":"Left Header","field":"left","fieldType":"global","format":"handlebars","syntax":"mustache","template":"
\n\n

","output":"str","x":910,"y":640,"wires":[[]]},{"id":"bdee1a5f.1f3dc8","type":"comment","z":"60528a1b.f32364","name":"Set Left Header Links","info":"","x":1520,"y":640,"wires":[]},{"id":"5d9f879a.ab2cf8","type":"http response","z":"b00e2d77.a9931","name":"","statusCode":"201","headers":{},"x":760,"y":200,"wires":[]},{"id":"4e44e038.08395","type":"template","z":"b00e2d77.a9931","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
\n {{{global.left}}}\n
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":630,"y":200,"wires":[["5d9f879a.ab2cf8"]]},{"id":"cf30e34b.c1eb2","type":"change","z":"b00e2d77.a9931","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Export Menu","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":200,"wires":[["72aa7d10.d1af44"]]},{"id":"29aa4748.4a38f8","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"to","pt":"global","to":"payload[0].email","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":360,"wires":[[]]},{"id":"43bab4a0.45f19c","type":"comment","z":"60528a1b.f32364","name":"Set S/W Version","info":"","x":780,"y":480,"wires":[]},{"id":"43ccf7d3.ddd008","type":"comment","z":"60528a1b.f32364","name":"Set Email","info":"","x":760,"y":360,"wires":[]},{"id":"89ede062.46b22","type":"comment","z":"b00e2d77.a9931","name":"Put Settings On the Webpage","info":"","x":140,"y":280,"wires":[]},{"id":"a29f518.92ac7b","type":"websocket out","z":"b00e2d77.a9931","name":"","server":"b7dfd67b.7d7948","client":"","x":570,"y":320,"wires":[]},{"id":"1228ef46.2a9871","type":"template","z":"b00e2d77.a9931","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Click on the buttons below to email the relevant report immediately.

\n\n
\n\n

\n\n
\n\n

\n\n
\n\n

","output":"str","x":390,"y":320,"wires":[["a29f518.92ac7b"]]},{"id":"f72ff61b.e8d618","type":"link in","z":"b00e2d77.a9931","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","323185ec.ff19aa","439e3a4.33f4dc4","ce5be23d.4618f","64848176.9353c","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":275,"y":360,"wires":[["1228ef46.2a9871"]]},{"id":"2e977b67.7b7c54","type":"websocket in","z":"b00e2d77.a9931","name":"","server":"c78d8a51.8b8ed8","client":"","x":100,"y":320,"wires":[["e979859b.b1bd58"]]},{"id":"e979859b.b1bd58","type":"switch","z":"b00e2d77.a9931","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":250,"y":320,"wires":[["1228ef46.2a9871"]]},{"id":"72aa7d10.d1af44","type":"template","z":"b00e2d77.a9931","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/export/receive');\nvar send = new WebSocket('ws://' + location.host + '/export/send');\n\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":510,"y":200,"wires":[["4e44e038.08395"]]},{"id":"3e94fc51.b74054","type":"switch","z":"b00e2d77.a9931","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"},{"t":"eq","v":"ExportNew","vt":"str"},{"t":"eq","v":"ExportAll","vt":"str"},{"t":"eq","v":"ExportUSB","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":250,"y":460,"wires":[[],["cf368fd3.b1f24"],["296e6582.99004a"],["9ebb47d8.f65978"]]},{"id":"64248c60.900b94","type":"websocket in","z":"b00e2d77.a9931","name":"","server":"c78d8a51.8b8ed8","client":"","x":100,"y":460,"wires":[["3e94fc51.b74054"]]},{"id":"8dc6af04.088a3","type":"link out","z":"b00e2d77.a9931","name":"","links":["86082327.d62aa"],"x":815,"y":440,"wires":[]},{"id":"9b0374d2.8917a8","type":"link out","z":"b00e2d77.a9931","name":"","links":["223b37e8.4b69d8"],"x":815,"y":480,"wires":[]},{"id":"d27040b1.bd22","type":"comment","z":"b00e2d77.a9931","name":"Handle Input from Webpage","info":"","x":140,"y":400,"wires":[]},{"id":"878807fc.17f708","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export All','Export All to {{global.to}}', '{{timestamp}}', '{{timestamp}}');","output":"str","x":550,"y":480,"wires":[["36c49da8.b2b1c2"]]},{"id":"36c49da8.b2b1c2","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":480,"wires":[["9b0374d2.8917a8"]]},{"id":"3e07d8e1.991e78","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export New','Export New to {{global.to}}', '{{timestamp}}', '{{timestamp}}');","output":"str","x":550,"y":440,"wires":[["6886cec4.f705c"]]},{"id":"6886cec4.f705c","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":440,"wires":[["8dc6af04.088a3"]]},{"id":"cf368fd3.b1f24","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":440,"wires":[["3e07d8e1.991e78"]]},{"id":"296e6582.99004a","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":480,"wires":[["878807fc.17f708"]]},{"id":"fd4ba03e.ba97d","type":"comment","z":"60528a1b.f32364","name":"Set Modules","info":"","x":1550,"y":680,"wires":[]},{"id":"7aa6b39d.f2722c","type":"http response","z":"60528a1b.f32364","name":"","statusCode":"201","headers":{},"x":840,"y":800,"wires":[]},{"id":"95a0170a.fdab58","type":"template","z":"60528a1b.f32364","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n \n\n\n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\nSorry you are not able to access this page\n
\n\n\n\n","output":"str","x":710,"y":800,"wires":[["7aa6b39d.f2722c"]]},{"id":"102ab00f.0b28b","type":"change","z":"60528a1b.f32364","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Unavaliable Module","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":800,"wires":[["6ec81c61.061cd4"]]},{"id":"6ec81c61.061cd4","type":"template","z":"60528a1b.f32364","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n// Display Popup\npopup.onmessage = function(d) {\n var txt = d.data;\n alert(txt);\n};\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":590,"y":800,"wires":[["95a0170a.fdab58"]]},{"id":"f13a1f16.82872","type":"link in","z":"60528a1b.f32364","name":"Not Licenced","links":["34ba01df.30c98e","981f0079.8aed3","ae2f0aa6.b83788","c1934064.6743e","3ef1e38d.001f0c","f99490de.c1fcb","28a27e6d.5aef12","7c60ce85.df3bb","1f567951.b54357","985d53b9.d1886","35068c2f.a9b8b4","7eec4d28.128ec4","e9c91e07.38088","c6b24bdc.0d6158","d2ce817e.0c903","70722b52.c7b7d4","ce2ef575.3ca4f8","1bdee69f.d69879","826d284d.cae348","a9e43bb2.c39a08","a09805de.c65d98","12e7e314.ca01cd","d3d1d66e.98d9a8","2c36e9b3.4b4696","c8fee362.8be85","c14eb3d.6de925","7ac9201a.5756a","f74bf0a0.7ec6","453c2b99.3d2654","3610e485.e6047c"],"x":375,"y":800,"wires":[["102ab00f.0b28b"]]},{"id":"6ca3eb83.432e44","type":"comment","z":"60528a1b.f32364","name":"Unlicenced Module Webpage","info":"this Flow is the webpage that is served if a user tries to access a page they are not licenced for. this can be triggered from any page by a link node.","x":480,"y":760,"wires":[]},{"id":"57140bc4.737114","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'ExportUSB','Export All to USB', '{{timestamp}}', '{{timestamp}}');","output":"str","x":550,"y":520,"wires":[["aa2c8114.eb4a8"]]},{"id":"aa2c8114.eb4a8","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":520,"wires":[["2a3fe792.b505c8"]]},{"id":"9ebb47d8.f65978","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":520,"wires":[["57140bc4.737114"]]},{"id":"2a3fe792.b505c8","type":"template","z":"b00e2d77.a9931","name":"Export All","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT \n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log`\n\nORDER BY `rxTime` DESC;","output":"str","x":920,"y":480,"wires":[["f18406a.f7faef8"]]},{"id":"f18406a.f7faef8","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1070,"y":480,"wires":[["390160a5.8ab92"]]},{"id":"390160a5.8ab92","type":"function","z":"b00e2d77.a9931","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \nvar rxtime = new Date(msg.payload[i].rxTime);\nvar statusTime = new Date(msg.payload[i].statusTime);\nvar exportedTime = new Date(msg.payload[i].exported);\n\nif (msg.payload[i].exported === null) {\n msg.payload[i].ExportedTime = \"n/a\"\n} else {\nmsg.payload[i].ExportedTime = exportedTime\n}\n\nmsg.payload[i].StatusTime = statusTime\nmsg.payload[i].ReceivedTime = rxtime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1260,"y":480,"wires":[["ae68ab8d.892138"]]},{"id":"ae68ab8d.892138","type":"csv","z":"b00e2d77.a9931","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\n","temp":"Index, Call Point, Alias, Message, ReceivedTime, Status, StatusTime, ExportedTime, Recipient, System ID","skip":"0","x":1430,"y":480,"wires":[["37d0780.6d43088"]]},{"id":"6718e06d.1a7ba","type":"file","z":"b00e2d77.a9931","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","x":1690,"y":480,"wires":[["8733b6b6.ceecc8","5976af7.cc2d25"]]},{"id":"37d0780.6d43088","type":"template","z":"b00e2d77.a9931","name":"","field":"filename","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"/media/usb0/log/{{timestamp}}.csv","output":"str","x":1560,"y":480,"wires":[["6718e06d.1a7ba"]]},{"id":"df0dd902.e39c78","type":"catch","z":"b00e2d77.a9931","name":"","scope":["6718e06d.1a7ba"],"x":1690,"y":440,"wires":[["5c219c0f.48fa14","b5112973.1619b8"]]},{"id":"bc5cc87f.5767a8","type":"websocket out","z":"b00e2d77.a9931","name":"Show Alert for File Error","server":"4586ec4f.d85214","client":"","x":2090,"y":460,"wires":[]},{"id":"5c219c0f.48fa14","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Error exporting to USB, Please check USB Stick is inserted","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1860,"y":440,"wires":[["bc5cc87f.5767a8","88debd97.7e53e"]]},{"id":"8733b6b6.ceecc8","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Export Complete","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1860,"y":480,"wires":[["bc5cc87f.5767a8","88debd97.7e53e"]]},{"id":"5976af7.cc2d25","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1830,"y":520,"wires":[]},{"id":"b5112973.1619b8","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1830,"y":400,"wires":[]},{"id":"88debd97.7e53e","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2070,"y":540,"wires":[]},{"id":"9fd61880.516a68","type":"comment","z":"23c43518.b3ff0a","name":"Put Unprocessed On the Webpage","info":"","x":180,"y":240,"wires":[]},{"id":"ebcd4c65.6046a","type":"template","z":"23c43518.b3ff0a","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nWHERE `cleared` = '0'\nORDER BY `{{global.sort-by}}` {{global.direction}}","output":"str","x":310,"y":340,"wires":[["66291f5f.af93b"]]},{"id":"6264593.4e61aa8","type":"websocket out","z":"23c43518.b3ff0a","name":"","server":"d9d1357a.d4f118","client":"","x":1380,"y":340,"wires":[]},{"id":"dca11650.a5a9e8","type":"comment","z":"23c43518.b3ff0a","name":"Build Webpage","info":"","x":120,"y":20,"wires":[]},{"id":"66291f5f.af93b","type":"sqlite","z":"23c43518.b3ff0a","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":340,"wires":[["16a49dc6.39c7b2","1c5036dd.808169"]]},{"id":"75cd0257.5b5c8c","type":"template","z":"23c43518.b3ff0a","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Index
\n
Location
\n
Message
\n
Time
\n
Date
\n
Elapsed
\n
\n \n{{#payload}}\n
\n
{{{index}}}
\n
{{{part2}}} {{sender}}
\n
{{{part1}}}
\n
{{{displayTime}}}
\n
{{{displayDate}}}
\n
{{{elapsed}}}
\n
\n{{/payload}}","output":"str","x":1190,"y":340,"wires":[["6264593.4e61aa8"]]},{"id":"5ea79923.89c6a8","type":"function","z":"23c43518.b3ff0a","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":820,"y":340,"wires":[["ce83b6ba.b91948"]]},{"id":"ce83b6ba.b91948","type":"function","z":"23c43518.b3ff0a","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":340,"wires":[["75cd0257.5b5c8c"]]},{"id":"5c4d6c4d.b2cf34","type":"inject","z":"23c43518.b3ff0a","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":340,"wires":[["ebcd4c65.6046a"]]},{"id":"c0f55161.eb2e9","type":"websocket in","z":"23c43518.b3ff0a","name":"","server":"95962f80.19ef3","client":"","x":140,"y":440,"wires":[["d47e3460.18a298"]]},{"id":"e4b4571a.fa0ca8","type":"comment","z":"23c43518.b3ff0a","name":"Hide Message on Click","info":"","x":160,"y":400,"wires":[]},{"id":"3dc80a3a.37f5b6","type":"template","z":"23c43518.b3ff0a","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":440,"wires":[["81d2af9c.b2af1"]]},{"id":"81d2af9c.b2af1","type":"sqlite","z":"23c43518.b3ff0a","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":440,"wires":[["28ec47d.cd906b8"]]},{"id":"28ec47d.cd906b8","type":"link out","z":"23c43518.b3ff0a","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec"],"x":915,"y":440,"wires":[]},{"id":"bde9417c.ae3fa","type":"change","z":"23c43518.b3ff0a","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":440,"wires":[["3dc80a3a.37f5b6"]]},{"id":"47f470.6d282b9","type":"http response","z":"23c43518.b3ff0a","name":"","statusCode":"201","headers":{},"x":800,"y":120,"wires":[]},{"id":"9b9c90b8.58988","type":"template","z":"23c43518.b3ff0a","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n\n\n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n\n\n","output":"str","x":670,"y":120,"wires":[["47f470.6d282b9"]]},{"id":"5e777687.bf0378","type":"change","z":"23c43518.b3ff0a","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Dynamic Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":120,"wires":[["9b1e3c99.05267"]]},{"id":"d47e3460.18a298","type":"switch","z":"23c43518.b3ff0a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":440,"wires":[["bde9417c.ae3fa"],["b19f9c2a.0005a"]]},{"id":"ea0ecadf.2504f8","type":"comment","z":"e3cbac21.52804","name":"Receive Page","info":"","x":90,"y":140,"wires":[]},{"id":"4c566771.e36038","type":"template","z":"e3cbac21.52804","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'FP', 'rxTime', 'status', 'statusTime', 'exported', 'cleared','late','duplicate','T/R','payload') \nVALUES ('{{capcode}}', '{{pagerNumber}}', '{{sysID}}', '{{{group}}}', '{{part1}}', '{{part2}}', '{{sender}}', '{{{FP}}}','{{timestamp}}', '{{{status}}}', '{{timestamp}}', '{{exported}}', '{{cleared}}', '{{late}}', '{{duplicate}}', '0', '{{{payload}}}');","output":"str","x":1420,"y":220,"wires":[["76901721.920c58"]]},{"id":"c7eb5365.d6ebd","type":"link in","z":"e3cbac21.52804","name":"Received Page","links":["c94a9d48.9c2c"],"x":1255,"y":240,"wires":[["4c566771.e36038","d3cc339c.3f9a3","6fb08921.c8e198","1bb43e1a.eed742"]]},{"id":"76901721.920c58","type":"sqlite","z":"e3cbac21.52804","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1710,"y":220,"wires":[["bc4b27b0.6d1478"]]},{"id":"16a49dc6.39c7b2","type":"function","z":"23c43518.b3ff0a","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":340,"wires":[["5ea79923.89c6a8"]]},{"id":"734abd62.6c0054","type":"serial out","z":"dad6f0f1.28177","name":"","serial":"5d6eb2f4.fc698c","x":790,"y":260,"wires":[]},{"id":"66a1cd6e.22e4e4","type":"inject","z":"dad6f0f1.28177","name":"Enable Dry Contact 0","topic":"","payload":"SINP,1,911,Door ","payloadType":"string","repeat":"","crontab":"","once":false,"x":520,"y":140,"wires":[["734abd62.6c0054"]]},{"id":"8e4d5133.e1bf3","type":"inject","z":"dad6f0f1.28177","name":"Repeat Off","topic":"","payload":"RPTRX,0","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":560,"y":100,"wires":[["734abd62.6c0054"]]},{"id":"39d79a16.339446","type":"inject","z":"dad6f0f1.28177","name":"Enable Receive","topic":"","payload":"INTFMODE,1","payloadType":"string","repeat":"","crontab":"","once":false,"x":540,"y":220,"wires":[["734abd62.6c0054"]]},{"id":"cbe825bf.1337a8","type":"inject","z":"dad6f0f1.28177","name":"Send Page","topic":"","payload":"CCPAGE,0807288,TEST","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":560,"y":260,"wires":[["734abd62.6c0054"]]},{"id":"e34f4022.12139","type":"inject","z":"dad6f0f1.28177","name":"Enable Dry Contact 1","topic":"","payload":"SINP1,1,911,Door ","payloadType":"string","repeat":"","crontab":"","once":false,"x":520,"y":180,"wires":[["734abd62.6c0054"]]},{"id":"37e179b9.9b9f86","type":"comment","z":"b8bd1cc3.4827","name":"Put Unprocessed On the Webpage","info":"","x":200,"y":260,"wires":[]},{"id":"f1c61ac.2a61be8","type":"template","z":"b8bd1cc3.4827","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nWHERE `cleared` = '0' AND `duplicate` = '0'\nORDER BY `rxTime` DESC \nLIMIT 5;\n\n","output":"str","x":330,"y":300,"wires":[["f1a5e48e.f2da48"]]},{"id":"daef15a.4ef89e8","type":"websocket out","z":"b8bd1cc3.4827","name":"","server":"5e6c9ab1.74ef04","client":"","x":1390,"y":300,"wires":[]},{"id":"f1a5e48e.f2da48","type":"sqlite","z":"b8bd1cc3.4827","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":510,"y":300,"wires":[["c1b56b46.0f7818","5d19cfa1.ed974"]]},{"id":"8be4aba0.feaed8","type":"template","z":"b8bd1cc3.4827","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{#payload}}\n\n
\n {{{part1}}}\n
\n {{{part2}}} {{sender}}\n
\n {{{elapsed}}}\n
\n{{/payload}}","output":"str","x":1210,"y":300,"wires":[["daef15a.4ef89e8"]]},{"id":"3eca0fc8.c120d","type":"websocket in","z":"b8bd1cc3.4827","name":"","server":"addfeab3.3935e8","client":"","x":140,"y":460,"wires":[["c5eb9330.50819"]]},{"id":"1f847469.688d7c","type":"comment","z":"b8bd1cc3.4827","name":"Hide Message on Click","info":"","x":160,"y":420,"wires":[]},{"id":"cd533235.40194","type":"template","z":"b8bd1cc3.4827","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":440,"wires":[["3e54b72d.158e18"]]},{"id":"3e54b72d.158e18","type":"sqlite","z":"b8bd1cc3.4827","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":440,"wires":[["18e72d9f.360682"]]},{"id":"18e72d9f.360682","type":"link out","z":"b8bd1cc3.4827","name":"","links":["13c2aaaa.74d295","8452a925.e651d8","f72ff61b.e8d618","f8b2c7bc.b77368","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":915,"y":440,"wires":[]},{"id":"a760c9de.c3c958","type":"change","z":"b8bd1cc3.4827","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":440,"wires":[["cd533235.40194"]]},{"id":"c5eb9330.50819","type":"switch","z":"b8bd1cc3.4827","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":460,"wires":[["a760c9de.c3c958"],["91921094.a8632"]]},{"id":"8452a925.e651d8","type":"link in","z":"b8bd1cc3.4827","name":"Received Page","links":["c94a9d48.9c2c","91921094.a8632","18e72d9f.360682"],"x":215,"y":340,"wires":[["f1c61ac.2a61be8"]]},{"id":"c1b56b46.0f7818","type":"function","z":"b8bd1cc3.4827","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP === \"\") {\n msg.payload[i].style = \"default\"\n} else {\n msg.payload[i].style = msg.payload[i].FP \n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":300,"wires":[["7502bae2.b01d14","311030ac.d9f2b"]]},{"id":"91921094.a8632","type":"link out","z":"b8bd1cc3.4827","name":"","links":["8452a925.e651d8"],"x":375,"y":480,"wires":[]},{"id":"6d21559e.0372fc","type":"http in","z":"b8bd1cc3.4827","name":"","url":"/firstaid","method":"get","upload":false,"swaggerDoc":"","x":110,"y":220,"wires":[["e27d3777.8cf898","6d3d48bb.e324b8"]]},{"id":"8e112c9a.4a00a","type":"comment","z":"b8bd1cc3.4827","name":"Build Webpage","info":"","x":140,"y":20,"wires":[]},{"id":"23c32a03.41b276","type":"http response","z":"b8bd1cc3.4827","name":"","statusCode":"201","headers":{},"x":820,"y":160,"wires":[]},{"id":"598c3baa.7efd84","type":"template","z":"b8bd1cc3.4827","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":690,"y":160,"wires":[["23c32a03.41b276"]]},{"id":"4d7773b3.0108ec","type":"change","z":"b8bd1cc3.4827","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall First Aid Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":160,"wires":[["d3c7d55.b404528"]]},{"id":"33ff1e8e.291482","type":"function","z":"ca9def01.26ba2","name":"Payload to Page","func":"var message = msg.payload;\nvar sendmessage = message; //.replace(/\\n/g, \" \");\nvar capcode = msg.capcode;\nvar address = 0707288;//capcode;\nvar page = \"CCPAGE,\"+ address + \",\"+ sendmessage + \"\\n\";\nmsg.payload = page\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":220,"wires":[["2dd9fe99.b05ae2","8d0ad831.2c6d48"]]},{"id":"2dd9fe99.b05ae2","type":"debug","z":"ca9def01.26ba2","name":"Page Sent","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":180,"wires":[]},{"id":"7b760cf6.6127c4","type":"comment","z":"ca9def01.26ba2","name":"Send Page","info":"","x":140,"y":40,"wires":[]},{"id":"d51608e.09159f8","type":"switch","z":"ca9def01.26ba2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"null"},{"t":"cont","v":"undefined","vt":"str"},{"t":"cont","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":160,"wires":[["38ff2879.47e0b8"],["38ff2879.47e0b8"],["38ff2879.47e0b8"]]},{"id":"38ff2879.47e0b8","type":"change","z":"ca9def01.26ba2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Please Enter a Message to Send","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":140,"wires":[["f13e64e1.363ed8"]]},{"id":"d19364d9.208968","type":"switch","z":"ca9def01.26ba2","name":"","property":"capcode","propertyType":"msg","rules":[{"t":"null"},{"t":"cont","v":"undefined","vt":"str"},{"t":"cont","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":100,"wires":[["ebe0115.f169ff"],["ebe0115.f169ff"],["ebe0115.f169ff"]]},{"id":"ebe0115.f169ff","type":"change","z":"ca9def01.26ba2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Please Select a User to Send a Page to","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":100,"wires":[["f13e64e1.363ed8"]]},{"id":"f13e64e1.363ed8","type":"delay","z":"ca9def01.26ba2","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":690,"y":120,"wires":[[]]},{"id":"fb44d9db.726018","type":"change","z":"ca9def01.26ba2","name":"","rules":[{"t":"set","p":"justSent","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":40,"wires":[[]]},{"id":"8d0ad831.2c6d48","type":"serial out","z":"ca9def01.26ba2","name":"","serial":"5d6eb2f4.fc698c","x":630,"y":220,"wires":[]},{"id":"4c251e8b.6402c","type":"inject","z":"ca9def01.26ba2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":220,"wires":[["33ff1e8e.291482"]]},{"id":"f5c9a8af.c8e3d8","type":"inject","z":"b8bd1cc3.4827","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":300,"wires":[["f1c61ac.2a61be8"]]},{"id":"d3c7d55.b404528","type":"template","z":"b8bd1cc3.4827","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/firstaid/receive');\n var send = new WebSocket('ws://' + location.host + '/firstaid/send');\n\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":570,"y":160,"wires":[["598c3baa.7efd84"]]},{"id":"7502bae2.b01d14","type":"function","z":"b8bd1cc3.4827","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":300,"wires":[["782036fe.ccf868"]]},{"id":"782036fe.ccf868","type":"function","z":"b8bd1cc3.4827","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":300,"wires":[["8be4aba0.feaed8"]]},{"id":"347129a0.c27516","type":"comment","z":"d0e2bfbf.dfe3f","name":"Put Unprocessed On the Webpage","info":"","x":200,"y":240,"wires":[]},{"id":"50ca75a6.b021bc","type":"template","z":"d0e2bfbf.dfe3f","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0'\nORDER BY `rxTime` ASC \nLIMIT 25;\n\n","output":"str","x":290,"y":280,"wires":[["fd8d56d.e7aa7a8"]]},{"id":"2ed84fa4.796ce","type":"websocket out","z":"d0e2bfbf.dfe3f","name":"","server":"4d6db4a9.f35a1c","client":"","x":1330,"y":280,"wires":[]},{"id":"fd8d56d.e7aa7a8","type":"sqlite","z":"d0e2bfbf.dfe3f","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":470,"y":280,"wires":[["95edf698.93a828"]]},{"id":"202c524f.39489e","type":"template","z":"d0e2bfbf.dfe3f","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n{{#payload}}\n\n
\n {{{part1}}}\n
\n {{{part2}}} {{sender}}\n
\n {{{elapsed}}}\n \n
\n{{/payload}}\n\n
","output":"str","x":1150,"y":280,"wires":[["2ed84fa4.796ce"]]},{"id":"c46324a1.00d1e8","type":"websocket in","z":"d0e2bfbf.dfe3f","name":"","server":"c2e44b88.6a4e78","client":"","x":140,"y":440,"wires":[["942c85de.4a0538"]]},{"id":"3d3f5ebf.ecd7d2","type":"comment","z":"d0e2bfbf.dfe3f","name":"Hide Message on Click","info":"","x":160,"y":400,"wires":[]},{"id":"f28c0a0f.a04258","type":"template","z":"d0e2bfbf.dfe3f","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":420,"wires":[["12068c22.433ac4"]]},{"id":"12068c22.433ac4","type":"sqlite","z":"d0e2bfbf.dfe3f","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":420,"wires":[["5f3d896d.781188"]]},{"id":"5f3d896d.781188","type":"link out","z":"d0e2bfbf.dfe3f","name":"","links":["13c2aaaa.74d295","7b129f21.76ae3","f72ff61b.e8d618","f8b2c7bc.b77368"],"x":915,"y":420,"wires":[]},{"id":"aa42f2de.8b38c","type":"change","z":"d0e2bfbf.dfe3f","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":420,"wires":[["f28c0a0f.a04258"]]},{"id":"942c85de.4a0538","type":"switch","z":"d0e2bfbf.dfe3f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":440,"wires":[["aa42f2de.8b38c"],["adc7e162.e371e"]]},{"id":"7b129f21.76ae3","type":"link in","z":"d0e2bfbf.dfe3f","name":"Received Page","links":["c94a9d48.9c2c","adc7e162.e371e","5f3d896d.781188"],"x":155,"y":320,"wires":[["50ca75a6.b021bc"]]},{"id":"95edf698.93a828","type":"function","z":"d0e2bfbf.dfe3f","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":280,"wires":[["6a1eea5b.f38504"]]},{"id":"adc7e162.e371e","type":"link out","z":"d0e2bfbf.dfe3f","name":"","links":["7b129f21.76ae3"],"x":375,"y":460,"wires":[]},{"id":"68f940a1.aa25a","type":"http in","z":"d0e2bfbf.dfe3f","name":"","url":"/table","method":"get","upload":false,"swaggerDoc":"","x":120,"y":160,"wires":[["1e6521b9.49276e"]]},{"id":"dd7be086.62c","type":"comment","z":"d0e2bfbf.dfe3f","name":"Build Webpage","info":"","x":140,"y":20,"wires":[]},{"id":"41327f62.b2296","type":"http response","z":"d0e2bfbf.dfe3f","name":"","statusCode":"201","headers":{},"x":760,"y":140,"wires":[]},{"id":"4d8cff25.18cce","type":"template","z":"d0e2bfbf.dfe3f","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n\n\n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":630,"y":140,"wires":[["41327f62.b2296"]]},{"id":"b20ec190.c8d73","type":"change","z":"d0e2bfbf.dfe3f","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Table Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":140,"wires":[["c20fda87.cc67c8"]]},{"id":"2efce273.a5ca5e","type":"inject","z":"d0e2bfbf.dfe3f","name":"","topic":"","payload":"","payloadType":"str","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":280,"wires":[["50ca75a6.b021bc"]]},{"id":"c20fda87.cc67c8","type":"template","z":"d0e2bfbf.dfe3f","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/table/receive');\n var send = new WebSocket('ws://' + location.host + '/table/send');\n\n \n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":510,"y":140,"wires":[["4d8cff25.18cce"]]},{"id":"6a1eea5b.f38504","type":"function","z":"d0e2bfbf.dfe3f","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":280,"wires":[["a93183fc.ce466"]]},{"id":"a93183fc.ce466","type":"function","z":"d0e2bfbf.dfe3f","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":990,"y":280,"wires":[["202c524f.39489e"]]},{"id":"b8fb71d2.ee132","type":"comment","z":"53e35596.381c0c","name":"Put Quick Page On the Webpage","info":"","x":190,"y":320,"wires":[]},{"id":"c4849d.0bb81b6","type":"template","z":"53e35596.381c0c","name":"Select Quick Page Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `quick_page`;","output":"str","x":230,"y":360,"wires":[["552dba34.1f3124"]]},{"id":"7b33fb9a.d5c6e4","type":"websocket out","z":"53e35596.381c0c","name":"","server":"b03253f0.29251","client":"","x":790,"y":360,"wires":[]},{"id":"552dba34.1f3124","type":"sqlite","z":"53e35596.381c0c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":430,"y":360,"wires":[["8ac6b75b.594968"]]},{"id":"8ac6b75b.594968","type":"template","z":"53e35596.381c0c","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n{{#payload}}\n\n
\n {{{content}}}\n
\n to \n
\n Pager {{pagerNumber}}:{{sysID}}\n
\n{{/payload}}\n\n
","output":"str","x":590,"y":360,"wires":[["7b33fb9a.d5c6e4"]]},{"id":"cfc68d0c.62c43","type":"websocket in","z":"53e35596.381c0c","name":"","server":"25343a6d.90cb36","client":"","x":160,"y":480,"wires":[["a548061f.54f0e8"]]},{"id":"68b8882e.ea23b8","type":"comment","z":"53e35596.381c0c","name":"Send Message on Click","info":"","x":160,"y":440,"wires":[]},{"id":"46042ba6.d8f454","type":"template","z":"53e35596.381c0c","name":"Get Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `quick_page`\nWHERE `index` = {{payload}};","output":"str","x":600,"y":460,"wires":[["cc8e6c1f.215e6"]]},{"id":"cc8e6c1f.215e6","type":"sqlite","z":"53e35596.381c0c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":750,"y":460,"wires":[["7b2e6691.d4da08","b52928ed.f9b338"]]},{"id":"e0895cf.e2cc3a","type":"change","z":"53e35596.381c0c","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":460,"wires":[["46042ba6.d8f454"]]},{"id":"a548061f.54f0e8","type":"switch","z":"53e35596.381c0c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":480,"wires":[["e0895cf.e2cc3a"],["17234e1e.8eeca2"]]},{"id":"b28b9e2d.bfccc","type":"link in","z":"53e35596.381c0c","name":"Received Page","links":["17234e1e.8eeca2","35084556.d6290a"],"x":75,"y":360,"wires":[["c4849d.0bb81b6"]]},{"id":"17234e1e.8eeca2","type":"link out","z":"53e35596.381c0c","name":"","links":["b28b9e2d.bfccc"],"x":415,"y":500,"wires":[]},{"id":"6ce28d0.bdfa474","type":"http in","z":"53e35596.381c0c","name":"","url":"/quickpage","method":"get","upload":false,"swaggerDoc":"","x":120,"y":240,"wires":[["7530d890.2f9e38"]]},{"id":"49c037c6.8dc4a8","type":"comment","z":"53e35596.381c0c","name":"Build Webpage","info":"","x":140,"y":20,"wires":[]},{"id":"1ec8e1d3.e5803e","type":"http response","z":"53e35596.381c0c","name":"","statusCode":"201","headers":{},"x":800,"y":220,"wires":[]},{"id":"89919094.304b","type":"template","z":"53e35596.381c0c","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n\n \n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":670,"y":220,"wires":[["1ec8e1d3.e5803e"]]},{"id":"22601c7c.9bf294","type":"change","z":"53e35596.381c0c","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Quick Page","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":220,"wires":[["6a9ce3d9.08b75c"]]},{"id":"6a9ce3d9.08b75c","type":"template","z":"53e35596.381c0c","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/quickpage/receive');\n var send = new WebSocket('ws://' + location.host + '/quickpage/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":550,"y":220,"wires":[["89919094.304b"]]},{"id":"297421bf.20dd2e","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":80,"wires":[["778882cf.77930c"]]},{"id":"9d24fe8d.65aec","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE \"quick_page\" ( `index` INTEGER PRIMARY KEY AUTOINCREMENT, `pagerNumber` INTEGER, `sysID` INTEGER, `content` TEXT, `FP` TEXT )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":80,"wires":[["297421bf.20dd2e"]]},{"id":"778882cf.77930c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":80,"wires":[]},{"id":"76d7a70a.2fcec8","type":"comment","z":"ba76d305.cf8ad","name":"Log","info":"","x":490,"y":40,"wires":[]},{"id":"de9a1c50.0387e","type":"comment","z":"ba76d305.cf8ad","name":"Quick Page","info":"","x":1230,"y":40,"wires":[]},{"id":"5380aeca.f0398","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":120,"wires":[]},{"id":"d2a7806a.847fb","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":120,"wires":[["5380aeca.f0398"]]},{"id":"6727d5f9.79503c","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":120,"wires":[["d2a7806a.847fb"]]},{"id":"13dadbb0.3bee54","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":240,"wires":[["881c792.ec4a688"]]},{"id":"42fa1f34.f12d1","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":240,"wires":[["13dadbb0.3bee54"]]},{"id":"71f5ce83.ae175","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":160,"wires":[]},{"id":"30d4a402.d0012c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":160,"wires":[["71f5ce83.ae175"]]},{"id":"fe233e7d.a51e","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":160,"wires":[["30d4a402.d0012c"]]},{"id":"881c792.ec4a688","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":240,"wires":[]},{"id":"ee95f3c1.3f828","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":200,"wires":[]},{"id":"a4a3a07e.f78fa","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":200,"wires":[["ee95f3c1.3f828"]]},{"id":"2d34ef10.10738","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":980,"y":200,"wires":[["a4a3a07e.f78fa"]]},{"id":"7b2e6691.d4da08","type":"template","z":"53e35596.381c0c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.0.pagerNumber}},{{payload.0.sysID}},{{{payload.0.content}}}\\f{{{payload.0.FP}}}","output":"str","x":900,"y":460,"wires":[["3cb58cbd.165284","e1963d60.f46e6"]]},{"id":"3cb58cbd.165284","type":"serial out","z":"53e35596.381c0c","name":"","serial":"5d6eb2f4.fc698c","x":1110,"y":460,"wires":[]},{"id":"184ea2f9.fe199d","type":"switch","z":"e3cbac21.52804","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"\\x19A(\\d*)d\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\x0c?(.*)?\\x18|\\x19A(\\d*)d(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?\\x18|RECV,4,(\\d*),\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\%?0?C?(.*)?|RECV,4,(\\d*),(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?","vt":"str","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":240,"wires":[["1cbf532e.685a3d"],[]]},{"id":"bfe6947b.66f8f8","type":"template","z":"53e35596.381c0c","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'content', 'msgPart1', 'msgPart2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.0.pagerNumber}}', '{{payload.0.sysID}}', '0', '{{payload.0.content}}', 'n/a', 'n/a', '{{payload.0.sender}}','{{timestamp}}', 'Quick Page', '{{timestamp}}', '{{{payload.0.FP}}}', 'n/a','T');","output":"str","x":1040,"y":520,"wires":[["3c1f3e87.640562"]]},{"id":"3c1f3e87.640562","type":"sqlite","z":"53e35596.381c0c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":520,"wires":[["80365a9f.6e5ef8"]]},{"id":"b52928ed.f9b338","type":"change","z":"53e35596.381c0c","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":520,"wires":[["bfe6947b.66f8f8"]]},{"id":"80365a9f.6e5ef8","type":"link out","z":"53e35596.381c0c","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1335,"y":520,"wires":[]},{"id":"1bf9a4b6.f54f3b","type":"comment","z":"1c96dbb1.1bc354","name":"Put All On the Webpage","info":"","x":140,"y":320,"wires":[]},{"id":"40df00fd.261f1","type":"http response","z":"1c96dbb1.1bc354","name":"","statusCode":"201","headers":{},"x":760,"y":240,"wires":[]},{"id":"47e061c2.9cfec","type":"template","z":"1c96dbb1.1bc354","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `data`\nORDER BY `{{global.sort-by}}` {{global.direction}}","output":"str","x":330,"y":420,"wires":[["544d98ea.b79288"]]},{"id":"a7584546.9a1cb8","type":"websocket out","z":"1c96dbb1.1bc354","name":"","server":"32989c5a.d6ee14","client":"","x":1290,"y":420,"wires":[]},{"id":"8595684f.e6b5d8","type":"comment","z":"1c96dbb1.1bc354","name":"Build Webpage","info":"","x":100,"y":60,"wires":[]},{"id":"544d98ea.b79288","type":"sqlite","z":"1c96dbb1.1bc354","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":510,"y":420,"wires":[["958508cb.755b28"]]},{"id":"40e6251b.e6404c","type":"function","z":"1c96dbb1.1bc354","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":420,"wires":[["3530697b.f604f6"]]},{"id":"bcfd7457.19e388","type":"link in","z":"1c96dbb1.1bc354","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","9b70e3c3.c129d","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","ce5be23d.4618f","64848176.9353c","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":175,"y":440,"wires":[["47e061c2.9cfec"]]},{"id":"ee469ce7.3e75a","type":"websocket in","z":"1c96dbb1.1bc354","name":"","server":"8ad92631.0da208","client":"","x":120,"y":360,"wires":[["9e864380.21a48"]]},{"id":"6763c15d.e3fa5","type":"template","z":"1c96dbb1.1bc354","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n\n\n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":630,"y":240,"wires":[["40df00fd.261f1"]]},{"id":"a74297ce.590ef8","type":"change","z":"1c96dbb1.1bc354","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Full Log","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":240,"wires":[["8e473da7.f3f4f"]]},{"id":"958508cb.755b28","type":"function","z":"1c96dbb1.1bc354","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":420,"wires":[["40e6251b.e6404c"]]},{"id":"3530697b.f604f6","type":"template","z":"1c96dbb1.1bc354","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Index
\n
Callpoint
\n
Message
\n
Receive Time
\n
Receive Date
\n
Status
\n
Status Time
\n
Status Date
\n
Export Time
\n
Export Date
\n
Recipient
\n
System ID
\n
Group
\n
Flash Pattern
\n
\n{{#payload}}\n
\n
{{index}}
\n
{{sender}}
\n
{{{part1}}}-{{{part2}}}
\n
{{displayTime}}
\n
{{displayDate}}
\n
{{status}}
\n
{{displayStatusTime}}
\n
{{displayStatusDate}}
\n
{{{displayExportedTime}}}
\n
{{{displayExportedDate}}}
\n
{{pagerNumber}}
\n
{{sysID}}
\n
{{group}}
\n
{{FP}}
\n
\n{{/payload}}","output":"str","x":1070,"y":420,"wires":[["a7584546.9a1cb8"]]},{"id":"8e473da7.f3f4f","type":"template","z":"1c96dbb1.1bc354","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/log-full/receive');\nvar send = new WebSocket('ws://' + location.host + '/log-full/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":510,"y":240,"wires":[["6763c15d.e3fa5"]]},{"id":"9e864380.21a48","type":"switch","z":"1c96dbb1.1bc354","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":360,"wires":[["f0d611c3.bfa1d"],["47e061c2.9cfec"]]},{"id":"f0d611c3.bfa1d","type":"change","z":"1c96dbb1.1bc354","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":360,"wires":[["1d5a046c.c6fa9c"]]},{"id":"1d5a046c.c6fa9c","type":"switch","z":"1c96dbb1.1bc354","name":"","property":"direction","propertyType":"global","rules":[{"t":"eq","v":"ASC","vt":"str"},{"t":"eq","v":"DESC","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":360,"wires":[["70b3cf79.3c274"],["aa735ccd.7575e"]]},{"id":"70b3cf79.3c274","type":"change","z":"1c96dbb1.1bc354","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":340,"wires":[["9b70e3c3.c129d"]]},{"id":"aa735ccd.7575e","type":"change","z":"1c96dbb1.1bc354","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"ASC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":380,"wires":[["9b70e3c3.c129d"]]},{"id":"9b70e3c3.c129d","type":"link out","z":"1c96dbb1.1bc354","name":"","links":["bcfd7457.19e388"],"x":915,"y":360,"wires":[]},{"id":"38c97d52.720a32","type":"http in","z":"1c96dbb1.1bc354","name":"","url":"/log-full","method":"get","upload":false,"swaggerDoc":"","x":110,"y":260,"wires":[["ecde1301.2ebb3"]]},{"id":"577e3b25.879e44","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"index","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":240,"wires":[[]]},{"id":"b6c859b7.94b658","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":280,"wires":[[]]},{"id":"9da7d1fb.8f7cd","type":"http response","z":"b209c94d.26d798","name":"","statusCode":"201","headers":{},"x":760,"y":160,"wires":[]},{"id":"b3d8b7b0.5cd1d8","type":"comment","z":"b209c94d.26d798","name":"Build Webpage","info":"","x":120,"y":40,"wires":[]},{"id":"5e3e72a4.9cd99c","type":"template","z":"b209c94d.26d798","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n\n\n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":630,"y":160,"wires":[["9da7d1fb.8f7cd"]]},{"id":"14d14541.b18d6b","type":"template","z":"b209c94d.26d798","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/log-daily/receive');\nvar send = new WebSocket('ws://' + location.host + '/log-daily/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":510,"y":160,"wires":[["5e3e72a4.9cd99c"]]},{"id":"c6cb5bad.c0e8d8","type":"http in","z":"b209c94d.26d798","name":"","url":"/log-daily","method":"get","upload":false,"swaggerDoc":"","x":110,"y":180,"wires":[["5dda820c.bf5e2c"]]},{"id":"27fce5ac.018c5a","type":"change","z":"b209c94d.26d798","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Daily Log","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":160,"wires":[["14d14541.b18d6b"]]},{"id":"cd63b42b.c622b8","type":"switch","z":"e3cbac21.52804","name":"","property":"sysID","propertyType":"msg","rules":[{"t":"eq","v":"sysID","vt":"global"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":240,"wires":[["f2b86262.fdc9c"],[]]},{"id":"9ff12e3d.bf8a4","type":"inject","z":"dad6f0f1.28177","name":"Set Welcome Message","topic":"","payload":"WPROG,Capturecall","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":520,"y":300,"wires":[["734abd62.6c0054"]]},{"id":"ba2546c7.c3a838","type":"inject","z":"dad6f0f1.28177","name":"Set Pager Number on Pager","topic":"","payload":"CCPROG,1,0800080","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":500,"y":340,"wires":[["734abd62.6c0054"]]},{"id":"2e0a6b46.bba6d4","type":"inject","z":"dad6f0f1.28177","name":"Set All Page Number on Pager","topic":"","payload":"CCPROG,2,0807288","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":490,"y":380,"wires":[["734abd62.6c0054"]]},{"id":"45923828.f892f8","type":"inject","z":"dad6f0f1.28177","name":"Set System Code on Pager","topic":"","payload":"CCPROG,3,0800000","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":510,"y":420,"wires":[["734abd62.6c0054"]]},{"id":"aa834245.ef833","type":"inject","z":"60528a1b.f32364","name":"Settings","topic":"","payload":"[{\"Name\":\"Home\",\"Address\":\"/home\"},{\"Name\":\"Settings Menu\",\"Address\":\"/settings\"},{\"Name\":\"Log Out\",\"Address\":\"/login/clear\"}]","payloadType":"json","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":420,"y":980,"wires":[["fc768851.034bd8"]]},{"id":"fc768851.034bd8","type":"template","z":"60528a1b.f32364","name":"settings_list","field":"settings_list","fieldType":"global","format":"handlebars","syntax":"mustache","template":"\n
\n\n

","output":"str","x":570,"y":980,"wires":[[]]},{"id":"8701841e.83ae28","type":"comment","z":"60528a1b.f32364","name":"Set settings list","info":"","x":900,"y":980,"wires":[]},{"id":"9b687973.c1c618","type":"comment","z":"60528a1b.f32364","name":"Set Modules","info":"","x":730,"y":980,"wires":[]},{"id":"c1a00628.59b6f8","type":"http in","z":"38ad3d43.e07282","name":"","url":"/login","method":"get","upload":false,"swaggerDoc":"","x":140,"y":100,"wires":[["6192a8be.4d72c8"]]},{"id":"550b5a0f.5072d4","type":"comment","z":"38ad3d43.e07282","name":"Build Webpage","info":"","x":160,"y":60,"wires":[]},{"id":"c89bb567.c3cb18","type":"http response","z":"38ad3d43.e07282","name":"","statusCode":"201","headers":{},"x":780,"y":120,"wires":[]},{"id":"2c769665.50ee0a","type":"template","z":"38ad3d43.e07282","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n \n \n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":650,"y":120,"wires":[["c89bb567.c3cb18"]]},{"id":"25806f78.9cf92","type":"change","z":"38ad3d43.e07282","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Settings Login","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["32a07662.8f48aa"]]},{"id":"32a07662.8f48aa","type":"template","z":"38ad3d43.e07282","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/login/receive');\nvar send = new WebSocket('ws://' + location.host + '/login/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":530,"y":120,"wires":[["2c769665.50ee0a"]]},{"id":"d9b40d6b.4750d","type":"switch","z":"38ad3d43.e07282","name":"","property":"payload.password","propertyType":"msg","rules":[{"t":"eq","v":"Outtti5853","vt":"str"},{"t":"eq","v":"password","vt":"global"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":310,"y":240,"wires":[["af027ca6.8807c"],["78978698.738818"],["e7a85e8d.a40d2"]]},{"id":"feec4f17.d019f","type":"comment","z":"38ad3d43.e07282","name":"Handle Input from Webpage","info":"","x":200,"y":200,"wires":[]},{"id":"4212ad6a.fb9f04","type":"link in","z":"38ad3d43.e07282","name":"","links":["1154197f.e1f607","349faf1f.208a4","6376dfd7.0157b","81380517.b42f28","b88a2c28.954e5","bdc216af.c3bff8","d6762c10.0cdbe","d544b9ec.e25b78","48ed0abd.9ba044","3651a448.83f50c","6b3ad3e9.39b35c","14778f84.1ac3f"],"x":295,"y":140,"wires":[["25806f78.9cf92"]]},{"id":"67842090.6201b","type":"comment","z":"60528a1b.f32364","name":"Defaults","info":"* /sw,/hw,/fw - Used to set the versions shown on the settings pages\n* sysID - Used to set the system ID Filter\n* Modules - contains a JSON string used to set the Links to main pages and their displayed Names\n* Serial - Used to set the system serial number\n* Password - Used to set the default system password - 1234 at this time\n* Settings - contains a JSON string used to set the Links to settings pages and their displayed Names","x":1300,"y":360,"wires":[]},{"id":"ae630a94.2c51f8","type":"comment","z":"38ad3d43.e07282","name":"Put Data On the Webpage","info":"","x":190,"y":400,"wires":[]},{"id":"41f9608f.5bce4","type":"websocket out","z":"38ad3d43.e07282","name":"","server":"f92c2145.f46df","client":"","x":630,"y":440,"wires":[]},{"id":"3f8cd8ce.f9f008","type":"template","z":"38ad3d43.e07282","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n Please enter your Password:\n \n \n
","output":"str","x":450,"y":440,"wires":[["41f9608f.5bce4"]]},{"id":"54cf62a0.f54f4c","type":"websocket in","z":"38ad3d43.e07282","name":"","server":"d7115ac0.1e2888","client":"","x":160,"y":440,"wires":[["973bf238.76f1a"]]},{"id":"973bf238.76f1a","type":"switch","z":"38ad3d43.e07282","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":440,"wires":[["3f8cd8ce.f9f008"]]},{"id":"e7a85e8d.a40d2","type":"change","z":"38ad3d43.e07282","name":"Redirect to /Login","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/login","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":280,"wires":[["c89bb567.c3cb18"]]},{"id":"78978698.738818","type":"function","z":"38ad3d43.e07282","name":"Make Admin","func":"msg.cookies = { admin: {\n value: true,\n maxAge: 300000\n }};\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":240,"wires":[["e7a85e8d.a40d2"]]},{"id":"aa135bce.84f318","type":"function","z":"38ad3d43.e07282","name":"Remove Admin","func":"msg.cookies = { };\nmsg.cookies[\"admin\"] = false;\nmsg.cookies[\"god\"] = false;\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":300,"wires":[["e7a85e8d.a40d2"]]},{"id":"d5467695.376cc8","type":"http in","z":"38ad3d43.e07282","name":"","url":"/login/submit","method":"get","upload":false,"swaggerDoc":"","x":160,"y":240,"wires":[["d9b40d6b.4750d"]]},{"id":"6192a8be.4d72c8","type":"switch","z":"38ad3d43.e07282","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":100,"wires":[["eb0b90cc.4383"],["25806f78.9cf92"]]},{"id":"eb0b90cc.4383","type":"link out","z":"38ad3d43.e07282","name":"back to menu","links":["53c094fc.bf043c"],"x":375,"y":60,"wires":[]},{"id":"aed19d60.1bcf1","type":"http in","z":"38ad3d43.e07282","name":"","url":"/login/clear","method":"get","upload":false,"swaggerDoc":"","x":160,"y":300,"wires":[["aa135bce.84f318"]]},{"id":"c070b318.2640f","type":"http in","z":"ce69645.1231098","name":"","url":"/settings","method":"get","upload":false,"swaggerDoc":"","x":110,"y":140,"wires":[["e8bbabec.1eb078"]]},{"id":"1ce62238.e590ce","type":"comment","z":"ce69645.1231098","name":"Build Webpage","info":"","x":120,"y":100,"wires":[]},{"id":"e4466f0c.3d898","type":"http response","z":"ce69645.1231098","name":"","statusCode":"201","headers":{},"x":1020,"y":120,"wires":[]},{"id":"8d29f36c.245ee","type":"template","z":"ce69645.1231098","name":"HTML Engineer","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n IP: {{global.ip}}
\n Serial: {{global.serial}}
\n Software Version: {{global.sw}}
\n Hardware Version: {{global.hw}}
\n Firmware Version: {{global.fw}}
\n
\n SMS Connected? : {{global.SMS_Connected}}
\n RX1 Connected? : {{global.TRX1_Connected}}
\n TX7470 Connected? : {{global.TX7470_Connected}}\n
\n \n
\n\n
\n

\n Set Aliases\n

\n

\nSet Quick Page\n

\n

\nSystem Settings\n
\n

\n

\nFlash Pattern Effects\n

\n

\nSMS Settings\n

\n \n

\nEngineering\n

\n\n\n
\n\n\n\n","output":"str","x":840,"y":100,"wires":[["e4466f0c.3d898"]]},{"id":"9a894be0.c3ef68","type":"change","z":"ce69645.1231098","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Settings Menu","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["301ebffb.48325"]]},{"id":"301ebffb.48325","type":"template","z":"ce69645.1231098","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/settings/receive');\nvar send = new WebSocket('ws://' + location.host + '/settings/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":530,"y":120,"wires":[["2c156ca7.752364"]]},{"id":"e8bbabec.1eb078","type":"switch","z":"ce69645.1231098","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":140,"wires":[["9a894be0.c3ef68"],["81380517.b42f28"]]},{"id":"81380517.b42f28","type":"link out","z":"ce69645.1231098","name":"back to settings","links":["4212ad6a.fb9f04","7e3a0a42.252994"],"x":375,"y":160,"wires":[]},{"id":"53c094fc.bf043c","type":"link in","z":"ce69645.1231098","name":"","links":["eb0b90cc.4383","cb188988.089818"],"x":155,"y":180,"wires":[["e8bbabec.1eb078"]]},{"id":"af027ca6.8807c","type":"function","z":"38ad3d43.e07282","name":"Make Admin (No Timeout)","func":"msg.cookies = { admin: {\n value: true\n },god: {\n value: true\n }};\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":200,"wires":[["e7a85e8d.a40d2"]]},{"id":"4996d159.b234a","type":"http in","z":"69336e92.97cdb","name":"","url":"/system","method":"get","upload":false,"swaggerDoc":"","x":110,"y":100,"wires":[["7c4201a8.b3066"]]},{"id":"187a93b1.32310c","type":"comment","z":"69336e92.97cdb","name":"Build Webpage","info":"","x":120,"y":60,"wires":[]},{"id":"199c7ecc.549871","type":"http response","z":"69336e92.97cdb","name":"","statusCode":"201","headers":{},"x":760,"y":80,"wires":[]},{"id":"cacfd3ca.9f14e","type":"template","z":"69336e92.97cdb","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n \n
\n
\nLog eMail Address:\n\n
\n
\n\n
\n
\n\n\n
\n
\nSet System Time (date and time):\n \n \n
\n
\n\n
\n\n
\n
\nBeep Style:\n\n\n
\n
\n\n
\n \n
\n
\nChange Password:\n \n
\n
\n
\n\n
\n
\n\n\n\nSet WIFI (Caution Do NOT Adjust Whilst Using WIFI,Reboot to Take Effect)\n
\n
\nSSID:
\nPassword: \n
\n
\n\n\n
\n
\nClear Exported Data (this cannot be undone):\n
\n
\n\n
\n \n
\n
\nReset Entire Database (this cannot be undone):\n
\n
\n\n
\n
\n\n \n \n\n\n\n
\n
\nShutdown CaptureCall. WARNING you must reconnect power to re-start\n
\n
\n
\n\n\n","output":"str","x":630,"y":80,"wires":[["199c7ecc.549871"]]},{"id":"1e8420df.7c031f","type":"change","z":"69336e92.97cdb","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall System Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":80,"wires":[["98ed7ab7.2cd148"]]},{"id":"98ed7ab7.2cd148","type":"template","z":"69336e92.97cdb","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/system/receive');\nvar send = new WebSocket('ws://' + location.host + '/system/send');\n\n\nvar msg = 0; // Make Incoming WS \n\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n function load(){\n startTime();\n\n }\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n\n}","output":"str","x":510,"y":80,"wires":[["cacfd3ca.9f14e"]]},{"id":"362fd6bc.ba6c3a","type":"comment","z":"69336e92.97cdb","name":"Handle Input from Webpage","info":"","x":160,"y":160,"wires":[]},{"id":"7c4201a8.b3066","type":"switch","z":"69336e92.97cdb","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":100,"wires":[["1e8420df.7c031f"],["b88a2c28.954e5"]]},{"id":"b88a2c28.954e5","type":"link out","z":"69336e92.97cdb","name":"back to settings","links":["4212ad6a.fb9f04","7e3a0a42.252994"],"x":355,"y":120,"wires":[]},{"id":"125ae207.80eb3e","type":"debug","z":"69336e92.97cdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":370,"y":240,"wires":[]},{"id":"c7c45d8f.12889","type":"http in","z":"69336e92.97cdb","name":"","url":"/system","method":"post","upload":false,"swaggerDoc":"","x":110,"y":360,"wires":[["125ae207.80eb3e","c9f6a9fb.0edea8","f050cc3.7a73d3","c8a190e9.9de6f","5d7de49b.eeb99c","189c8a46.070806","7de72cac.c0aa54","b469ec62.d0cd9","873751a0.b7a04","94c17315.5561f"]]},{"id":"99040fdf.f6567","type":"http response","z":"69336e92.97cdb","name":"","statusCode":"201","headers":{},"x":500,"y":200,"wires":[]},{"id":"c9f6a9fb.0edea8","type":"change","z":"69336e92.97cdb","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/system","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":200,"wires":[["99040fdf.f6567"]]},{"id":"f050cc3.7a73d3","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.Oldpassword","propertyType":"msg","rules":[{"t":"eq","v":"password","vt":"global"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":280,"wires":[["fb03dcb8.2779c"]]},{"id":"fb03dcb8.2779c","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.Newpassword","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":280,"wires":[["d2cffd80.616a"]]},{"id":"c8a190e9.9de6f","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.resetLog","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":320,"wires":[["ecbc89e0.affb98"]]},{"id":"50f38ebe.b90e6","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"DELETE FROM 'data';","name":"CaptureCall","x":1230,"y":320,"wires":[["8f47f31.57d841"]]},{"id":"8f47f31.57d841","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"DELETE FROM sqlite_sequence WHERE name = 'data';","name":"CaptureCall","x":1390,"y":320,"wires":[[]]},{"id":"d34e5b49.7bf368","type":"exec","z":"69336e92.97cdb","command":"sudo ./node-red-static/bin/set_time.sh","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":750,"y":440,"wires":[[],[],[]]},{"id":"5d7de49b.eeb99c","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.dtime","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":440,"wires":[["78bc6495.20be4c"]]},{"id":"78bc6495.20be4c","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.dtime","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":440,"wires":[["d34e5b49.7bf368"]]},{"id":"dd4326a.4c6d8d8","type":"comment","z":"60528a1b.f32364","name":"Initiate on Boot","info":"Sets Global Variables from JSON DB\n\n* Set IP Address- Gets the system IP address, adds it to global.ip and also sets /ip in the json DB\n* Set system ID - Gets system ID from json DB and sets global.sysID - This is used to filter messages\n* Set Email Address - Gets last email from json DB and sets global.to\n* Add Power on Message to DB - Writes to DB when system Powers on\n* Set Serial Number - Gets Serial from json DB and sets global.serial\n* Set Software Version - Gets S/W Version from json DB and sets global.sw\n* Set Hardware Version - Gets H/W Version from json DB and sets global.hw\n* Set Firmware Version - Gets F/W Version from json DB and sets global.fw\n* Set Password - Gets system Password from json DB and sets global.password\n* Set Left Header Links - Gets json List of modules for main pages from json DB and sets global.left. Used to set contents list on main pages\n* Set Settings Links - Gets json List of settings pages for settings pages from json DB and sets global.setings_list. Used to set contents list on settings pages\n* Set sort by - Sets default sort coloum to \"index\" on boot\n* Set sort direction - Sets default sort direction to \"ASC\" on boot","x":160,"y":100,"wires":[]},{"id":"8c59e2f4.29158","type":"file","z":"69336e92.97cdb","name":"","filename":"/etc/wpa_supplicant/wpa_supplicant.conf","appendNewline":false,"createDir":true,"overwriteFile":"true","x":720,"y":540,"wires":[[]]},{"id":"9b1e3c99.05267","type":"template","z":"23c43518.b3ff0a","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/display/receive');\nvar send = new WebSocket('ws://' + location.host + '/display/send');\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":550,"y":120,"wires":[["9b9c90b8.58988"]]},{"id":"73f17ab3.8171b4","type":"websocket out","z":"e3cbac21.52804","name":"","server":"4f629706.3fbcb8","client":"","x":1150,"y":180,"wires":[]},{"id":"189c8a46.070806","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.beep","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":500,"wires":[["d3b7c6b5.1adc78"]]},{"id":"d3b7c6b5.1adc78","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"beep","pt":"global","to":"payload.beep","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":500,"wires":[["d4b6378c.272a18"]]},{"id":"e8a93519.478388","type":"switch","z":"e3cbac21.52804","name":"","property":"beep","propertyType":"global","rules":[{"t":"neq","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1010,"y":180,"wires":[["73f17ab3.8171b4"]]},{"id":"1fcc7681.3b52f9","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer","method":"get","upload":false,"swaggerDoc":"","x":110,"y":100,"wires":[["ae6afdf1.ec95"]]},{"id":"cb5867c.68a8f98","type":"comment","z":"3c78672c.9cb1f8","name":"Build Webpage","info":"","x":120,"y":60,"wires":[]},{"id":"a2067d6d.88795","type":"http response","z":"3c78672c.9cb1f8","name":"","statusCode":"201","headers":{},"x":860,"y":60,"wires":[]},{"id":"37cbd25.2782f2e","type":"template","z":"3c78672c.9cb1f8","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n Override User Password\n
\nNew Password:
\n
\n
\n\n
\nSystem ID:
\n
\n
\n\nSW,HW,FW Versions\n
\n
\nS/W Version:

\nH/W Version:

\nF/W Version:

\nSerial Number:
\n
\n
\n\nModules \n
\n
\n Dynamic Display
\n First Aid
\n Conference Room
\n Table Display
\n Daily Log
\n Full Log
\n Quick Page
\n Free Page
\n Browser Page
\n Split Screen
\n Big Display
\n Bar Display Split
\n Export
\n \n
\n\nHome Page \n
\n
\n Dynamic Display
\n First Aid
\n Conference Room
\n Table Display
\n Daily Log
\n Full Log
\n Quick Page
\n Free Page
\n Browser Page
\n Split Screen
\n Big
\nLocation Split
\n Export
\n \n
\n\n
\n\n\n\n","output":"str","x":730,"y":60,"wires":[["a2067d6d.88795"]]},{"id":"fa3ed0c3.ed4f2","type":"change","z":"3c78672c.9cb1f8","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"Engineer Settings (You Shouldnt Be here!!)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":60,"wires":[["5399ea08.e994d4"]]},{"id":"5399ea08.e994d4","type":"template","z":"3c78672c.9cb1f8","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/engineer/receive');\nvar send = new WebSocket('ws://' + location.host + '/engineer/send');\n\n\nvar msg = 0; // Make Incoming WS \n\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n function load(){\n startTime();\n\n\n }\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n\n}\n","output":"str","x":610,"y":60,"wires":[["37cbd25.2782f2e"]]},{"id":"7cdf9f1.64cb96","type":"comment","z":"3c78672c.9cb1f8","name":"Handle Input from Webpage","info":"","x":160,"y":180,"wires":[]},{"id":"ae6afdf1.ec95","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":100,"wires":[["955921b8.9204b"],["6a4a330d.caa02c"]]},{"id":"6a4a330d.caa02c","type":"link out","z":"3c78672c.9cb1f8","name":"back to settings","links":["4212ad6a.fb9f04"],"x":475,"y":100,"wires":[]},{"id":"50515aa1.2eb434","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":350,"y":220,"wires":[]},{"id":"4542c4dd.010acc","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer","method":"post","upload":false,"swaggerDoc":"","x":120,"y":380,"wires":[["50515aa1.2eb434","c015747.3acb388","43cb6fdc.1deb8","94144d51.57536","8c38994d.e15088","b63c9f87.5f014","5a8a591e.ae8e38","a7cda32c.2c3ea"]]},{"id":"b2ea038a.746bf","type":"http response","z":"3c78672c.9cb1f8","name":"","statusCode":"201","headers":{},"x":500,"y":500,"wires":[]},{"id":"c015747.3acb388","type":"change","z":"3c78672c.9cb1f8","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/engineer","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":500,"wires":[["b2ea038a.746bf"]]},{"id":"43cb6fdc.1deb8","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.Newpassword","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":300,"wires":[["8d460834.a08b98"]]},{"id":"8d460834.a08b98","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"password","pt":"global","to":"payload.Newpassword","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":300,"wires":[["4fb7501b.1e92b"]]},{"id":"955921b8.9204b","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"req.cookies.god","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":80,"wires":[["fa3ed0c3.ed4f2"],["6a4a330d.caa02c"]]},{"id":"94144d51.57536","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.sw","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":340,"wires":[["2ecb85ed.adc67a"]]},{"id":"8c38994d.e15088","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.hw","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":380,"wires":[["b054030c.77671"]]},{"id":"b63c9f87.5f014","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.fw","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":420,"wires":[["12fa8d82.9467a2"]]},{"id":"5a8a591e.ae8e38","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.serial","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":460,"wires":[["3b656b80.fb4db4"]]},{"id":"94ec7853.b41548","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer/modules","method":"post","upload":false,"swaggerDoc":"","x":150,"y":620,"wires":[["c015747.3acb388","eb8a0340.f959c","149a9733.581029"]]},{"id":"7de72cac.c0aa54","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.SSID","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":540,"wires":[["e1a70dd2.314ae"]]},{"id":"e1a70dd2.314ae","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1ap_scan=1fast_reauth=1country=GBnetwork={\tssid=\"{{SSID}}\"\tpsk=\"{{wifiPassword}}\"}","output":"str","x":480,"y":540,"wires":[["8c59e2f4.29158"]]},{"id":"eb8a0340.f959c","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.modules","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":620,"wires":[["f73fccf0.915ef"]]},{"id":"f73fccf0.915ef","type":"split","z":"3c78672c.9cb1f8","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":530,"y":620,"wires":[["7dd493ab.1e829c"]]},{"id":"7dd493ab.1e829c","type":"split","z":"3c78672c.9cb1f8","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":650,"y":620,"wires":[["b7556597.feb648"]]},{"id":"b7556597.feb648","type":"join","z":"3c78672c.9cb1f8","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":"num","reduceFixup":"","x":770,"y":620,"wires":[["4e8b463d.b7a8e8"]]},{"id":"4e8b463d.b7a8e8","type":"join","z":"3c78672c.9cb1f8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":890,"y":620,"wires":[["a914fc2c.03001","30a21c3d.2546d4"]]},{"id":"a914fc2c.03001","type":"template","z":"3c78672c.9cb1f8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[{{#payload}}{\"Name\": \"{{0}}\",\"Address\": \"{{1}}\"},{{/payload}}{\"Name\": \"Settings\",\"Address\": \"login\"}]","output":"str","x":1020,"y":620,"wires":[["b3351a4d.0d92c8","a1c2cf8c.f9e76","e8d7c8d7.9a90f8"]]},{"id":"6768ce45.ac79b","type":"template","z":"3c78672c.9cb1f8","name":"Left Header","field":"left","fieldType":"global","format":"handlebars","syntax":"mustache","template":"
\n\n

","output":"str","x":1310,"y":620,"wires":[[]]},{"id":"b3351a4d.0d92c8","type":"json","z":"3c78672c.9cb1f8","name":"","property":"payload","action":"","pretty":false,"x":1150,"y":620,"wires":[["6768ce45.ac79b","302cfd77.c37b22"]]},{"id":"302cfd77.c37b22","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1310,"y":580,"wires":[]},{"id":"e27d3777.8cf898","type":"switch","z":"b8bd1cc3.4827","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":280,"y":180,"wires":[["4d7773b3.0108ec"],["7eec4d28.128ec4"]]},{"id":"7eec4d28.128ec4","type":"link out","z":"b8bd1cc3.4827","name":"","links":["f13a1f16.82872"],"x":415,"y":200,"wires":[]},{"id":"6d3d48bb.e324b8","type":"debug","z":"b8bd1cc3.4827","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":220,"wires":[]},{"id":"30a21c3d.2546d4","type":"split","z":"3c78672c.9cb1f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1000,"y":660,"wires":[["17fbd4b7.b3e2db"]]},{"id":"17fbd4b7.b3e2db","type":"split","z":"3c78672c.9cb1f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1130,"y":660,"wires":[["a821f15.e4ab71"]]},{"id":"a821f15.e4ab71","type":"join","z":"3c78672c.9cb1f8","name":"","mode":"custom","build":"string","property":"payload.1","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1250,"y":660,"wires":[["93b50442.d6ff88"]]},{"id":"93b50442.d6ff88","type":"join","z":"3c78672c.9cb1f8","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":1370,"y":660,"wires":[["6d78fc51.e4be64"]]},{"id":"6d78fc51.e4be64","type":"template","z":"3c78672c.9cb1f8","name":"","field":"modules","fieldType":"global","format":"handlebars","syntax":"mustache","template":"/{{{payload}}}","output":"str","x":1500,"y":660,"wires":[[]]},{"id":"1e6521b9.49276e","type":"switch","z":"d0e2bfbf.dfe3f","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":160,"wires":[["b20ec190.c8d73"],["e9c91e07.38088"]]},{"id":"e9c91e07.38088","type":"link out","z":"d0e2bfbf.dfe3f","name":"","links":["f13a1f16.82872"],"x":355,"y":180,"wires":[]},{"id":"815b7467.abb828","type":"switch","z":"23c43518.b3ff0a","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"/display","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":120,"wires":[["5e777687.bf0378"],["c6b24bdc.0d6158"]]},{"id":"c6b24bdc.0d6158","type":"link out","z":"23c43518.b3ff0a","name":"","links":["f13a1f16.82872"],"x":335,"y":160,"wires":[]},{"id":"5dda820c.bf5e2c","type":"switch","z":"b209c94d.26d798","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":180,"wires":[["27fce5ac.018c5a"],["d2ce817e.0c903"]]},{"id":"d2ce817e.0c903","type":"link out","z":"b209c94d.26d798","name":"","links":["f13a1f16.82872"],"x":355,"y":200,"wires":[]},{"id":"ecde1301.2ebb3","type":"switch","z":"1c96dbb1.1bc354","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":260,"wires":[["a74297ce.590ef8"],["70722b52.c7b7d4"]]},{"id":"70722b52.c7b7d4","type":"link out","z":"1c96dbb1.1bc354","name":"","links":["f13a1f16.82872"],"x":355,"y":280,"wires":[]},{"id":"7530d890.2f9e38","type":"switch","z":"53e35596.381c0c","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":240,"wires":[["22601c7c.9bf294"],["ce2ef575.3ca4f8"]]},{"id":"ce2ef575.3ca4f8","type":"link out","z":"53e35596.381c0c","name":"","links":["f13a1f16.82872"],"x":395,"y":260,"wires":[]},{"id":"9a8592b4.48574","type":"http in","z":"da0e8c29.a0583","name":"","url":"/freepage","method":"get","upload":false,"swaggerDoc":"","x":150,"y":280,"wires":[["28ed18d2.41fe48"]]},{"id":"193f6c.ae4d9094","type":"comment","z":"da0e8c29.a0583","name":"Build Webpage","info":"","x":160,"y":60,"wires":[]},{"id":"96c00b4.7fb27f8","type":"http response","z":"da0e8c29.a0583","name":"","statusCode":"201","headers":{},"x":820,"y":260,"wires":[]},{"id":"58f43d6a.217ba4","type":"template","z":"da0e8c29.a0583","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n\n \n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n \n
\nMessage:
\nPager Number:
\n\n
\n
\n\n
\n\n\n\n","output":"str","x":690,"y":260,"wires":[["96c00b4.7fb27f8"]]},{"id":"a549a41f.be52a8","type":"change","z":"da0e8c29.a0583","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Free Page","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":260,"wires":[["2d6935b5.0e1e5a"]]},{"id":"2d6935b5.0e1e5a","type":"template","z":"da0e8c29.a0583","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"\nvar msg = 0; // Make Incoming WS Global\n\n\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":570,"y":260,"wires":[["58f43d6a.217ba4"]]},{"id":"b5c989c8.493098","type":"template","z":"da0e8c29.a0583","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg}}}","output":"str","x":580,"y":440,"wires":[["8df845ff.456a78"]]},{"id":"8df845ff.456a78","type":"serial out","z":"da0e8c29.a0583","name":"","serial":"5d6eb2f4.fc698c","x":790,"y":440,"wires":[]},{"id":"32d66138.55bfde","type":"template","z":"da0e8c29.a0583","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `DATA` ('capcode', 'pagerNumber', 'sysID', 'group', 'content', 'msgPart1', 'msgPart2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0', '{{payload.msg}}', 'n/a', 'n/a', '0','{{timestamp}}', 'Free Page', '{{timestamp}}', 'n/a', 'n/a','T');","output":"str","x":720,"y":480,"wires":[["1a95ace0.4a9ab3"]]},{"id":"1a95ace0.4a9ab3","type":"sqlite","z":"da0e8c29.a0583","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":910,"y":480,"wires":[["5ce459da.1e66f8"]]},{"id":"8b3e4b35.77b2b8","type":"change","z":"da0e8c29.a0583","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":480,"wires":[["32d66138.55bfde"]]},{"id":"5ce459da.1e66f8","type":"link out","z":"da0e8c29.a0583","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1015,"y":480,"wires":[]},{"id":"28ed18d2.41fe48","type":"switch","z":"da0e8c29.a0583","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":280,"wires":[["a549a41f.be52a8"],["1bdee69f.d69879"]]},{"id":"1bdee69f.d69879","type":"link out","z":"da0e8c29.a0583","name":"","links":["f13a1f16.82872"],"x":415,"y":300,"wires":[]},{"id":"4266164c.a16568","type":"http in","z":"da0e8c29.a0583","name":"","url":"/freepage","method":"post","upload":false,"swaggerDoc":"","x":160,"y":460,"wires":[["98e4013d.1c2f1","b3ff9920.1c52c8"]]},{"id":"98e4013d.1c2f1","type":"switch","z":"da0e8c29.a0583","name":"","property":"payload.msg","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":460,"wires":[["8dd98e0a.18474"]]},{"id":"8dd98e0a.18474","type":"switch","z":"da0e8c29.a0583","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":460,"wires":[["b5c989c8.493098","8b3e4b35.77b2b8"]]},{"id":"85475c00.6943d8","type":"http response","z":"da0e8c29.a0583","name":"","statusCode":"","headers":{},"x":490,"y":400,"wires":[]},{"id":"b3ff9920.1c52c8","type":"change","z":"da0e8c29.a0583","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/freepage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":400,"wires":[["85475c00.6943d8"]]},{"id":"8855b97e.ed5368","type":"http in","z":"d0562e73.de681","name":"","url":"/setFP","method":"get","upload":false,"swaggerDoc":"","x":110,"y":80,"wires":[["4f94a092.61ad8"]]},{"id":"715fcf0c.2295f","type":"comment","z":"d0562e73.de681","name":"Build Webpage","info":"","x":120,"y":40,"wires":[]},{"id":"23569d68.5a06c2","type":"http response","z":"d0562e73.de681","name":"","statusCode":"201","headers":{},"x":740,"y":60,"wires":[]},{"id":"9f2607db.34b9e8","type":"template","z":"d0562e73.de681","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":610,"y":60,"wires":[["23569d68.5a06c2"]]},{"id":"2a483322.2e26cc","type":"change","z":"d0562e73.de681","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Flash Pattern Effects","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":60,"wires":[["20a5e394.a75b0c"]]},{"id":"14929ad3.d3b6d5","type":"comment","z":"d0562e73.de681","name":"Put Data On the Webpage","info":"","x":150,"y":140,"wires":[]},{"id":"4ee69f48.01c99","type":"websocket out","z":"d0562e73.de681","name":"","server":"4f808f22.bd9c5","client":"","x":770,"y":180,"wires":[]},{"id":"5ab39dc5.a847d4","type":"template","z":"d0562e73.de681","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n
\n
\nDefault
\nBackground Color: Font Color: Flash
\nVibe 1
\nBackground Color: Font Color: Flash
\nVibe 2
\nBackground Color: Font Color: Flash
\nVibe 3
\nBackground Color: Font Color: Flash
\n \nBeep 1
\nBackground Color: Font Color: Flash
\nBeep 2
\nBackground Color: Font Color: Flash
\nBeep 3
\nBackground Color: Font Color: Flash
\n\nVibe/Beep 1
\nBackground Color: Font Color: Flash
\nVibe/Beep 2
\nBackground Color: Font Color: Flash
\nVibe/Beep 3
\nBackground Color: Font Color: Flash
\n\nLookdown
\nBackground Color: Font Color: Flash
\n\n\n\n
\n\n
","output":"str","x":590,"y":180,"wires":[["4ee69f48.01c99"]]},{"id":"9d79df3.aaa812","type":"websocket in","z":"d0562e73.de681","name":"","server":"a0127eb8.b242b","client":"","x":120,"y":180,"wires":[["f19f0b88.1da698"]]},{"id":"f19f0b88.1da698","type":"switch","z":"d0562e73.de681","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":180,"wires":[["3b021a54.3400d6"]]},{"id":"20a5e394.a75b0c","type":"template","z":"d0562e73.de681","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/setFP/receive');\nvar send = new WebSocket('ws://' + location.host + '/setFP/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":490,"y":60,"wires":[["9f2607db.34b9e8"]]},{"id":"611efccd.97f434","type":"comment","z":"d0562e73.de681","name":"Handle Input from Webpage","info":"","x":160,"y":240,"wires":[]},{"id":"4f94a092.61ad8","type":"switch","z":"d0562e73.de681","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":80,"wires":[["2a483322.2e26cc"],["a3483953.4356f8"]]},{"id":"a3483953.4356f8","type":"link out","z":"d0562e73.de681","name":"back to settings","links":["4212ad6a.fb9f04"],"x":335,"y":100,"wires":[]},{"id":"80ccb8a9.a8b6b8","type":"http in","z":"d0562e73.de681","name":"","url":"/setFP","method":"post","upload":false,"swaggerDoc":"","x":110,"y":340,"wires":[["bcbf0cd6.00d0d","b72a4410.a678b8","91650265.06ee3","8edd4cbd.dc908"]]},{"id":"e753d0a.a94ac3","type":"http response","z":"d0562e73.de681","name":"","statusCode":"201","headers":{},"x":420,"y":300,"wires":[]},{"id":"bcbf0cd6.00d0d","type":"change","z":"d0562e73.de681","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/setFP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":300,"wires":[["e753d0a.a94ac3"]]},{"id":"7e96f9d2.8aca18","type":"file","z":"d0562e73.de681","name":"","filename":"./node-red-static/FP.css","appendNewline":false,"createDir":false,"overwriteFile":"true","x":470,"y":340,"wires":[[]]},{"id":"b72a4410.a678b8","type":"template","z":"d0562e73.de681","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"/* Flash Patterns */\n.default {\n background-color: {{payload.defaultBG}};\n color: {{payload.defaultFont}};\n animation: {{payload.defaultFlash}} linear 1s infinite;\n \n\n}\n\n.V1 {\n background-color: {{payload.V1BG}};\n color: {{payload.V1Font}};\n animation: {{payload.V1Flash}} linear 1s infinite;\n}\n\n.V2 {\n background-color: {{payload.V2BG}};\n color: {{payload.V2Font}};\n animation: {{payload.V2Flash}} linear 1s infinite;\n }\n\n.V3 {\n background-color: {{payload.V3BG}};\n color: {{payload.V3Font}};\n animation: {{payload.V3Flash}} linear 1s infinite;\n}\n\n.B1 {\n background-color: {{payload.B1BG}};\n color: {{payload.B1Font}};\n animation: {{payload.B1Flash}} linear 1s infinite;\n}\n\n.B2 {\n background-color: {{payload.B2BG}};\n color: {{payload.B2Font}};\n animation: {{payload.B2Flash}} linear 1s infinite;\n}\n\n.B3 {\n background-color: {{payload.B3BG}};\n color: {{payload.B3Font}};\n animation: {{payload.B3Flash}} linear 1s infinite;\n}\n\n.VB1 {\n background-color: {{payload.VB1BG}};\n color: {{payload.VB1Font}};\n animation: {{payload.VB1Flash}} linear 1s infinite;\n}\n\n.VB2 { background-color: {{payload.VB2BG}};\ncolor: {{payload.VB2Font}};\n animation: {{payload.VB2Flash}} linear 1s infinite;\n }\n\n.VB3 {\n background-color: {{payload.VB3BG}};\n color: {{payload.VB3Font}};\n animation: {{payload.VB3Flash}} linear 1s infinite;\n}\n\n.B1b3 {\n background-color: {{payload.B1b3BG}};\n color: {{payload.B1b3Font}};\n animation: {{payload.B1b3Flash}} linear 1s infinite;\n}\n\n@keyframes checked {\n0% { opacity: 1; } \n\t50% { opacity: .1; } \n\t100% { opacity: 1; }\n}","output":"str","x":280,"y":340,"wires":[["7e96f9d2.8aca18"]]},{"id":"7e7fe23b.84c74c","type":"split","z":"60528a1b.f32364","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":890,"y":680,"wires":[["afbb1eb0.29539"]]},{"id":"afbb1eb0.29539","type":"split","z":"60528a1b.f32364","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1020,"y":680,"wires":[["ff45b5a4.aa7888"]]},{"id":"ff45b5a4.aa7888","type":"join","z":"60528a1b.f32364","name":"","mode":"custom","build":"string","property":"payload.1","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1140,"y":680,"wires":[["19139a6d.7e50d6"]]},{"id":"19139a6d.7e50d6","type":"join","z":"60528a1b.f32364","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":1260,"y":680,"wires":[["d70e1277.46b2"]]},{"id":"d70e1277.46b2","type":"template","z":"60528a1b.f32364","name":"","field":"modules","fieldType":"global","format":"handlebars","syntax":"mustache","template":"/{{{payload}}}","output":"str","x":1390,"y":680,"wires":[[]]},{"id":"91650265.06ee3","type":"debug","z":"d0562e73.de681","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":420,"wires":[]},{"id":"72e42bd5.2616a4","type":"template","z":"60528a1b.f32364","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET ip = '{{ip}}', sysID = '{{sysID}}', email = '{{email}}', serial = '{{serial}}', beep = '{{beep}}', sw = '{{sw}}', hw = '{{hw}}', fw = '{{fw}}', password = '{{password}}', modules = '{{modules}}', settings = '{{settings}}', sortby = '{{sortby}}', direction = '{{direction}}'\nWHERE ID = 1;","output":"str","x":580,"y":1040,"wires":[["fb23c3fd.6aaee"]]},{"id":"fb23c3fd.6aaee","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":1040,"wires":[["ed7000ef.81664"]]},{"id":"b16ad8ab.ea9388","type":"inject","z":"60528a1b.f32364","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":1040,"wires":[["72e42bd5.2616a4"]]},{"id":"ed7000ef.81664","type":"debug","z":"60528a1b.f32364","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":1040,"wires":[]},{"id":"57680870.a4fee8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":460,"wires":[]},{"id":"40e8a718.7db078","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":420,"wires":[["5c137e7c.eafe6"]]},{"id":"51df7832.56f338","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE \"settings\" ( `ID` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, `ip` TEXT, `sysID` INTEGER, `home` TEXT, `email` TEXT, `serial` TEXT, `beep` TEXT, `sw` TEXT, `hw` TEXT, `fw` TEXT, `password` TEXT, `modules` TEXT, `settings` TEXT, `sms_lookup_time` INTEGER, `default_pager_number` INTEGER )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":420,"wires":[["40e8a718.7db078"]]},{"id":"5c137e7c.eafe6","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":420,"wires":[]},{"id":"9613dd14.40516","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":580,"wires":[["4c6d8b9f.7c4cc4"]]},{"id":"87545ba1.2ba438","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":580,"wires":[["9613dd14.40516"]]},{"id":"abdc0875.b34ba8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":460,"wires":[["57680870.a4fee8"]]},{"id":"475501bd.5f68b","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":460,"wires":[["abdc0875.b34ba8"]]},{"id":"2d395ca8.d5cbf4","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":500,"wires":[]},{"id":"1f6d8d53.6e5823","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":500,"wires":[["2d395ca8.d5cbf4"]]},{"id":"1da18834.e7d818","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":500,"wires":[["1f6d8d53.6e5823"]]},{"id":"4c6d8b9f.7c4cc4","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":580,"wires":[]},{"id":"4b450df0.e83c84","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":540,"wires":[]},{"id":"bad165b9.945888","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":540,"wires":[["4b450df0.e83c84"]]},{"id":"12e4d3cf.a38c7c","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":540,"wires":[["bad165b9.945888"]]},{"id":"a035d2e1.6932a","type":"comment","z":"ba76d305.cf8ad","name":"Settings","info":"","x":500,"y":380,"wires":[]},{"id":"4ac7d74f.7f2f58","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":620,"wires":[["80b030ab.c8c21"]]},{"id":"615f1b49.7d75d4","type":"inject","z":"ba76d305.cf8ad","name":"Build Blank","topic":"INSERT INTO `settings`(`ID`,`ip`,`sysID`,`home`,`email`,`serial`,`beep`,`sw`,`hw`,`fw`,`password`,`modules`,`settings`) VALUES (1,\"NULL\",0,\"Dynamic Display\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"1234\",'[{\"Name\": \"Go to Dynamic Display\",\"Address\": \"display\"},{\"Name\": \"Go to First Aid Display\",\"Address\": \"firstaid\"},{\"Name\": \"Go to Table Display\",\"Address\": \"table\"},{\"Name\": \"Go to Daily Log\",\"Address\": \"log-daily\"},{\"Name\": \"Go to Full Log\",\"Address\": \"log-full\"},{\"Name\": \"Go to Quick Page\",\"Address\": \"quickpage\"},{\"Name\": \"Go to Free Page\",\"Address\": \"freepage\"},{\"Name\": \"Go to Split Screen\",\"Address\": \"split-screen\"},{\"Name\": \"Go to Settings\",\"Address\": \"login\"}]','[ { \"Name\": \"Home\", \"Address\": \"\" }, {\"Name\": \"Settings Menu\",\"Address\": \"settings\"},{\"Name\": \"Log Out\",\"Address\": \"login/clear\"} ]');","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":620,"wires":[["4ac7d74f.7f2f58"]]},{"id":"80b030ab.c8c21","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":620,"wires":[]},{"id":"7ece05b1.f644dc","type":"template","z":"60528a1b.f32364","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET ip = '{{payload[0].address}}'\nWHERE ID = 1;","output":"str","x":560,"y":160,"wires":[["13ca5266.4f02ce"]]},{"id":"13ca5266.4f02ce","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":160,"wires":[[]]},{"id":"a94eeb3d.5f0798","type":"comment","z":"60528a1b.f32364","name":"Reset Default sort to Index","info":"","x":670,"y":240,"wires":[]},{"id":"24af3739.9123f8","type":"comment","z":"60528a1b.f32364","name":"Reset Default sort Direction to Descending","info":"","x":720,"y":280,"wires":[]},{"id":"d57eea24.248848","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `email` FROM `settings`;","name":"CaptureCall","x":430,"y":360,"wires":[["29aa4748.4a38f8"]]},{"id":"6504a56c.dec16c","type":"comment","z":"60528a1b.f32364","name":"Set Global IP Address","info":"","x":900,"y":120,"wires":[]},{"id":"29000af8.4b1dd6","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"sysID","pt":"global","to":"payload[0].sysID","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":320,"wires":[[]]},{"id":"f8c63b29.6d2638","type":"comment","z":"60528a1b.f32364","name":"Set sysID","info":"","x":760,"y":320,"wires":[]},{"id":"75e740cb.10229","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `sysID` FROM `settings`;","name":"CaptureCall","x":430,"y":320,"wires":[["29000af8.4b1dd6"]]},{"id":"6d072298.ce0c6c","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"serial","pt":"global","to":"payload[0].serial","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":400,"wires":[[]]},{"id":"3dcdfe5b.03ee22","type":"comment","z":"60528a1b.f32364","name":"Set Serial","info":"","x":760,"y":400,"wires":[]},{"id":"1ecf1066.91d79","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `serial` FROM `settings`;","name":"CaptureCall","x":430,"y":400,"wires":[["6d072298.ce0c6c"]]},{"id":"b226a04c.535eb","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"beep","pt":"global","to":"payload[0].beep","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":440,"wires":[[]]},{"id":"71a41ac8.736de4","type":"comment","z":"60528a1b.f32364","name":"Set beep","info":"","x":760,"y":440,"wires":[]},{"id":"64152e36.bad9a","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `beep` FROM `settings`;","name":"CaptureCall","x":430,"y":440,"wires":[["b226a04c.535eb"]]},{"id":"956c0a4b.435d18","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"sw","pt":"global","to":"payload[0].sw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":480,"wires":[[]]},{"id":"702ec949.a6b798","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `sw` FROM `settings`;","name":"CaptureCall","x":430,"y":480,"wires":[["956c0a4b.435d18"]]},{"id":"36f03d71.440912","type":"comment","z":"60528a1b.f32364","name":"Set H/W Version","info":"","x":780,"y":520,"wires":[]},{"id":"afb53090.a53f7","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"hw","pt":"global","to":"payload[0].hw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":520,"wires":[[]]},{"id":"b97ab582.64ca48","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `hw` FROM `settings`;","name":"CaptureCall","x":430,"y":520,"wires":[["afb53090.a53f7"]]},{"id":"6aed35a2.f6254c","type":"comment","z":"60528a1b.f32364","name":"Set F/W Version","info":"","x":780,"y":560,"wires":[]},{"id":"d36a9d78.9203","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"fw","pt":"global","to":"payload[0].fw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":560,"wires":[[]]},{"id":"e9329103.798d6","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `fw` FROM `settings`;","name":"CaptureCall","x":430,"y":560,"wires":[["d36a9d78.9203"]]},{"id":"67a9b493.e3fe5c","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"password","pt":"global","to":"payload[0].password","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":600,"wires":[[]]},{"id":"33e54f6c.30f9e","type":"comment","z":"60528a1b.f32364","name":"Set password","info":"","x":810,"y":600,"wires":[]},{"id":"2787e72e.d4af98","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `password` FROM `settings`;","name":"CaptureCall","x":430,"y":600,"wires":[["67a9b493.e3fe5c"]]},{"id":"4fb7501b.1e92b","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET password = '{{{payload.password}}}'\nWHERE ID = 1;","output":"str","x":680,"y":300,"wires":[["616085bf.e2beec"]]},{"id":"616085bf.e2beec","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":300,"wires":[[]]},{"id":"a1c2cf8c.f9e76","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET modules = '{{{payload}}}'\nWHERE ID = 1;","output":"str","x":1300,"y":540,"wires":[["4dd2cde6.07a074","55534cbe.57ef14"]]},{"id":"4dd2cde6.07a074","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1450,"y":540,"wires":[[]]},{"id":"75c7b90a.961778","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET sw = '{{{payload.sw}}}'\nWHERE ID = 1;","output":"str","x":640,"y":340,"wires":[["bd146bf.801c898"]]},{"id":"bd146bf.801c898","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":790,"y":340,"wires":[[]]},{"id":"20e10feb.cf737","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET hw = '{{{payload.hw}}}'\nWHERE ID = 1;","output":"str","x":640,"y":380,"wires":[["e80c7be9.9ace28"]]},{"id":"e80c7be9.9ace28","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":790,"y":380,"wires":[[]]},{"id":"8416e01a.3a8d6","type":"comment","z":"3c78672c.9cb1f8","name":"Password","info":"","x":980,"y":300,"wires":[]},{"id":"8e87cea6.9a0d9","type":"comment","z":"3c78672c.9cb1f8","name":"sw","info":"","x":930,"y":340,"wires":[]},{"id":"6bdc1aab.84a294","type":"comment","z":"3c78672c.9cb1f8","name":"hw","info":"","x":930,"y":380,"wires":[]},{"id":"e422f09f.92a03","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET fw = '{{{payload.fw}}}'\nWHERE ID = 1;","output":"str","x":640,"y":420,"wires":[["9cc31680.08ceb8"]]},{"id":"9cc31680.08ceb8","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":790,"y":420,"wires":[[]]},{"id":"efbe982a.feae18","type":"comment","z":"3c78672c.9cb1f8","name":"fw","info":"","x":930,"y":420,"wires":[]},{"id":"2006e9b0.a7d446","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET serial = '{{{payload.serial}}}'\nWHERE ID = 1;","output":"str","x":660,"y":460,"wires":[["a64a089f.8939a8"]]},{"id":"a64a089f.8939a8","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":460,"wires":[[]]},{"id":"238ca74a.e623a8","type":"comment","z":"3c78672c.9cb1f8","name":"serial","info":"","x":950,"y":460,"wires":[]},{"id":"a7cda32c.2c3ea","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.sysID","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":260,"wires":[["24bf5ab5.e2a7d6"]]},{"id":"24bf5ab5.e2a7d6","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"sysID","pt":"global","to":"payload.sysID","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":260,"wires":[["37d3eeb3.bec942"]]},{"id":"37d3eeb3.bec942","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET sysID = '{{payload.sysID}}'\nWHERE ID = 1;","output":"str","x":660,"y":260,"wires":[["2848e3d3.d0019c"]]},{"id":"2848e3d3.d0019c","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":260,"wires":[[]]},{"id":"c194319b.6aaa5","type":"comment","z":"3c78672c.9cb1f8","name":"sysID","info":"","x":950,"y":260,"wires":[]},{"id":"2ecb85ed.adc67a","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"sw","pt":"global","to":"payload.sw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":340,"wires":[["75c7b90a.961778"]]},{"id":"b054030c.77671","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"hw","pt":"global","to":"payload.hw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":380,"wires":[["20e10feb.cf737"]]},{"id":"12fa8d82.9467a2","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"fw","pt":"global","to":"payload.fw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":420,"wires":[["e422f09f.92a03"]]},{"id":"3b656b80.fb4db4","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"serial","pt":"global","to":"payload.serial","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":460,"wires":[["2006e9b0.a7d446"]]},{"id":"d2cffd80.616a","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"password","pt":"global","to":"payload.Newpassword","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":280,"wires":[["10577483.1658ab"]]},{"id":"10577483.1658ab","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET password = '{{payload.Newpassword}}'\nWHERE ID = 1;","output":"str","x":810,"y":280,"wires":[["f7b2c8cf.8744f8"]]},{"id":"f7b2c8cf.8744f8","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":960,"y":280,"wires":[[]]},{"id":"b50de3ac.d427d","type":"comment","z":"69336e92.97cdb","name":"Password","info":"","x":1110,"y":280,"wires":[]},{"id":"d4b6378c.272a18","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET beep = '{{payload.beep}}'\nWHERE ID = 1;","output":"str","x":660,"y":500,"wires":[["a472fd8f.cc606"]]},{"id":"a472fd8f.cc606","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":500,"wires":[[]]},{"id":"cd7b9816.b1a838","type":"comment","z":"69336e92.97cdb","name":"Beep","info":"","x":950,"y":500,"wires":[]},{"id":"8edd4cbd.dc908","type":"template","z":"d0562e73.de681","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `colors`\nSET \n`defaultBG` = '{{payload.defaultBG}}',\n`defaultFont` = '{{payload.defaultFont}}',\n`defaultFlash` = '{{payload.defaultFlash}}',\n`V1BG` = '{{payload.V1BG}}',\n`V1Font` = '{{payload.V1Font}}',\n`V1Flash` = '{{payload.V1Flash}}',\n`V2BG` = '{{payload.V2BG}}',\n`V2Font` = '{{payload.V2Font}}',\n`V2Flash` = '{{payload.V2Flash}}',\n`V3BG` = '{{payload.V3BG}}',\n`V3Font` = '{{payload.V3Font}}',\n`V3Flash` = '{{payload.V3Flash}}',\n`B1BG` = '{{payload.B1BG}}',\n`B1Font` = '{{payload.B1Font}}',\n`B1Flash` = '{{payload.B1Flash}}',\n`B2BG` = '{{payload.B2BG}}',\n`B2Font` = '{{payload.B2Font}}',\n`B2Flash` = '{{payload.B2Flash}}',\n`B3BG` = '{{payload.B3BG}}',\n`B3Font` = '{{payload.B3Font}}',\n`B3Flash` = '{{payload.B3Flash}}',\n`VB1BG` = '{{payload.VB1BG}}',\n`VB1Font` = '{{payload.VB1Font}}',\n`VB1Flash` = '{{payload.VB1Flash}}',\n`VB2BG` = '{{payload.defaultBG}}',\n`VB2Font` = '{{payload.VB2Font}}',\n`VB2Flash` = '{{payload.VB2Flash}}',\n`VB3BG` = '{{payload.VB3BG}}',\n`VB3Font` = '{{payload.VB3Font}}',\n`VB3Flash` = '{{payload.VB3Flash}}',\n`B1b3BG` = '{{payload.B1b3BG}}',\n`B1b3Font` = '{{payload.B1b3Font}}',\n`B1b3Flash` = '{{payload.B1b3Flash}}'\nWHERE ID = 1;","output":"str","x":280,"y":380,"wires":[["f7d5473c.3e6488"]]},{"id":"f7d5473c.3e6488","type":"sqlite","z":"d0562e73.de681","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":430,"y":380,"wires":[[]]},{"id":"5e336be9.76b194","type":"comment","z":"d0562e73.de681","name":"FP Colors","info":"","x":580,"y":380,"wires":[]},{"id":"3b021a54.3400d6","type":"sqlite","z":"d0562e73.de681","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `colors`;","name":"CaptureCall","x":410,"y":180,"wires":[["d31a057.54931f8","5ab39dc5.a847d4"]]},{"id":"d31a057.54931f8","type":"debug","z":"d0562e73.de681","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[0]","x":610,"y":260,"wires":[]},{"id":"b359f9e7.8eb888","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":460,"wires":[]},{"id":"85a50328.58f91","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":420,"wires":[["c97062da.9cd87"]]},{"id":"e6dff7e2.499de8","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `colors` ( \t`ID`\tINTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, \t`defaultBG`\tINTEGER, \t`defaultFont`\tINTEGER, \t`defaultFlash`\tTEXT, \t`V1BG`\tINTEGER, \t`V1Font`\tINTEGER, \t`V1Flash`\tTEXT, `V2BG`\tINTEGER, \t`V2Font`\tINTEGER, \t`V2Flash`\tTEXT, `V3BG`\tINTEGER, \t`V3Font`\tINTEGER, \t`V3Flash`\tTEXT, `B1BG`\tINTEGER, \t`B1Font`\tINTEGER, \t`B1Flash`\tTEXT, `B2BG`\tINTEGER, \t`B2Font`\tINTEGER, \t`B2Flash`\tTEXT, `B3BG`\tINTEGER, \t`B3Font`\tINTEGER, \t`B3Flash`\tTEXT, `VB1BG`\tINTEGER, \t`VB1Font`\tINTEGER, \t`VB1Flash`\tTEXT, `VB2BG`\tINTEGER, \t`VB2Font`\tINTEGER, \t`VB2Flash`\tTEXT, `VB3BG`\tINTEGER, \t`VB3Font`\tINTEGER, \t`VB3Flash`\tTEXT, `B1b3BG`\tINTEGER, \t`B1b3Font`\tINTEGER, \t`B1b3Flash`\tTEXT );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":420,"wires":[["85a50328.58f91"]]},{"id":"c97062da.9cd87","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1410,"y":420,"wires":[]},{"id":"12729fac.b0518","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":580,"wires":[["228a7978.3f8ee6"]]},{"id":"26e09611.ca020a","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":580,"wires":[["12729fac.b0518"]]},{"id":"808fb896.6bc138","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":460,"wires":[["b359f9e7.8eb888"]]},{"id":"27f3b071.e469e","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":460,"wires":[["808fb896.6bc138"]]},{"id":"c778da44.5ea878","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":500,"wires":[]},{"id":"539dc36d.fa222c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":500,"wires":[["c778da44.5ea878"]]},{"id":"f3584fe.28529b","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":500,"wires":[["539dc36d.fa222c"]]},{"id":"228a7978.3f8ee6","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":580,"wires":[]},{"id":"54044754.6691d8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":540,"wires":[]},{"id":"d36d4b0d.d951c8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":540,"wires":[["54044754.6691d8"]]},{"id":"27b9a10f.09813e","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1000,"y":540,"wires":[["d36d4b0d.d951c8"]]},{"id":"486767ea.69d218","type":"comment","z":"ba76d305.cf8ad","name":"Colors","info":"","x":1250,"y":380,"wires":[]},{"id":"33e449ab.039e96","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":620,"wires":[["ee2c5cca.e43b2"]]},{"id":"ce78853a.c47cf8","type":"inject","z":"ba76d305.cf8ad","name":"Build Blank","topic":"INSERT INTO `colors`(`ID`,`defaultBG`, `defaultFont`, `defaultFlash` ,`V1BG`, `V1Font`, `V1Flash` ,`V2BG`, `V2Font`, `V2Flash` ,`V3BG`, `V3Font`, `V3Flash` ,`B1BG`, `B1Font`, `B1Flash` ,`B2BG`, `B2Font`, `B2Flash` ,`B3BG`, `B3Font`, `B3Flash` ,`VB1BG`, `VB1Font`, `VB1Flash` ,`VB2BG`, `VB2Font`, `VB2Flash` ,`VB3BG`, `VB3Font`, `VB3Flash` ,`B1b3BG`, `B1b3Font`, `B1b3Flash`) VALUES (1,\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\");","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":620,"wires":[["33e449ab.039e96"]]},{"id":"ee2c5cca.e43b2","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":620,"wires":[]},{"id":"53ef0d3c.2f1ab4","type":"comment","z":"9939c833.99b318","name":"Put Unprocessed On the Webpage","info":"","x":180,"y":220,"wires":[]},{"id":"43e3479.f2432b8","type":"http in","z":"9939c833.99b318","name":"","url":"/split-screen","method":"get","upload":false,"swaggerDoc":"","x":120,"y":160,"wires":[["2c5430ff.3123f"]]},{"id":"64ebaca6.468d04","type":"template","z":"9939c833.99b318","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN pagerAlias ON data.pagerNumber = pagerAlias.pagerNumber\nWHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `T/R` = 1\nORDER BY `rxTime` DESC;","output":"str","x":370,"y":260,"wires":[["1ca1dc8e.ddbd13"]]},{"id":"f862321.2f6e7d","type":"websocket out","z":"9939c833.99b318","name":"","server":"a08ab62d.cf01f8","client":"","x":1460,"y":260,"wires":[]},{"id":"eea0957b.ea1d38","type":"comment","z":"9939c833.99b318","name":"Build Webpage","info":"","x":120,"y":20,"wires":[]},{"id":"1ca1dc8e.ddbd13","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":550,"y":260,"wires":[["bcbbf453.9c3be8"]]},{"id":"75811f80.19931","type":"template","z":"9939c833.99b318","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n \n  Quick Message:\n  Recipient:\n  Append Time:\n
\n
\n
","output":"str","x":1070,"y":220,"wires":[["12ad5379.1db21d"]]},{"id":"29af0c05.167c54","type":"http response","z":"9939c833.99b318","name":"","statusCode":"201","headers":{},"x":820,"y":160,"wires":[]},{"id":"ea314091.3deb1","type":"template","z":"9939c833.99b318","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n \n\n\n \n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n\n\n\n\n\n","output":"str","x":690,"y":160,"wires":[["29af0c05.167c54"]]},{"id":"4b6b4ad.def5eb4","type":"change","z":"9939c833.99b318","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Split Screen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":160,"wires":[["34ba9fd9.0d6b2"]]},{"id":"44b5460f.fe4328","type":"function","z":"9939c833.99b318","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":260,"wires":[["4c539035.d5ee7"]]},{"id":"34ba9fd9.0d6b2","type":"template","z":"9939c833.99b318","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/split-screen/receive');\nvar one = new WebSocket('ws://' + location.host + '/split-screen/receive/one');\nvar two = new WebSocket('ws://' + location.host + '/split-screen/receive/two');\nvar send = new WebSocket('ws://' + location.host + '/split-screen/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n// Change Two\ntwo.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"two\").innerHTML = msg.payload;\n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":570,"y":160,"wires":[["ea314091.3deb1"]]},{"id":"2c5430ff.3123f","type":"switch","z":"9939c833.99b318","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"/split-screen","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["4b6b4ad.def5eb4"],["a72b8463.b905e8"]]},{"id":"a72b8463.b905e8","type":"link out","z":"9939c833.99b318","name":"","links":["f13a1f16.82872"],"x":415,"y":200,"wires":[]},{"id":"d14f8279.4648c","type":"websocket out","z":"9939c833.99b318","name":"","server":"2dd9c4a8.1fbccc","client":"","x":1280,"y":300,"wires":[]},{"id":"6b55aec3.28832","type":"template","z":"9939c833.99b318","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Callpoint
\n
Message
\n
Receive Time
\n
\n{{#payload}}\n
\n
{{{alias}}}{{^alias}}{{sender}}{{/alias}}
\n
{{{part1}}}-{{{part2}}}
\n
{{displayTime}}
\n
\n{{/payload}}","output":"str","x":1070,"y":300,"wires":[["d14f8279.4648c"]]},{"id":"5ea3efa2.1fb7a","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `modules` FROM `settings`;","name":"CaptureCall","x":430,"y":640,"wires":[["a8a636bc.460278"]]},{"id":"149a9733.581029","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":360,"y":680,"wires":[]},{"id":"55534cbe.57ef14","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":1440,"y":500,"wires":[]},{"id":"e8d7c8d7.9a90f8","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1230,"y":460,"wires":[]},{"id":"a8a636bc.460278","type":"json","z":"60528a1b.f32364","name":"","property":"payload.0.modules","action":"","pretty":true,"x":570,"y":640,"wires":[["45a5ba11.d51434"]]},{"id":"45a5ba11.d51434","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].modules","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":640,"wires":[["7e7fe23b.84c74c","8ef3cc6f.9a91a"]]},{"id":"e9663b25.2ecdf8","type":"comment","z":"b209c94d.26d798","name":"Put All On the Webpage","info":"","x":140,"y":240,"wires":[]},{"id":"572a891c.622e28","type":"template","z":"b209c94d.26d798","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM data WHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `sender` != \"System\"\nORDER BY `{{global.sort-by}}` {{global.direction}}","output":"str","x":330,"y":340,"wires":[["29fa674e.c38bc8"]]},{"id":"dc7b6d43.82fea","type":"websocket out","z":"b209c94d.26d798","name":"","server":"c0402614.f01608","client":"","x":1300,"y":340,"wires":[]},{"id":"29fa674e.c38bc8","type":"sqlite","z":"b209c94d.26d798","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":510,"y":340,"wires":[["23fab3c1.0aebac"]]},{"id":"e3e5acdd.18f9","type":"function","z":"b209c94d.26d798","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":340,"wires":[["9658fb59.3ebfe8"]]},{"id":"4a4f10a5.b3051","type":"link in","z":"b209c94d.26d798","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","906b7dc8.7a615","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","ce5be23d.4618f","64848176.9353c","e5f646d.fb382b8","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":175,"y":360,"wires":[["572a891c.622e28"]]},{"id":"23fab3c1.0aebac","type":"function","z":"b209c94d.26d798","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":340,"wires":[["e3e5acdd.18f9"]]},{"id":"9658fb59.3ebfe8","type":"template","z":"b209c94d.26d798","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Index
\n
Callpoint
\n
Message
\n
Receive Time
\n
Receive Date
\n
Cleared?
\n
Status
\n
Status Time
\n
Status Date
\n
Recipient
\n
System ID
\n
\n{{#payload}}\n
\n
{{index}}
\n
{{sender}}
\n
{{{part1}}}-{{{part2}}}
\n
{{displayTime}}
\n
{{displayDate}}
\n
{{cleared}}
\n
{{status}}
\n
{{displayStatusTime}}
\n
{{displayStatusDate}}
\n
{{pagerNumber}}
\n
{{sysID}}
\n
\n{{/payload}}","output":"str","x":1070,"y":340,"wires":[["dc7b6d43.82fea"]]},{"id":"8aed6be1.ef9ee8","type":"switch","z":"b209c94d.26d798","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":280,"wires":[["1fbb2868.8151c8"],["572a891c.622e28"]]},{"id":"1fbb2868.8151c8","type":"change","z":"b209c94d.26d798","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":260,"wires":[["b2f96c3b.4bd61"]]},{"id":"b2f96c3b.4bd61","type":"switch","z":"b209c94d.26d798","name":"","property":"direction","propertyType":"global","rules":[{"t":"eq","v":"ASC","vt":"str"},{"t":"eq","v":"DESC","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":280,"wires":[["4f227785.08f048"],["c10df447.d42fe8"]]},{"id":"4f227785.08f048","type":"change","z":"b209c94d.26d798","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":260,"wires":[["906b7dc8.7a615"]]},{"id":"c10df447.d42fe8","type":"change","z":"b209c94d.26d798","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"ASC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":300,"wires":[["906b7dc8.7a615"]]},{"id":"906b7dc8.7a615","type":"link out","z":"b209c94d.26d798","name":"","links":["4a4f10a5.b3051"],"x":915,"y":280,"wires":[]},{"id":"8e929840.f614b8","type":"websocket in","z":"b209c94d.26d798","name":"","server":"c7526c07.3fd51","client":"","x":110,"y":280,"wires":[["8aed6be1.ef9ee8"]]},{"id":"4cfa91f3.ed729","type":"template","z":"9939c833.99b318","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM data\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `T/R` = 0\nORDER BY `rxTime` DESC ;\n","output":"str","x":370,"y":300,"wires":[["462cb1cd.d5668"]]},{"id":"462cb1cd.d5668","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":550,"y":300,"wires":[["9dcbe880.cbfd68"]]},{"id":"d6b3daac.f529a8","type":"function","z":"9939c833.99b318","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":880,"y":300,"wires":[["6b55aec3.28832"]]},{"id":"310fbd39.4aefd2","type":"link in","z":"9939c833.99b318","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","baaeb70f.7624e8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":215,"y":260,"wires":[["4cfa91f3.ed729","64ebaca6.468d04"]]},{"id":"9dcbe880.cbfd68","type":"function","z":"9939c833.99b318","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":300,"wires":[["d6b3daac.f529a8"]]},{"id":"84a5871.9fe7f78","type":"websocket in","z":"9939c833.99b318","name":"","server":"1bd09651.1c7e5a","client":"","x":140,"y":300,"wires":[["4cfa91f3.ed729","64ebaca6.468d04","a69165f3.061688"]]},{"id":"ef7571cc.7263e","type":"template","z":"9939c833.99b318","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg.0}}}{{{payload.msg.1}}}","output":"str","x":1000,"y":540,"wires":[["ce99cc49.66e21"]]},{"id":"ce99cc49.66e21","type":"serial out","z":"9939c833.99b318","name":"","serial":"5d6eb2f4.fc698c","x":1210,"y":520,"wires":[]},{"id":"6274cf00.0a1c2","type":"template","z":"9939c833.99b318","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0', '{{{payload.msg.0}}}','{{{payload.msg.1}}} - {{time}}', 'Split Screen', '{{timestamp}}', 'From Split Screen', '{{timestamp}}', 'n/a', 'n/a',1);","output":"str","x":1140,"y":460,"wires":[["a8dab2.0050755"]]},{"id":"a8dab2.0050755","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1310,"y":460,"wires":[["50e59502.8aad2c"]]},{"id":"c6d4d9ae.312498","type":"change","z":"9939c833.99b318","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":460,"wires":[["6274cf00.0a1c2","acdf8298.10574"]]},{"id":"50e59502.8aad2c","type":"link out","z":"9939c833.99b318","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885"],"x":1415,"y":460,"wires":[]},{"id":"11250122.c6d38f","type":"http in","z":"9939c833.99b318","name":"","url":"/split-screen","method":"post","upload":false,"swaggerDoc":"","x":130,"y":500,"wires":[["a6576438.126eb8","d7ea00f6.43c3f","7793973e.ce5438"]]},{"id":"a6576438.126eb8","type":"switch","z":"9939c833.99b318","name":"","property":"payload.msg","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":520,"wires":[["d9c7bd92.31891"]]},{"id":"d9c7bd92.31891","type":"switch","z":"9939c833.99b318","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":520,"wires":[["a195fdab.e7d59"]]},{"id":"371f81d8.dcb76e","type":"http response","z":"9939c833.99b318","name":"","statusCode":"","headers":{},"x":450,"y":480,"wires":[]},{"id":"d7ea00f6.43c3f","type":"change","z":"9939c833.99b318","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/split-screen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":480,"wires":[["371f81d8.dcb76e"]]},{"id":"a195fdab.e7d59","type":"switch","z":"9939c833.99b318","name":"Add Time?","property":"payload.time","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":520,"wires":[["f397bfa5.91fa5"],["ef7571cc.7263e","2c2ddbc9.0d1744"]]},{"id":"f3ba90d6.e35a8","type":"template","z":"9939c833.99b318","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg.0}}}{{{payload.msg.1}}} - {{time}}","output":"str","x":1000,"y":500,"wires":[["ce99cc49.66e21"]]},{"id":"28ef9eb6.42bf32","type":"http in","z":"aefd70ef.7eada","name":"","url":"/alias","method":"get","upload":false,"swaggerDoc":"","x":140,"y":100,"wires":[["45d27d60.5ea254"]]},{"id":"9711d2d6.97894","type":"comment","z":"aefd70ef.7eada","name":"Build Webpage","info":"","x":160,"y":60,"wires":[]},{"id":"9ab051c9.9e6c2","type":"http response","z":"aefd70ef.7eada","name":"","statusCode":"201","headers":{},"x":780,"y":80,"wires":[]},{"id":"fd17d86b.67bd68","type":"template","z":"aefd70ef.7eada","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n
\n\n\n\n","output":"str","x":650,"y":80,"wires":[["9ab051c9.9e6c2"]]},{"id":"985b6867.2a1678","type":"change","z":"aefd70ef.7eada","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Alias Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":80,"wires":[["93423381.4c2d"]]},{"id":"a86c760c.7b36a8","type":"comment","z":"aefd70ef.7eada","name":"Put Data On the Webpage","info":"","x":190,"y":160,"wires":[]},{"id":"94b47d04.ae69c","type":"websocket out","z":"aefd70ef.7eada","name":"","server":"a446718.a7f529","client":"","x":1100,"y":240,"wires":[]},{"id":"71c32cea.d4ec34","type":"template","z":"aefd70ef.7eada","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Set Callpoint Alias

\n \n
\n\n\nBackground Color:\nFont Color:\n\n
\n\n
\n\n

\n\n\n

\n\n
\n\n
\n
Alias
\n
Number
\n
Background Color
\n
Font Color
\n
\n{{#payload}}\n
\n
{{{alias}}}
\n
{{callpoint}}
\n
\n
\n
\n{{/payload}}\n
","output":"str","x":890,"y":200,"wires":[["b6d177b6.5ed828"]]},{"id":"b512bc0d.d43f","type":"websocket in","z":"aefd70ef.7eada","name":"","server":"cc73b91d.aaa738","client":"","x":160,"y":200,"wires":[["4f3bb7d.e64b048"]]},{"id":"4f3bb7d.e64b048","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":200,"wires":[["f348a3c8.85d4f","1be0c166.45d06f"]]},{"id":"93423381.4c2d","type":"template","z":"aefd70ef.7eada","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var one = new WebSocket('ws://' + location.host + '/alias/receive/one');\nvar two = new WebSocket('ws://' + location.host + '/alias/receive/two');\nvar send = new WebSocket('ws://' + location.host + '/alias/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n// Change Two\ntwo.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"two\").innerHTML = msg.payload;\n};\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":530,"y":80,"wires":[["fd17d86b.67bd68"]]},{"id":"1157baf1.be4815","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":420,"wires":[["dae3733e.a0988","e986d976.0314d8"]]},{"id":"bc148d76.a62","type":"websocket in","z":"aefd70ef.7eada","name":"","server":"cc73b91d.aaa738","client":"","x":160,"y":420,"wires":[["1157baf1.be4815"]]},{"id":"36d8bcee.9da994","type":"comment","z":"aefd70ef.7eada","name":"Handle Input from Webpage","info":"","x":200,"y":360,"wires":[]},{"id":"45d27d60.5ea254","type":"switch","z":"aefd70ef.7eada","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":100,"wires":[["985b6867.2a1678"],["d6762c10.0cdbe"]]},{"id":"d6762c10.0cdbe","type":"link out","z":"aefd70ef.7eada","name":"back to settings","links":["4212ad6a.fb9f04","7e3a0a42.252994"],"x":355,"y":120,"wires":[]},{"id":"f348a3c8.85d4f","type":"template","z":"aefd70ef.7eada","name":"Select Callpoint Alias Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `callpoint_Alias`\nORDER BY `alias` ASC;\n","output":"str","x":520,"y":200,"wires":[["ad32f728.22c268"]]},{"id":"ad32f728.22c268","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":200,"wires":[["71c32cea.d4ec34"]]},{"id":"dae3733e.a0988","type":"template","z":"aefd70ef.7eada","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `callpoint_Alias`\nWHERE `alias`=\"{{{payload}}}\";","output":"str","x":470,"y":400,"wires":[["74d9e28c.999adc"]]},{"id":"74d9e28c.999adc","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":420,"wires":[["2aef09c2.a99756","f348a3c8.85d4f","1be0c166.45d06f"]]},{"id":"a8a41f6c.c859c","type":"http response","z":"aefd70ef.7eada","name":"","statusCode":"201","headers":{},"x":960,"y":420,"wires":[]},{"id":"2aef09c2.a99756","type":"change","z":"aefd70ef.7eada","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/alias","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":420,"wires":[["a8a41f6c.c859c"]]},{"id":"3fc6dfd3.b70a3","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":760,"wires":[]},{"id":"832fc0b1.28f94","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":720,"wires":[["976ebe96.056fb"]]},{"id":"d57c20e3.ee9b5","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `callpoint_alias` ( \t`alias`\tTEXT NOT NULL UNIQUE, \t`callpoint`\tINTEGER, \t`bgColor`\tTEXT, \t`ftColor`\tTEXT, \tPRIMARY KEY(`alias`) );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":720,"wires":[["832fc0b1.28f94"]]},{"id":"976ebe96.056fb","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":720,"wires":[]},{"id":"d5b1ce4.fc2243","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":760,"wires":[["3fc6dfd3.b70a3"]]},{"id":"6e9ee648.335c78","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'callpoint_Alias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":760,"wires":[["d5b1ce4.fc2243"]]},{"id":"248f1d7c.5d1392","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":800,"wires":[]},{"id":"77797078.887ca","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":800,"wires":[["248f1d7c.5d1392"]]},{"id":"5bf69e06.abe9c","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'callpoint_Alias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":800,"wires":[["77797078.887ca"]]},{"id":"6db20a0e.856054","type":"comment","z":"ba76d305.cf8ad","name":"Callpoint Alias","info":"","x":510,"y":680,"wires":[]},{"id":"11f87268.98cf0e","type":"catch","z":"aefd70ef.7eada","name":"","scope":["2682099a.780f86"],"x":890,"y":600,"wires":[["2aef09c2.a99756"]]},{"id":"7600a838.ea1d88","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":760,"wires":[]},{"id":"dfbe9a4a.a1b5b8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":720,"wires":[["e7a282a3.524fe"]]},{"id":"7a138fdf.f91a1","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `pagerAlias` ( \t`alias`\tTEXT NOT NULL UNIQUE,\t`pagerNumber`\tINTEGER, \tPRIMARY KEY(`pagerNumber`) );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":720,"wires":[["dfbe9a4a.a1b5b8"]]},{"id":"e7a282a3.524fe","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":720,"wires":[]},{"id":"aa037a7f.c6f688","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":760,"wires":[["7600a838.ea1d88"]]},{"id":"aecab930.dc9588","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'pagerAlias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":760,"wires":[["aa037a7f.c6f688"]]},{"id":"5908d21c.0f52cc","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":800,"wires":[]},{"id":"fd18b4b1.d2b8b8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":800,"wires":[["5908d21c.0f52cc"]]},{"id":"e3504781.f45ab8","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'pagerAlias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":800,"wires":[["fd18b4b1.d2b8b8"]]},{"id":"7fe45b38.db3764","type":"comment","z":"ba76d305.cf8ad","name":"Pager Alias","info":"","x":1250,"y":680,"wires":[]},{"id":"652c145.e95fbec","type":"template","z":"aefd70ef.7eada","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Set Pager Alias

\n\n
\n\n\n \n
\n\n
\n

\n\n\n

\n\n
\n \n
\n
Alias
\n
Number
\n
\n{{#payload}}\n
\n
{{{alias}}}
\n
{{pagerNumber}}
\n
\n{{/payload}}","output":"str","x":890,"y":240,"wires":[["94b47d04.ae69c"]]},{"id":"b6d177b6.5ed828","type":"websocket out","z":"aefd70ef.7eada","name":"","server":"f2da83eb.80921","client":"","x":1100,"y":200,"wires":[]},{"id":"1be0c166.45d06f","type":"template","z":"aefd70ef.7eada","name":"Select Pager Alias Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `pagerAlias`\nORDER BY `alias` ASC;","output":"str","x":530,"y":240,"wires":[["3cc69ef9.e1d652"]]},{"id":"3cc69ef9.e1d652","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":240,"wires":[["652c145.e95fbec"]]},{"id":"d1ca6275.be209","type":"template","z":"aefd70ef.7eada","name":"Add Alias to DB (Callpoint)","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `callpoint_Alias` ('alias', 'callpoint', 'bgColor', 'ftColor') VALUES ('{{{payload.alias}}}', '{{payload.callpoint}}', '{{payload.bgColor}}', '{{payload.ftColor}}');","output":"str","x":680,"y":640,"wires":[["2682099a.780f86","535c1893.ec9098"]]},{"id":"2682099a.780f86","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":910,"y":640,"wires":[["2aef09c2.a99756"]]},{"id":"c66c8b92.74ac88","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.alias","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":640,"wires":[["9eb090eb.f8e7b"]]},{"id":"155d7c3a.46dc04","type":"http in","z":"aefd70ef.7eada","name":"","url":"/alias/callpoint","method":"post","upload":false,"swaggerDoc":"","x":170,"y":640,"wires":[["c66c8b92.74ac88"]]},{"id":"535c1893.ec9098","type":"debug","z":"aefd70ef.7eada","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":900,"y":700,"wires":[]},{"id":"9eb090eb.f8e7b","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.callpoint","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":640,"wires":[["d1ca6275.be209"],["2aef09c2.a99756"]]},{"id":"aebb3baa.6eb7a8","type":"template","z":"aefd70ef.7eada","name":"Add Alias to DB (Pager Number)","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `pagerAlias` ('alias', 'pagerNumber') VALUES ('{{payload.alias}}', '{{payload.pager}}');","output":"str","x":670,"y":700,"wires":[["2682099a.780f86","535c1893.ec9098"]]},{"id":"f73e9b49.4b30c8","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.alias","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":700,"wires":[["551d4a9f.207a94"]]},{"id":"3936b9d7.0c8a46","type":"http in","z":"aefd70ef.7eada","name":"","url":"/alias/pager","method":"post","upload":false,"swaggerDoc":"","x":170,"y":700,"wires":[["f73e9b49.4b30c8"]]},{"id":"551d4a9f.207a94","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":700,"wires":[["aebb3baa.6eb7a8"],["2aef09c2.a99756"]]},{"id":"e986d976.0314d8","type":"template","z":"aefd70ef.7eada","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `pagerAlias`\nWHERE `alias`=\"{{{payload}}}\";","output":"str","x":470,"y":440,"wires":[["74d9e28c.999adc"]]},{"id":"9e910a95.ff8228","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `pagerAlias`;","name":"CaptureCall","x":910,"y":220,"wires":[["75811f80.19931"]]},{"id":"f397bfa5.91fa5","type":"moment","z":"9939c833.99b318","name":"","topic":"","input":"","inputType":"date","inTz":"Etc/UTC","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss","locale":"en_US","output":"time","outputType":"msg","outTz":"Etc/ETC/GMT","x":820,"y":500,"wires":[["f3ba90d6.e35a8","c6d4d9ae.312498"]]},{"id":"e9175bc6.696678","type":"http in","z":"53762a60.6160b4","name":"","url":"/setQP","method":"get","upload":false,"swaggerDoc":"","x":110,"y":80,"wires":[["c6e6ed59.8e76a"]]},{"id":"ec979ea5.33cb9","type":"comment","z":"53762a60.6160b4","name":"Build Webpage","info":"","x":120,"y":40,"wires":[]},{"id":"e3bb57cc.a2b9a8","type":"http response","z":"53762a60.6160b4","name":"","statusCode":"201","headers":{},"x":740,"y":60,"wires":[]},{"id":"ae41ee14.e3ce3","type":"template","z":"53762a60.6160b4","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":610,"y":60,"wires":[["e3bb57cc.a2b9a8"]]},{"id":"ac0517b6.d9e3f8","type":"change","z":"53762a60.6160b4","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Quick Page Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":60,"wires":[["e03e5ad0.d30828"]]},{"id":"7d82eb2d.b0c5f4","type":"comment","z":"53762a60.6160b4","name":"Put Data On the Webpage","info":"","x":150,"y":140,"wires":[]},{"id":"a840eab1.b75478","type":"websocket out","z":"53762a60.6160b4","name":"","server":"7d649c17.1d11a4","client":"","x":990,"y":180,"wires":[]},{"id":"ffb39ddf.99166","type":"template","z":"53762a60.6160b4","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Set Quick Messages

\n \n
\n \n
\n\n Pager Number:
\n System ID:
\n\n\n \n \n Beep Time (s)(Blank for Default):\n Beep Style:
\n Vibe Time (s)(Blank for Default):\n Vibe Style:
\n\n\n
\n
\n\n
\n\n
\n
\n\n\n
\n
\n
\n\n\n
\n
Message
\n
\n{{#payload}}\n
\n
{{{content}}}
\n
\n{{/payload}}\n","output":"str","x":810,"y":180,"wires":[["a840eab1.b75478"]]},{"id":"92aec48c.fadac8","type":"switch","z":"53762a60.6160b4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":180,"wires":[["9f4fce9b.9166c"]]},{"id":"e03e5ad0.d30828","type":"template","z":"53762a60.6160b4","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/setQP/receive');\nvar send = new WebSocket('ws://' + location.host + '/setQP/send');\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":490,"y":60,"wires":[["ae41ee14.e3ce3"]]},{"id":"fc4eff16.dd3f8","type":"switch","z":"53762a60.6160b4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"},{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":300,"wires":[[],["7f378075.f7be8"]]},{"id":"4e627db0.a3e074","type":"websocket in","z":"53762a60.6160b4","name":"","server":"c91ee09b.1a258","client":"","x":120,"y":300,"wires":[["fc4eff16.dd3f8"]]},{"id":"bc4c68fa.9963a8","type":"comment","z":"53762a60.6160b4","name":"Handle Input from Webpage","info":"","x":160,"y":240,"wires":[]},{"id":"c6e6ed59.8e76a","type":"switch","z":"53762a60.6160b4","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":80,"wires":[["ac0517b6.d9e3f8"],["13b61216.32c1de"]]},{"id":"13b61216.32c1de","type":"link out","z":"53762a60.6160b4","name":"back to settings","links":["167e6a6e.86b396"],"x":335,"y":100,"wires":[]},{"id":"9f4fce9b.9166c","type":"template","z":"53762a60.6160b4","name":"Select Quick Page Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `quick_page`\nORDER BY `content` ASC;\n","output":"str","x":450,"y":180,"wires":[["564be98d.3a55c8"]]},{"id":"564be98d.3a55c8","type":"sqlite","z":"53762a60.6160b4","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":180,"wires":[["ffb39ddf.99166","bcc3d7d2.eb5e98"]]},{"id":"7f378075.f7be8","type":"template","z":"53762a60.6160b4","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `quick_page`\nWHERE `index`={{payload}};","output":"str","x":430,"y":300,"wires":[["d9aa645.2a16c98"]]},{"id":"d9aa645.2a16c98","type":"sqlite","z":"53762a60.6160b4","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":610,"y":300,"wires":[["cdcb98ae.5c59b8","9f4fce9b.9166c"]]},{"id":"6b47318.4e6cbd","type":"template","z":"53762a60.6160b4","name":"Add Quick Page to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `quick_page` ('pagerNumber', 'sysID', 'content', 'FP') VALUES ('{{payload.pagerNumber}}', '{{payload.sysID}}', '{{{payload.content}}}','{{{payload.Beep}}}{{{payload.beep}}}{{{payload.Vibe}}}{{{payload.vibe}}}');","output":"str","x":940,"y":360,"wires":[["d5ea3a46.87db18","fe3e481f.ed3938"]]},{"id":"d5ea3a46.87db18","type":"sqlite","z":"53762a60.6160b4","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1130,"y":360,"wires":[["cdcb98ae.5c59b8"]]},{"id":"97d8194e.7a33a8","type":"http response","z":"53762a60.6160b4","name":"","statusCode":"201","headers":{},"x":920,"y":300,"wires":[]},{"id":"10135363.fe9ead","type":"switch","z":"53762a60.6160b4","name":"","property":"payload.pagerNumber","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":600,"wires":[["958dd024.861a1"]]},{"id":"462fce27.0f5ca","type":"http in","z":"53762a60.6160b4","name":"","url":"/setQP","method":"post","upload":false,"swaggerDoc":"","x":110,"y":360,"wires":[["afe8f3e1.75e91","10135363.fe9ead"]]},{"id":"cdcb98ae.5c59b8","type":"change","z":"53762a60.6160b4","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/setQP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":300,"wires":[["97d8194e.7a33a8"]]},{"id":"958dd024.861a1","type":"switch","z":"53762a60.6160b4","name":"","property":"payload.Beep","propertyType":"msg","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":600,"wires":[["1d87eeb9.d998e1"],["53e2c166.67fc3"]]},{"id":"53e2c166.67fc3","type":"template","z":"53762a60.6160b4","name":"","field":"payload.Beep","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"B{{payload.Beep}}","output":"str","x":540,"y":620,"wires":[["1d87eeb9.d998e1"]]},{"id":"1d87eeb9.d998e1","type":"switch","z":"53762a60.6160b4","name":"","property":"payload.Vibe","propertyType":"msg","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":600,"wires":[["6b47318.4e6cbd"],["bfe05008.2f677"]]},{"id":"bfe05008.2f677","type":"template","z":"53762a60.6160b4","name":"","field":"payload.Vibe","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"V{{payload.Vibe}}","output":"str","x":780,"y":660,"wires":[["6b47318.4e6cbd"]]},{"id":"afe8f3e1.75e91","type":"debug","z":"53762a60.6160b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":640,"wires":[]},{"id":"fe3e481f.ed3938","type":"debug","z":"53762a60.6160b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":1120,"y":400,"wires":[]},{"id":"e037583e.2056e8","type":"websocket in","z":"53762a60.6160b4","name":"","server":"c91ee09b.1a258","client":"","x":120,"y":180,"wires":[["92aec48c.fadac8"]]},{"id":"bcbbf453.9c3be8","type":"change","z":"9939c833.99b318","name":"","rules":[{"t":"set","p":"data","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":260,"wires":[["44b5460f.fe4328"]]},{"id":"a69165f3.061688","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `quick_page`;","name":"CaptureCall","x":550,"y":220,"wires":[["7bc4367c.81c528"]]},{"id":"7bc4367c.81c528","type":"change","z":"9939c833.99b318","name":"","rules":[{"t":"set","p":"quickpage","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":220,"wires":[["9e910a95.ff8228"]]},{"id":"bcaa4b58.b00838","type":"websocket in","z":"69336e92.97cdb","name":"","server":"a0966341.283ff","client":"","x":150,"y":640,"wires":[["dca52341.8c16b"]]},{"id":"dca52341.8c16b","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Shutdown","vt":"str"},{"t":"regex","v":"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":640,"wires":[[],["546dfdb9.54b494","34e58403.6dd92c"]]},{"id":"3f515a45.9371e6","type":"exec","z":"69336e92.97cdb","command":"shutdown -P now","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"","x":1590,"y":560,"wires":[["b9a5b18a.866ae"],["b9a5b18a.866ae"],["b9a5b18a.866ae"]]},{"id":"e4294a05.13e988","type":"delay","z":"69336e92.97cdb","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1420,"y":560,"wires":[["3f515a45.9371e6","18c59546.2acbbb"]]},{"id":"29adcff4.e3f22","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"CaptureCall is Shutting Down... Please Close your Browser (If Necessary)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":580,"wires":[["a61d55ea.1456e8"]]},{"id":"513b3c7d.0c1584","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Power Off','Power Off', '{{timestamp}}', '{{timestamp}}');","output":"str","x":1560,"y":600,"wires":[["3cfca496.2234dc"]]},{"id":"3cfca496.2234dc","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1710,"y":600,"wires":[[]]},{"id":"2915607d.c556d","type":"change","z":"69336e92.97cdb","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":600,"wires":[["513b3c7d.0c1584"]]},{"id":"b9a5b18a.866ae","type":"debug","z":"69336e92.97cdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1800,"y":560,"wires":[]},{"id":"7ac5988d.f9d118","type":"template","z":"69336e92.97cdb","name":"Clear","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `data` WHERE `exported` IS NOT NULL;","output":"str","x":1210,"y":380,"wires":[["ed55d58.3ba2528"]]},{"id":"ed55d58.3ba2528","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1350,"y":380,"wires":[["6249b7a0.8bf748"]]},{"id":"6249b7a0.8bf748","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Records Deleted","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":380,"wires":[["a3140b4b.44c628"]]},{"id":"a3140b4b.44c628","type":"change","z":"69336e92.97cdb","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":380,"wires":[["49f2faea.1f4d04"]]},{"id":"49f2faea.1f4d04","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Records Deleted','Records Deleted', '{{timestamp}}', '{{timestamp}}');","output":"str","x":1820,"y":380,"wires":[["9811c3df.4feea"]]},{"id":"9811c3df.4feea","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1970,"y":380,"wires":[[]]},{"id":"b469ec62.d0cd9","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.resetLogExported","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":380,"wires":[["978eafdb.f4837"]]},{"id":"546dfdb9.54b494","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"to","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":640,"wires":[["8eab886c.96a868"]]},{"id":"3af57aa4.fb33f6","type":"template","z":"69336e92.97cdb","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` ('capcode', 'pagerNumber', 'sysID', 'group', 'content', 'msgPart1', 'msgPart2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload') \nVALUES ('0', '0', '0', '0', 'eMail Changed to {{global.to}}', 'n/a', 'n/a', 'System','{{timestamp}}', 'eMail Address Changed', '{{timestamp}}', 'n/a', 'n/a');\n","output":"str","x":770,"y":640,"wires":[["ffa14edd.0db52"]]},{"id":"ffa14edd.0db52","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":930,"y":640,"wires":[["38eb5a75.961926"]]},{"id":"8eab886c.96a868","type":"change","z":"69336e92.97cdb","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":640,"wires":[["3af57aa4.fb33f6"]]},{"id":"38eb5a75.961926","type":"link out","z":"69336e92.97cdb","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1035,"y":640,"wires":[]},{"id":"2f6a8d56.b55d32","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer/home","method":"post","upload":false,"swaggerDoc":"","x":140,"y":800,"wires":[["f5dc6436.88d388","c8941714.162de8","c015747.3acb388"]]},{"id":"f5dc6436.88d388","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":360,"y":800,"wires":[]},{"id":"ecb26282.47ff2","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET home = '{{{payload.home}}}'\nWHERE ID = 1;","output":"str","x":540,"y":840,"wires":[["1d39beb6.73a071"]]},{"id":"1d39beb6.73a071","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":690,"y":840,"wires":[[]]},{"id":"c8941714.162de8","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"home","pt":"global","to":"payload.home","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":840,"wires":[["ecb26282.47ff2"]]},{"id":"e990cea.1b2c23","type":"comment","z":"9939c833.99b318","name":"Left Side HTML","info":"","x":1680,"y":260,"wires":[]},{"id":"b88a294d.c11af8","type":"comment","z":"9939c833.99b318","name":"Right Side HTML","info":"","x":1520,"y":300,"wires":[]},{"id":"3157d2d8.f5f64e","type":"comment","z":"9939c833.99b318","name":"Headder and Body HTML","info":"","x":730,"y":120,"wires":[]},{"id":"b4c20ac6.7b8b68","type":"websocket in","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":910,"y":320,"wires":[["977a8359.456ba"]]},{"id":"708df698.457618","type":"websocket out","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":670,"y":320,"wires":[]},{"id":"ecbc89e0.affb98","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Reset Entire Database? WARNING: THIS CANNOT BE UNDONE!","output":"str","x":480,"y":320,"wires":[["708df698.457618"]]},{"id":"977a8359.456ba","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Reset Entire Database? WARNING: THIS CANNOT BE UNDONE!","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1090,"y":320,"wires":[["50f38ebe.b90e6"]]},{"id":"7faecb37.609ff4","type":"websocket out","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":670,"y":380,"wires":[]},{"id":"978eafdb.f4837","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Clear Exported Data? WARNING: THIS CANNOT BE UNDONE!","output":"str","x":480,"y":380,"wires":[["7faecb37.609ff4"]]},{"id":"580fce15.d73ed","type":"websocket in","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":910,"y":380,"wires":[["b67de664.bdfe78"]]},{"id":"b67de664.bdfe78","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Clear Exported Data? WARNING: THIS CANNOT BE UNDONE!","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1090,"y":380,"wires":[["7ac5988d.f9d118"]]},{"id":"39e06a8.af14296","type":"template","z":"9939c833.99b318","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Message
\n
Recipient
\n
Sent Time
\n
\n{{#data}}\n
\n
{{{part1}}}{{{part2}}}
\n
{{{alias}}}
\n
{{displayTime}}
\n
\n{{/data}}","output":"str","x":1250,"y":260,"wires":[["f862321.2f6e7d"]]},{"id":"12ad5379.1db21d","type":"websocket out","z":"9939c833.99b318","name":"","server":"1a6bd275.73c88e","client":"","x":1290,"y":220,"wires":[]},{"id":"4c539035.d5ee7","type":"function","z":"9939c833.99b318","name":"Convert Time to local","func":"var array = msg.data\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.data[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.data[i].displayDate = displayDate\n msg.data[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":260,"wires":[["39e06a8.af14296"]]},{"id":"b263223c.6f42f","type":"template","z":"9939c833.99b318","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0','{{{payload.msg.0}}}', '{{{payload.msg.1}}}', '0','{{timestamp}}', 'From Split Screen', '{{timestamp}}', 'n/a', 'n/a',1);","output":"str","x":1140,"y":580,"wires":[["c441337a.e7c32"]]},{"id":"c441337a.e7c32","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1310,"y":580,"wires":[["bd619cd9.3f938"]]},{"id":"2c2ddbc9.0d1744","type":"change","z":"9939c833.99b318","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":580,"wires":[["b263223c.6f42f"]]},{"id":"bd619cd9.3f938","type":"link out","z":"9939c833.99b318","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885"],"x":1415,"y":580,"wires":[]},{"id":"d9bf7487.dc9358","type":"websocket out","z":"b00e2d77.a9931","name":"","server":"4586ec4f.d85214","client":"","x":760,"y":740,"wires":[]},{"id":"a5a593bb.63b9d","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Email Sent","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":740,"wires":[["d9bf7487.dc9358"]]},{"id":"9ea76e9a.07424","type":"websocket out","z":"b00e2d77.a9931","name":"","server":"4586ec4f.d85214","client":"","x":740,"y":580,"wires":[]},{"id":"d08f4aa4.66b1b8","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Email Failed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":580,"wires":[["9ea76e9a.07424"]]},{"id":"e92ec401.1e4398","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"UPDATE `settings`\nSET email = {{payload}}\nWHERE ID = 1;","name":"","x":620,"y":680,"wires":[[]]},{"id":"34e58403.6dd92c","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET email = '{{payload}}'\nWHERE ID = 1;","output":"str","x":460,"y":680,"wires":[["e92ec401.1e4398"]]},{"id":"bcc3d7d2.eb5e98","type":"debug","z":"53762a60.6160b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":820,"y":140,"wires":[]},{"id":"e6c24b92.a57b38","type":"websocket in","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":1090,"y":580,"wires":[["db08ab58.800e18"]]},{"id":"93221454.7725a8","type":"websocket out","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":850,"y":580,"wires":[]},{"id":"a61d55ea.1456e8","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"WARNING: You will need to physically disconnect and then re-connect power to CaptureCall in order to power-up again. Continue?","output":"str","x":660,"y":580,"wires":[["93221454.7725a8"]]},{"id":"a106b608.8de0a8","type":"websocket out","z":"69336e92.97cdb","name":"","server":"91b7d145.fc4e5","client":"","x":1740,"y":520,"wires":[]},{"id":"18c59546.2acbbb","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"CaptureCall is Shutting Down Please Close your Browser","output":"str","x":1570,"y":520,"wires":[["a106b608.8de0a8"]]},{"id":"873751a0.b7a04","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.power","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":580,"wires":[["29adcff4.e3f22"]]},{"id":"94c17315.5561f","type":"debug","z":"69336e92.97cdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":110,"y":520,"wires":[]},{"id":"db08ab58.800e18","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"WARNING: You will need to physically disconnect and then re-connect power to CaptureCall in order to power-up again. Continue?","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1270,"y":580,"wires":[["e4294a05.13e988","2915607d.c556d"]]},{"id":"5cda5ed2.7e206","type":"http in","z":"23c43518.b3ff0a","name":"","url":"/display","method":"get","upload":false,"swaggerDoc":"","x":90,"y":120,"wires":[["815b7467.abb828"]]},{"id":"c2eec6b6.fa5fb8","type":"http in","z":"5f1f2b21.5baa74","name":"","url":"/browserpage","method":"get","upload":false,"swaggerDoc":"","x":150,"y":120,"wires":[["d6ecfc58.84801"]]},{"id":"5f7f2f85.bd9a8","type":"comment","z":"5f1f2b21.5baa74","name":"Build Webpage","info":"","x":320,"y":20,"wires":[]},{"id":"33c85dd8.3ce032","type":"change","z":"5f1f2b21.5baa74","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Browser Paging","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":100,"wires":[["86bceee6.a0441"]]},{"id":"1eb935a5.ba2dfa","type":"template","z":"5f1f2b21.5baa74","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg.0}}}{{{payload.msg.1}}}","output":"str","x":660,"y":520,"wires":[["4c83195b.01c008"]]},{"id":"4c83195b.01c008","type":"serial out","z":"5f1f2b21.5baa74","name":"","serial":"5d6eb2f4.fc698c","x":810,"y":520,"wires":[]},{"id":"2fa388fc.037688","type":"template","z":"5f1f2b21.5baa74","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0', '{{payload.msg.0}}', '{{payload.msg.1}}', '0','{{timestamp}}', 'Browser Page', '{{timestamp}}', 'n/a', 'n/a','1');","output":"str","x":800,"y":560,"wires":[["e565330c.a5c13"]]},{"id":"e565330c.a5c13","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":990,"y":560,"wires":[["d667da62.00c798"]]},{"id":"3e90d93.5bbd626","type":"change","z":"5f1f2b21.5baa74","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":560,"wires":[["2fa388fc.037688"]]},{"id":"d667da62.00c798","type":"link out","z":"5f1f2b21.5baa74","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b"],"x":1095,"y":560,"wires":[]},{"id":"b1422f10.7c277","type":"http in","z":"5f1f2b21.5baa74","name":"","url":"/browserpage","method":"post","upload":false,"swaggerDoc":"","x":170,"y":460,"wires":[["6316a30.d05ed5c","1b4c8754.791ac9"]]},{"id":"6316a30.d05ed5c","type":"switch","z":"5f1f2b21.5baa74","name":"","property":"payload.msg","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":540,"wires":[["d3526ec8.6f8e2"]]},{"id":"d3526ec8.6f8e2","type":"switch","z":"5f1f2b21.5baa74","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":540,"wires":[["1eb935a5.ba2dfa","3e90d93.5bbd626"]]},{"id":"61d4836a.0e058c","type":"http response","z":"5f1f2b21.5baa74","name":"","statusCode":"","headers":{},"x":570,"y":460,"wires":[]},{"id":"1b4c8754.791ac9","type":"change","z":"5f1f2b21.5baa74","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/browserpage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":460,"wires":[["61d4836a.0e058c"]]},{"id":"ecac2614.625bd8","type":"comment","z":"a6d65e53.c700b","name":"Put Unprocessed On the Webpage","info":"","x":260,"y":300,"wires":[]},{"id":"693be647.1a3a18","type":"template","z":"a6d65e53.c700b","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0'\nORDER BY `rxTime` DESC \nLIMIT 5;\n\n","output":"str","x":390,"y":340,"wires":[["60641487.2aa19c"]]},{"id":"4a1a619f.d1abd","type":"websocket out","z":"a6d65e53.c700b","name":"","server":"c2dca4df.1b2b98","client":"","x":1470,"y":340,"wires":[]},{"id":"60641487.2aa19c","type":"sqlite","z":"a6d65e53.c700b","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":340,"wires":[["427f9ac6.8b9f24","5468c6f1.8007a8"]]},{"id":"4af20cc1.cde7e4","type":"template","z":"a6d65e53.c700b","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{#payload}}\n\n
\n {{{part1}}}\n
\n {{{part2}}} {{sender}}\n
\n {{{elapsed}}}\n
\n{{/payload}}","output":"str","x":1270,"y":340,"wires":[["4a1a619f.d1abd"]]},{"id":"bdd6e52e.c3f978","type":"websocket in","z":"a6d65e53.c700b","name":"","server":"1a6d181c.211418","client":"","x":180,"y":500,"wires":[["a1241fd2.c98bd"]]},{"id":"bfa9de91.5aefa","type":"comment","z":"a6d65e53.c700b","name":"Hide Message on Click","info":"","x":220,"y":460,"wires":[]},{"id":"389e0e76.89cba2","type":"template","z":"a6d65e53.c700b","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":670,"y":480,"wires":[["f2e136eb.ba69f8"]]},{"id":"f2e136eb.ba69f8","type":"sqlite","z":"a6d65e53.c700b","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":870,"y":480,"wires":[["65178d5f.6c89f4"]]},{"id":"65178d5f.6c89f4","type":"link out","z":"a6d65e53.c700b","name":"","links":["13c2aaaa.74d295","81bc9a1b.ba8868","f72ff61b.e8d618","f8b2c7bc.b77368","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":975,"y":480,"wires":[]},{"id":"2d06e176.b31b5e","type":"change","z":"a6d65e53.c700b","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":480,"wires":[["389e0e76.89cba2"]]},{"id":"a1241fd2.c98bd","type":"switch","z":"a6d65e53.c700b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":500,"wires":[["2d06e176.b31b5e"],["f15b3465.3f4f58"]]},{"id":"81bc9a1b.ba8868","type":"link in","z":"a6d65e53.c700b","name":"Received Page","links":["c94a9d48.9c2c","f15b3465.3f4f58","65178d5f.6c89f4"],"x":275,"y":380,"wires":[["693be647.1a3a18"]]},{"id":"427f9ac6.8b9f24","type":"function","z":"a6d65e53.c700b","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":340,"wires":[["2ca0ae66.d871a2"]]},{"id":"f15b3465.3f4f58","type":"link out","z":"a6d65e53.c700b","name":"","links":["81bc9a1b.ba8868"],"x":435,"y":520,"wires":[]},{"id":"bd49881d.1db498","type":"http in","z":"a6d65e53.c700b","name":"","url":"/conference","method":"get","upload":false,"swaggerDoc":"","x":160,"y":220,"wires":[["c6ca1d6f.8bcf5","3ee50bd6.525a64"]]},{"id":"30f4d6fa.9ba46a","type":"comment","z":"a6d65e53.c700b","name":"Build Webpage","info":"","x":200,"y":60,"wires":[]},{"id":"d7033cb5.a545c","type":"http response","z":"a6d65e53.c700b","name":"","statusCode":"201","headers":{},"x":840,"y":200,"wires":[]},{"id":"a814b6a0.1e4978","type":"template","z":"a6d65e53.c700b","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":710,"y":200,"wires":[["d7033cb5.a545c"]]},{"id":"70360a1e.d34914","type":"change","z":"a6d65e53.c700b","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Conference Room Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":200,"wires":[["f8260adf.30aca8"]]},{"id":"e784227f.6661c","type":"inject","z":"a6d65e53.c700b","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":340,"wires":[["693be647.1a3a18"]]},{"id":"f8260adf.30aca8","type":"template","z":"a6d65e53.c700b","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/conference/receive');\n var send = new WebSocket('ws://' + location.host + '/conference/send');\n\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":590,"y":200,"wires":[["a814b6a0.1e4978"]]},{"id":"2ca0ae66.d871a2","type":"function","z":"a6d65e53.c700b","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":920,"y":340,"wires":[["5dc3c713.2c4ff8"]]},{"id":"5dc3c713.2c4ff8","type":"function","z":"a6d65e53.c700b","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1110,"y":340,"wires":[["4af20cc1.cde7e4"]]},{"id":"c6ca1d6f.8bcf5","type":"switch","z":"a6d65e53.c700b","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":220,"wires":[["70360a1e.d34914"],["12e7e314.ca01cd"]]},{"id":"12e7e314.ca01cd","type":"link out","z":"a6d65e53.c700b","name":"","links":["f13a1f16.82872"],"x":435,"y":240,"wires":[]},{"id":"3ee50bd6.525a64","type":"debug","z":"a6d65e53.c700b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":260,"wires":[]},{"id":"5468c6f1.8007a8","type":"debug","z":"a6d65e53.c700b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":730,"y":300,"wires":[]},{"id":"1cbf532e.685a3d","type":"function","z":"e3cbac21.52804","name":"Split Received Pager Data ","func":"//Regex to match both RX1 and LRS TX7470 See Explanation File\nvar result = msg.payload.match(/\\x19A(\\d*)d\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\x0c?(.*)?\\x18|\\x19A(\\d*)d(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?\\x18|RECV,4,(\\d*),\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\%?0?C?(.*)?|RECV,4,(\\d*),(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?/);\n\n//Group Regex Results\nvar capcode = result[1]||result[8]||result[12]||result[19];\nvar group = result[2]||result[13];\nvar part1 = result[3]||result[9]||result[14]||result[20];\nvar part2 = result[4]||result[15];\nvar sender = result[5]||result[10]||result[16]||result[21];\nvar cleared = result[6]||result[11]||result[17]||result[22];\nvar FP = result[7]||result[18];\n\n//Calculate Pager number and SysID\nvar pagerStr = capcode.substring(capcode.length - 5, capcode.Length);\nvar pagercalc = parseInt(pagerStr);\nvar pagerNumber = pagercalc/8;\nvar sysID = ((capcode - pagercalc)-700000)/100000;\n\n//Convert Cleared to Boolean\nif (typeof cleared === \"undefined\") {\n msg.cleared = 0;\n msg.status = \"n/a\"\n} else { \n msg.cleared = 1;\n msg.status = \"Clearing Message\"\n}\n\n//Convert Late to Boolean\nvar late=global.get('late') || \"Late\";\nif (part1 === late) {\n msg.late = 1;\n} else { \n msg.late = 0;\n}\n\n\n\n//Set Up Outputs\nmsg.result = result;\nmsg.capcode = capcode;\nmsg.pagerNumber = pagerNumber;\nmsg.sysID = sysID;\nmsg.group = group;\nmsg.part1 = part1;\nmsg.part2 = part2;\n msg.FP = FP;\nmsg.sender = sender;\nmsg.timestamp = Date.now(); //Current Timestamp\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":240,"wires":[["cd63b42b.c622b8"]]},{"id":"349d8d25.ff88c2","type":"function","z":"8f4a2a74.1d74a8","name":"LRS Process Page","func":"//Input\nvar payload = msg.payload;\nvar shortened = payload.slice(6,payload.length -2) //Remove Serial Data from front of Message\nvar duplicate = msg.duplicate;\n//Get Capcode and Message\nvar capcode = shortened.substring(1,8);\nvar message = shortened.substring(9,payload.length);\n\n//Calculate Pager number and SysID\nvar cc = capcode.toString();\nvar pagerStr = cc.substring(cc.length - 5, cc.Length);\nvar pagercalc = parseInt(pagerStr);\nvar pagerNumber = pagercalc/8;\nvar sysID = ((capcode - pagercalc)-700000)/100000;\n\n//Check If Group Message\nif (message.includes(\"[\")) {\n var group = message.substring(1,3);\n var msgStart = message.indexOf(\"]\") + 1;\n} else { \n var group = \"n/a\";\n var msgStart = 0;\n}\n\n//Check If Contains Flash Pattern and Get Sender ID\nif (message.includes(\"%\")) {\n var percentIndex = message.indexOf(\"%\"); //Find Index of %\n var FP = message.substring(percentIndex + 3,message.length);\n var senderMessy = message.substring(percentIndex - 2, percentIndex);\n var sender = senderMessy.trim();\n var msgEnd = percentIndex -3;\n} else { \n var FP = \"n/a\";\n var senderMessy = message.substring(message.length - 2, message.length);\n var sender = senderMessy.trim();\n var msgEnd = message.length - 2;\n}\n\n//Get Total Message\nvar content = message.substring(msgStart,msgEnd);\n\n//Split Message into Part 1 and Part 2\nvar Part = content.split(\"-\");\n\nvar msgPart1 = Part[0];\nvar msgPart2 = Part[1];\n\n//Set Status Message\n\nif (message.includes(\"Handled\")) {\n var status = \"Attended\";\n} else if (message.includes(\"Late\")) {\n var status = \"Late\";\n} else if (duplicate === true) {\n var status = \"Duplicate\";\n}else {\n var status = \"Active\";\n}\n\n//Outputs\nmsg.capcode = capcode; //Capcode\nmsg.pagerNumber = pagerNumber; //Pager Number\nmsg.sysID = sysID; //System ID\nmsg.group = group; //Group Number\nmsg.content = content; //Whole Message\nmsg.msgPart1 = msgPart1 //Part One of Message\nmsg.msgPart2 = msgPart2 //Part Two of Message\nmsg.sender = sender; //Originating Button or Table\nmsg.timestamp = Date.now(); //Current Timestamp\nmsg.Status = status; //Status\nmsg.FP = FP; //Flash Pattern\nmsg.payload = payload;\nreturn msg;","outputs":1,"noerr":0,"x":1010,"y":100,"wires":[[]]},{"id":"7ad51ff1.1d5bc","type":"comment","z":"8f4a2a74.1d74a8","name":"Receive Page LRS","info":"","x":130,"y":80,"wires":[]},{"id":"305e69b.97a0f96","type":"switch","z":"8f4a2a74.1d74a8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"prev"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":120,"wires":[["81e7848a.e7a048"],["44d52fc.36e19d"]]},{"id":"44d52fc.36e19d","type":"switch","z":"8f4a2a74.1d74a8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Reset","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":140,"wires":[["349d8d25.ff88c2"],[]]},{"id":"5189e8ae.3134e8","type":"delay","z":"8f4a2a74.1d74a8","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":160,"wires":[["955acd81.a75f7"]]},{"id":"955acd81.a75f7","type":"change","z":"8f4a2a74.1d74a8","name":"Reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"Reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":160,"wires":[["305e69b.97a0f96"]]},{"id":"81e7848a.e7a048","type":"change","z":"8f4a2a74.1d74a8","name":"","rules":[{"t":"set","p":"duplicate","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":100,"wires":[["349d8d25.ff88c2"]]},{"id":"32b7704c.e1af","type":"delay","z":"8f4a2a74.1d74a8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":280,"y":160,"wires":[["5189e8ae.3134e8"]]},{"id":"4b3910f5.5d0a","type":"http response","z":"4ff720ae.e74bd","name":"","statusCode":"201","headers":{},"x":820,"y":220,"wires":[]},{"id":"86a76044.4a4b6","type":"comment","z":"4ff720ae.e74bd","name":"Build Webpage","info":"","x":200,"y":100,"wires":[]},{"id":"aaa334ce.cfa1e8","type":"template","z":"4ff720ae.e74bd","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n\n \n\n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":690,"y":220,"wires":[["4b3910f5.5d0a"]]},{"id":"6cf49682.74b3a8","type":"template","z":"4ff720ae.e74bd","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/bar/receive');\nvar send = new WebSocket('ws://' + location.host + '/bar/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":570,"y":220,"wires":[["aaa334ce.cfa1e8"]]},{"id":"a0957acd.e4e1e8","type":"http in","z":"4ff720ae.e74bd","name":"","url":"/big","method":"get","upload":false,"swaggerDoc":"","x":160,"y":240,"wires":[["68bab3b3.1a61bc"]]},{"id":"116e1fbb.0dbdb","type":"change","z":"4ff720ae.e74bd","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Big Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":220,"wires":[["6cf49682.74b3a8"]]},{"id":"68bab3b3.1a61bc","type":"switch","z":"4ff720ae.e74bd","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":240,"wires":[["116e1fbb.0dbdb"],["c8fee362.8be85"]]},{"id":"c8fee362.8be85","type":"link out","z":"4ff720ae.e74bd","name":"","links":["f13a1f16.82872"],"x":415,"y":260,"wires":[]},{"id":"38281131.9ffbce","type":"comment","z":"4ff720ae.e74bd","name":"Put All On the Webpage","info":"","x":200,"y":300,"wires":[]},{"id":"350ea78c.7b4cc8","type":"template","z":"4ff720ae.e74bd","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM data\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0' AND `sender` != 'system'\nORDER BY `index` ASC\nLIMIT 5;","output":"str","x":390,"y":400,"wires":[["e4c07e7d.8209e"]]},{"id":"ef7dd1c4.c745f","type":"websocket out","z":"4ff720ae.e74bd","name":"","server":"15d62cbe.d62773","client":"","x":1560,"y":400,"wires":[]},{"id":"e4c07e7d.8209e","type":"sqlite","z":"4ff720ae.e74bd","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":400,"wires":[["3767ddf3.b3c8b2","cb367c00.a2955"]]},{"id":"6d2db6cd.b30b68","type":"function","z":"4ff720ae.e74bd","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":900,"y":400,"wires":[["fe84d37b.4370c"]]},{"id":"a33f9456.00f078","type":"link in","z":"4ff720ae.e74bd","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","aa72ab3f.277cf8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","ce5be23d.4618f","64848176.9353c","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":235,"y":460,"wires":[["350ea78c.7b4cc8"]]},{"id":"3767ddf3.b3c8b2","type":"function","z":"4ff720ae.e74bd","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":400,"wires":[["6d2db6cd.b30b68"]]},{"id":"7b2d59df.6f8758","type":"template","z":"4ff720ae.e74bd","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Time
\n
Location
\n
Wait Time
\n
\n{{#payload}}\n
\n
{{{displayTime}}}
\n
{{{alias}}}{{^alias}}{{sender}}{{/alias}}
\n
{{elapsed}}
\n
\n{{/payload}}","output":"str","x":1350,"y":400,"wires":[["ef7dd1c4.c745f"]]},{"id":"20ed0eda.2e6c82","type":"switch","z":"4ff720ae.e74bd","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":340,"wires":[[],["350ea78c.7b4cc8"]]},{"id":"2703b996.e60596","type":"websocket in","z":"4ff720ae.e74bd","name":"","server":"7b602086.fa4f5","client":"","x":150,"y":340,"wires":[["20ed0eda.2e6c82"]]},{"id":"fe84d37b.4370c","type":"function","z":"4ff720ae.e74bd","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(14, 5); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1120,"y":400,"wires":[["7b2d59df.6f8758","bcb9a64e.219718"]]},{"id":"db764110.ca549","type":"inject","z":"4ff720ae.e74bd","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":400,"wires":[["350ea78c.7b4cc8"]]},{"id":"1c947022.1bfe3","type":"websocket in","z":"4ff720ae.e74bd","name":"","server":"7b602086.fa4f5","client":"","x":130,"y":560,"wires":[["ffb306af.a621c8"]]},{"id":"87e4c6ed.e84968","type":"comment","z":"4ff720ae.e74bd","name":"Hide Message on Click","info":"","x":160,"y":520,"wires":[]},{"id":"c125e8b4.e901d8","type":"template","z":"4ff720ae.e74bd","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', cleared = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":560,"wires":[["148076a5.6e76d9"]]},{"id":"148076a5.6e76d9","type":"sqlite","z":"4ff720ae.e74bd","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":560,"wires":[["439e3a4.33f4dc4"]]},{"id":"439e3a4.33f4dc4","type":"link out","z":"4ff720ae.e74bd","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec"],"x":915,"y":560,"wires":[]},{"id":"ac585b7a.1733e8","type":"change","z":"4ff720ae.e74bd","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":560,"wires":[["c125e8b4.e901d8"]]},{"id":"ffb306af.a621c8","type":"switch","z":"4ff720ae.e74bd","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":560,"wires":[["ac585b7a.1733e8"]]},{"id":"bcb9a64e.219718","type":"debug","z":"4ff720ae.e74bd","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1280,"y":360,"wires":[]},{"id":"96f0724f.dc67","type":"change","z":"e3cbac21.52804","name":"","rules":[{"t":"set","p":"duplicate","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":260,"wires":[["c94a9d48.9c2c"]]},{"id":"9301bc45.dca2a","type":"change","z":"e3cbac21.52804","name":"","rules":[{"t":"set","p":"duplicate","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":220,"wires":[["c94a9d48.9c2c"]]},{"id":"6579a230.6630bc","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"late","pt":"global","to":"Repage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":720,"wires":[[]]},{"id":"d3cc339c.3f9a3","type":"debug","z":"e3cbac21.52804","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1390,"y":300,"wires":[]},{"id":"b374a788.183148","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":940,"wires":[]},{"id":"78ace38b.18330c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":900,"wires":[["556b0e9f.f6536"]]},{"id":"62623f54.11db1","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE \"data\" ( `index` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `capcode` INTEGER, `pagerNumber` INTEGER, `sysID` INTEGER, `group` INTEGER, `part1` TEXT, `part2` TEXT, `sender` INTEGER, `FP` TEXT, `rxTime` INTEGER, `status` INTEGER, `statusTime` INTEGER, `exported` INTEGER, `cleared` INTEGER, `late` INTEGER, `duplicate` INTEGER, `T/R` INTEGER, `payload` TEXT )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":900,"wires":[["78ace38b.18330c"]]},{"id":"556b0e9f.f6536","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":900,"wires":[]},{"id":"84ad9d67.c4c0d","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":1060,"wires":[["ffe0a0cc.394ae"]]},{"id":"d1ee2e00.7fbc4","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":1060,"wires":[["84ad9d67.c4c0d"]]},{"id":"19b9c29a.dafd0d","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":940,"wires":[["b374a788.183148"]]},{"id":"1286d3b6.902f2c","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":940,"wires":[["19b9c29a.dafd0d"]]},{"id":"b11d6374.93d22","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":980,"wires":[]},{"id":"6f8f2998.ba0248","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":980,"wires":[["b11d6374.93d22"]]},{"id":"f6735051.cc788","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":980,"wires":[["6f8f2998.ba0248"]]},{"id":"ffe0a0cc.394ae","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":1060,"wires":[]},{"id":"5b125aa5.a84b34","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":1020,"wires":[]},{"id":"5cfcd9f0.bfe708","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":1020,"wires":[["5b125aa5.a84b34"]]},{"id":"f26329eb.28ef88","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1020,"wires":[["5cfcd9f0.bfe708"]]},{"id":"d9f740ee.f7d7c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":1100,"wires":[["cd846e21.6a43c"]]},{"id":"4e8a45f.f4c89bc","type":"inject","z":"ba76d305.cf8ad","name":"Clear Old Records","topic":"DELETE FROM `data` WHERE `index` IN (SELECT `index` FROM `log` ORDER BY `index` DESC LIMIT -1 OFFSET 2000) AND `exported` IS NOT NULL;","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":1100,"wires":[["d9f740ee.f7d7c"]]},{"id":"cd846e21.6a43c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":1100,"wires":[]},{"id":"55482138.f3d76","type":"comment","z":"ba76d305.cf8ad","name":"Data","info":"","x":490,"y":860,"wires":[]},{"id":"5d19cfa1.ed974","type":"debug","z":"b8bd1cc3.4827","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":360,"wires":[]},{"id":"6fb08921.c8e198","type":"switch","z":"e3cbac21.52804","name":"","property":"cleared","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1390,"y":260,"wires":[["67027f52.0807"],[]]},{"id":"67027f52.0807","type":"template","z":"e3cbac21.52804","name":"Update Cleared","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Cleared Remotely', statusTime = '{{timestamp}}', cleared = 1 WHERE `sender` = {{sender}} AND `cleared` = 0;","output":"str","x":1540,"y":260,"wires":[["76901721.920c58"]]},{"id":"7793973e.ce5438","type":"debug","z":"9939c833.99b318","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":400,"y":620,"wires":[]},{"id":"e1963d60.f46e6","type":"debug","z":"53e35596.381c0c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":420,"wires":[]},{"id":"cb367c00.a2955","type":"debug","z":"4ff720ae.e74bd","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":340,"wires":[]},{"id":"62743a5f.4888e4","type":"http response","z":"c8c5b763.cd1498","name":"","statusCode":"201","headers":{},"x":820,"y":220,"wires":[]},{"id":"4a9dfb5a.d03194","type":"comment","z":"c8c5b763.cd1498","name":"Build Webpage","info":"","x":200,"y":100,"wires":[]},{"id":"dfcaabee.673268","type":"template","z":"c8c5b763.cd1498","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n \n \n \n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":690,"y":220,"wires":[["62743a5f.4888e4"]]},{"id":"9bb11c1e.305b4","type":"template","z":"c8c5b763.cd1498","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/location/receive');\nvar send = new WebSocket('ws://' + location.host + '/location/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":570,"y":220,"wires":[["dfcaabee.673268"]]},{"id":"38d374fa.18eeac","type":"http in","z":"c8c5b763.cd1498","name":"","url":"/location","method":"get","upload":false,"swaggerDoc":"","x":110,"y":240,"wires":[["5b86d98e.320508"]]},{"id":"a593260e.3cab78","type":"change","z":"c8c5b763.cd1498","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Wait Time Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":220,"wires":[["9bb11c1e.305b4"]]},{"id":"5b86d98e.320508","type":"switch","z":"c8c5b763.cd1498","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":240,"wires":[["a593260e.3cab78"],["a593260e.3cab78"]]},{"id":"f2226618.7daa98","type":"link out","z":"c8c5b763.cd1498","name":"","links":["f13a1f16.82872"],"x":455,"y":260,"wires":[]},{"id":"ac7b5a0c.12e788","type":"comment","z":"c8c5b763.cd1498","name":"Put All On the Webpage","info":"","x":200,"y":300,"wires":[]},{"id":"67faab1.46f3954","type":"template","z":"c8c5b763.cd1498","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM data\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0'\nORDER BY `index` ASC\nLIMIT 6;","output":"str","x":390,"y":400,"wires":[["1fd99352.f04f8d"]]},{"id":"b0ae7635.a4f898","type":"websocket out","z":"c8c5b763.cd1498","name":"","server":"39f67bec.0b2fe4","client":"","x":1580,"y":400,"wires":[]},{"id":"1fd99352.f04f8d","type":"sqlite","z":"c8c5b763.cd1498","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":400,"wires":[["8065fc77.21f1f"]]},{"id":"15f63175.ed111f","type":"function","z":"c8c5b763.cd1498","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":900,"y":400,"wires":[["c8b58dea.f7d9c"]]},{"id":"aec2bb4a.2b7638","type":"link in","z":"c8c5b763.cd1498","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","aa72ab3f.277cf8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4"],"x":235,"y":460,"wires":[["67faab1.46f3954"]]},{"id":"8065fc77.21f1f","type":"function","z":"c8c5b763.cd1498","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":400,"wires":[["15f63175.ed111f"]]},{"id":"956c8b78.0249e8","type":"template","z":"c8c5b763.cd1498","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n \n
\n
\n
{{{payload.0.alias}}}{{^payload.0.alias}}{{payload.0.sender}}{{/payload.0.alias}}
\n
{{payload.0.displayTime}}
\n
{{payload.0.elapsed}}
\n
\n \n
\n
{{{payload.1.alias}}}{{^payload.1.alias}}{{payload.1.sender}}{{/payload.1.alias}}
\n
{{payload.1.displayTime}}
\n
{{payload.1.elapsed}}
\n
\n\n
\n
{{{payload.2.alias}}}{{^payload.2.alias}}{{payload.2.sender}}{{/payload.2.alias}}
\n
{{payload.2.displayTime}}
\n
{{payload.2.elapsed}}
\n
\n\n
\n
{{{payload.3.alias}}}{{^payload.3.alias}}{{payload.3.sender}}{{/payload.3.alias}}
\n
{{payload.3.displayTime}}
\n
{{payload.3.elapsed}}
\n
\n\n
\n
{{{payload.4.alias}}}{{^payload.4.alias}}{{payload.4.sender}}{{/payload.4.alias}}
\n
{{payload.4.displayTime}}
\n
{{payload.4.elapsed}}
\n
\n\n
\n
{{{payload.5.alias}}}{{^payload.5.alias}}{{payload.5.sender}}{{/payload.5.alias}}
\n
{{payload.5.displayTime}}
\n
{{payload.5.elapsed}}
\n
\n
","output":"str","x":1350,"y":400,"wires":[["b0ae7635.a4f898"]]},{"id":"865343b.d02dfc","type":"switch","z":"c8c5b763.cd1498","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":340,"wires":[[],["67faab1.46f3954"]]},{"id":"1e09b706.e283d9","type":"websocket in","z":"c8c5b763.cd1498","name":"","server":"a6feaa7b.4b5558","client":"","x":150,"y":340,"wires":[["865343b.d02dfc"]]},{"id":"c8b58dea.f7d9c","type":"function","z":"c8c5b763.cd1498","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(14, 5); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1120,"y":400,"wires":[["956c8b78.0249e8","38937a17.5d71f6"]]},{"id":"5ecb9387.0d222c","type":"inject","z":"c8c5b763.cd1498","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":400,"wires":[[]]},{"id":"2ef6c771.e22d98","type":"websocket in","z":"c8c5b763.cd1498","name":"","server":"a6feaa7b.4b5558","client":"","x":150,"y":560,"wires":[["e3eddf7e.b19ea"]]},{"id":"51a2e843.ed6658","type":"comment","z":"c8c5b763.cd1498","name":"Hide Message on Click","info":"","x":160,"y":520,"wires":[]},{"id":"7eacb804.72a458","type":"template","z":"c8c5b763.cd1498","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', cleared = 1 WHERE `index` = {{payload}};","output":"str","x":630,"y":560,"wires":[["5cb98ae8.12e0e4"]]},{"id":"5cb98ae8.12e0e4","type":"sqlite","z":"c8c5b763.cd1498","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":560,"wires":[["8c92895d.82c2b8"]]},{"id":"8c92895d.82c2b8","type":"link out","z":"c8c5b763.cd1498","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec"],"x":935,"y":560,"wires":[]},{"id":"d035be00.6d755","type":"change","z":"c8c5b763.cd1498","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":560,"wires":[["7eacb804.72a458"]]},{"id":"e3eddf7e.b19ea","type":"switch","z":"c8c5b763.cd1498","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":560,"wires":[["d035be00.6d755"]]},{"id":"38937a17.5d71f6","type":"debug","z":"c8c5b763.cd1498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1280,"y":360,"wires":[]},{"id":"d6ecfc58.84801","type":"switch","z":"5f1f2b21.5baa74","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":120,"wires":[["33c85dd8.3ce032"],["7ac9201a.5756a"]]},{"id":"7ac9201a.5756a","type":"link out","z":"5f1f2b21.5baa74","name":"","links":["f13a1f16.82872"],"x":455,"y":140,"wires":[]},{"id":"575733eb.f4b5cc","type":"http response","z":"5f1f2b21.5baa74","name":"","statusCode":"201","headers":{},"x":860,"y":100,"wires":[]},{"id":"a2f82770.62bfc8","type":"template","z":"5f1f2b21.5baa74","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n \n\n\n\n \n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n
\n
\n\n\n\n\n","output":"str","x":730,"y":100,"wires":[["575733eb.f4b5cc"]]},{"id":"86bceee6.a0441","type":"template","z":"5f1f2b21.5baa74","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/browserpage/receive');\nvar one = new WebSocket('ws://' + location.host + '/browserpage/receive/one');\nvar send = new WebSocket('ws://' + location.host + '/browserpage/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":610,"y":100,"wires":[["a2f82770.62bfc8"]]},{"id":"266384d.436177c","type":"comment","z":"5f1f2b21.5baa74","name":"Headder and Body HTML","info":"","x":770,"y":60,"wires":[]},{"id":"5ae3627c.893d6c","type":"template","z":"5f1f2b21.5baa74","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN pagerAlias ON data.pagerNumber = pagerAlias.pagerNumber\nWHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `T/R` = '1'\nORDER BY `rxTime` DESC;","output":"str","x":390,"y":300,"wires":[["d5a615cf.443d38"]]},{"id":"68c99f17.874bc","type":"websocket out","z":"5f1f2b21.5baa74","name":"","server":"846cfc61.5ccfe","client":"","x":1490,"y":300,"wires":[]},{"id":"d5a615cf.443d38","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":300,"wires":[["db0135c3.449e28"]]},{"id":"2fb13b26.8e2db4","type":"template","z":"5f1f2b21.5baa74","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n\n \n \n  Quick Message:\n  Recipient:\n \n
\n
\n\n
","output":"str","x":890,"y":240,"wires":[["16ff5c7a.8b3b84"]]},{"id":"88c190e6.24c48","type":"function","z":"5f1f2b21.5baa74","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":880,"y":300,"wires":[["2f034fdc.75d47"]]},{"id":"a62b911a.4bb8b","type":"link in","z":"5f1f2b21.5baa74","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","baaeb70f.7624e8","5ce459da.1e66f8","dde42ec0.d2e1f","ce5be23d.4618f","38eb5a75.961926","64848176.9353c","d667da62.00c798","65178d5f.6c89f4","2c9c0640.62baca","b7cb91ea.e008a"],"x":215,"y":300,"wires":[["63b4994a.1e5468","5ae3627c.893d6c"]]},{"id":"26fa2cb5.b2b114","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `pagerAlias`;","name":"CaptureCall","x":730,"y":240,"wires":[["2fb13b26.8e2db4"]]},{"id":"db0135c3.449e28","type":"change","z":"5f1f2b21.5baa74","name":"","rules":[{"t":"set","p":"data","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":300,"wires":[["88c190e6.24c48"]]},{"id":"63b4994a.1e5468","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `quick_page`;","name":"CaptureCall","x":370,"y":240,"wires":[["c1e99af2.f6ead8"]]},{"id":"c1e99af2.f6ead8","type":"change","z":"5f1f2b21.5baa74","name":"","rules":[{"t":"set","p":"quickpage","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":240,"wires":[["26fa2cb5.b2b114"]]},{"id":"d42e192a.8b7738","type":"template","z":"5f1f2b21.5baa74","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n\n
\n
Message
\n
Recipient
\n
Sent Time
\n
\n{{#data}}\n
\n
{{{part1}}}{{{part2}}}
\n
{{{alias}}}
\n
{{displayTime}}
\n
\n{{/data}}\n \n
","output":"str","x":1270,"y":300,"wires":[["68c99f17.874bc"]]},{"id":"16ff5c7a.8b3b84","type":"websocket out","z":"5f1f2b21.5baa74","name":"","server":"654f3d23.7221e4","client":"","x":1110,"y":240,"wires":[]},{"id":"2f034fdc.75d47","type":"function","z":"5f1f2b21.5baa74","name":"Convert Time to local","func":"var array = msg.data\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.data[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.data[i].displayDate = displayDate\n msg.data[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1080,"y":300,"wires":[["d42e192a.8b7738"]]},{"id":"ad661a57.c24e38","type":"websocket in","z":"5f1f2b21.5baa74","name":"","server":"922ce017.72c01","client":"","x":160,"y":240,"wires":[["63b4994a.1e5468","5ae3627c.893d6c"]]},{"id":"b19f9c2a.0005a","type":"switch","z":"23c43518.b3ff0a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":480,"wires":[["625b3340.e4df8c"],["ebcd4c65.6046a"]]},{"id":"625b3340.e4df8c","type":"change","z":"23c43518.b3ff0a","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":480,"wires":[["2deb0bfd.31afc4"]]},{"id":"2deb0bfd.31afc4","type":"switch","z":"23c43518.b3ff0a","name":"","property":"direction","propertyType":"global","rules":[{"t":"eq","v":"ASC","vt":"str"},{"t":"eq","v":"DESC","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":500,"wires":[["ad0635c5.bf4f18"],["95dd862a.cc1308"]]},{"id":"ad0635c5.bf4f18","type":"change","z":"23c43518.b3ff0a","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":480,"wires":[["e5f646d.fb382b8"]]},{"id":"95dd862a.cc1308","type":"change","z":"23c43518.b3ff0a","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"ASC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":520,"wires":[["e5f646d.fb382b8"]]},{"id":"e5f646d.fb382b8","type":"link out","z":"23c43518.b3ff0a","name":"","links":["4a4f10a5.b3051"],"x":1075,"y":500,"wires":[]},{"id":"10de6977.bb8d37","type":"function","z":"e61361fa.da19a","name":"Set Text Mode","func":"msg.payload=\"AT+CMGF=1\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":80,"wires":[["79aacbf4.636dd4"]]},{"id":"69592b7b.5ce814","type":"function","z":"e61361fa.da19a","name":"Set Text Parameters","func":"msg.payload = \"AT+CSMP=17,167,0,0\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":240,"wires":[["2d248d6.9f74172"]]},{"id":"a0e3fbb3.2826c8","type":"function","z":"e61361fa.da19a","name":"Set Telephone Number","func":"msg.payload=\"AT+CMGS=\\\"\" + msg.number +\"\\\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":320,"wires":[["ea951096.62246"]]},{"id":"220aa1d8.3e212e","type":"function","z":"e61361fa.da19a","name":"Set Message Content","func":"msg.payload= msg.message +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":400,"wires":[["82964f51.db897"]]},{"id":"611f59c8.8b6658","type":"function","z":"e61361fa.da19a","name":"Send Message","func":"msg.payload=\"\\x1A\";\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":480,"wires":[[]]},{"id":"c0ac4507.b28cb8","type":"function","z":"e61361fa.da19a","name":"Set Message Format","func":"msg.payload=\"AT+CSCS=\\\"GSM\\\"\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":160,"wires":[["bc3ea98e.cfef68"]]},{"id":"ea951096.62246","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":360,"wires":[["220aa1d8.3e212e"]]},{"id":"82964f51.db897","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":440,"wires":[["611f59c8.8b6658"]]},{"id":"2d248d6.9f74172","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":280,"wires":[["a0e3fbb3.2826c8"]]},{"id":"79aacbf4.636dd4","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":120,"wires":[["c0ac4507.b28cb8"]]},{"id":"bc3ea98e.cfef68","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":200,"wires":[["69592b7b.5ce814"]]},{"id":"f49fd797.dcd168","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":580,"y":80,"wires":[]},{"id":"e5250da9.c3a64","type":"subflow:e61361fa.da19a","z":"fa19d7ed.b2f408","name":"","x":390,"y":80,"wires":[["f49fd797.dcd168"]]},{"id":"6d4f4c3c.35d1e4","type":"function","z":"fa19d7ed.b2f408","name":"Get All Messages","func":"msg.payload=\"AT+CMGL=\\\"ALL\\\"\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":640,"wires":[["af57df0f.33c1b"]]},{"id":"af57df0f.33c1b","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":1100,"y":640,"wires":[]},{"id":"b9db0b9e.0c0638","type":"serial in","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":120,"y":300,"wires":[["863ff069.69f21","2aa5af02.4ddce"]]},{"id":"df18c571.fc2e38","type":"function","z":"fa19d7ed.b2f408","name":"Delete All Messages","func":"msg.payload=\"at+cmgd=1,4\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":180,"wires":[["8f67c491.b4caa8"]]},{"id":"8f67c491.b4caa8","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":1230,"y":180,"wires":[]},{"id":"801dbbc7.6e5578","type":"function","z":"fa19d7ed.b2f408","name":"Split Received SMS Data","func":"var result = msg.payload.match(/\\s(\\d+),\"\\D+\"(\\+\\d+)\",,\"(\\d+\\/\\d+\\/\\d+),(\\d+\\:\\d+:\\d+)\\+00\"\\r\\n(.*?)\\r\\n/);\n\n//Group Regex Results\nvar index = result[1];\nvar number = result[2];\nvar date = result[3];\nvar time = result[4];\nvar message = result[5];\n\n//Set Up Outputs\n//msg.index = index;\nmsg.number = number;\n//msg.date = date;\n//msg.time = time;\nmsg.message = message;\nmsg.timestamp = Date.now(); //Current Timestamp\n\nmsg.payload = result;\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":260,"wires":[["2604c8cb.6b0ac8","a8ec5f4b.7c145"]]},{"id":"7170ca5b.1b9664","type":"http in","z":"643aaaf4.e44594","name":"","url":"/logistics","method":"get","upload":false,"swaggerDoc":"","x":350,"y":160,"wires":[["7fc92cff.a62214"]]},{"id":"712b1333.c2d99c","type":"comment","z":"643aaaf4.e44594","name":"Build Webpage","info":"","x":190,"y":120,"wires":[]},{"id":"7fc92cff.a62214","type":"change","z":"643aaaf4.e44594","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Logistics Paging","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":160,"wires":[["69b5c477.4529ec"]]},{"id":"ecefd8da.15b818","type":"http response","z":"643aaaf4.e44594","name":"","statusCode":"201","headers":{},"x":900,"y":160,"wires":[]},{"id":"be0d5a2f.ffee18","type":"template","z":"643aaaf4.e44594","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n \n\n\n\n \n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n
\n
\n\n \n \n  Quick Instruction:\n  Vehicle:\n \n
\n
\n\n
\n
\n \n
\n\n
\n
Instruction
\n
Vehicle
\n
Sent Time
\n
Complete Time
\n
\n\n
\n
Please Go To Bay 1
\n
GM65ATK
\n
14:21
\n
-
\n
\n \n
\n
Please Go To Bay 3
\n
FP05NWB
\n
11:21
\n
12:59
\n
\n \n
\n
Please Go To Bay 7
\n
WJ08XXW
\n
11:25
\n
12:30
\n
\n \n
\n
Please Go To Bay 2
\n
P977XLM
\n
09:21
\n
09:48
\n
\n\n \n
\n\n
\n\n\n\n\n","output":"str","x":770,"y":160,"wires":[["ecefd8da.15b818"]]},{"id":"69b5c477.4529ec","type":"template","z":"643aaaf4.e44594","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/browserpage/receive');\nvar one = new WebSocket('ws://' + location.host + '/browserpage/receive/one');\nvar send = new WebSocket('ws://' + location.host + '/browserpage/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":650,"y":160,"wires":[["be0d5a2f.ffee18"]]},{"id":"8eca38b3.56d018","type":"comment","z":"643aaaf4.e44594","name":"Headder and Body HTML","info":"","x":810,"y":120,"wires":[]},{"id":"eaedcda1.c38f2","type":"serial in","z":"c9436af2.6cae48","name":"","serial":"5d6eb2f4.fc698c","x":190,"y":180,"wires":[["e680aa9c.793ad8"]]},{"id":"e5b11a3e.8893c8","type":"function","z":"c9436af2.6cae48","name":"Reformat the Message For Send","func":"//Regex to match both RX1 and LRS TX7470 See Explanation File\nvar result = msg.payload.match(/RECV,4,(\\d*),(.*-\\S+\\s\\d+?\\:?\\w*)?\\s?\\d?\\%?0?C?(.*)?/);\n\n//Group Regex Results\nvar capcode = result[1]||\" \";\nvar message = result[2]||\" \";\nvar FP = result[3]||null;\n\nvar page = \"CCPAGE,\"+ capcode + \",\"+ message + \"\\f\" + FP + \"\\n\";\nmsg.payload = page\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":180,"wires":[["e3771aa.2d96ee8","9ae1dc7d.ed96d"]]},{"id":"e3771aa.2d96ee8","type":"serial out","z":"c9436af2.6cae48","name":"","serial":"5d6eb2f4.fc698c","x":1150,"y":180,"wires":[]},{"id":"9ae1dc7d.ed96d","type":"debug","z":"c9436af2.6cae48","name":"Out","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1070,"y":140,"wires":[]},{"id":"999ffa6d.4f1ba8","type":"inject","z":"c9436af2.6cae48","name":"Turn Off Repeat Mode","topic":"","payload":"RPTRX,0","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":280,"y":120,"wires":[["19af0c78.f520d4"]]},{"id":"19af0c78.f520d4","type":"serial out","z":"c9436af2.6cae48","name":"","serial":"5d6eb2f4.fc698c","x":550,"y":120,"wires":[]},{"id":"2720c1b6.fda16e","type":"debug","z":"c9436af2.6cae48","name":"Message","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":640,"y":140,"wires":[]},{"id":"e680aa9c.793ad8","type":"switch","z":"c9436af2.6cae48","name":"Only Pass Reveived Pages","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"RECV,4,","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":180,"wires":[["f83b7ae6.28ad58","2720c1b6.fda16e"],["d248cd20.c7ef9"]]},{"id":"d248cd20.c7ef9","type":"debug","z":"c9436af2.6cae48","name":"System Message","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":670,"y":220,"wires":[]},{"id":"6b0c8c4d.03ffd4","type":"serial in","z":"e3cbac21.52804","name":"","serial":"5d6eb2f4.fc698c","x":130,"y":200,"wires":[["4b826fa.9bf219","184ea2f9.fe199d"]]},{"id":"4b826fa.9bf219","type":"debug","z":"e3cbac21.52804","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":180,"wires":[]},{"id":"4ec6aeb2.e5b95","type":"serial in","z":"e3cbac21.52804","name":"","serial":"4c9759dc.0c6338","x":110,"y":280,"wires":[["6c73344c.aebf1c","184ea2f9.fe199d"]]},{"id":"6c73344c.aebf1c","type":"debug","z":"e3cbac21.52804","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":300,"wires":[]},{"id":"863ff069.69f21","type":"switch","z":"fa19d7ed.b2f408","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"+CMGL","vt":"str"},{"t":"cont","v":"OK","vt":"str"},{"t":"cont","v":"ERROR","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":290,"y":300,"wires":[["2c3a9cd.4420364"],["feca0699.da1068"],["8ef23e43.7d7d4"]]},{"id":"a8ec5f4b.7c145","type":"delay","z":"fa19d7ed.b2f408","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":820,"y":180,"wires":[["df18c571.fc2e38"]]},{"id":"25dcf46b.a7a2bc","type":"comment","z":"fa19d7ed.b2f408","name":"Get all SMS from SIM","info":"","x":140,"y":480,"wires":[]},{"id":"15999f6d.d87a21","type":"comment","z":"fa19d7ed.b2f408","name":"Responce from SIM","info":"","x":130,"y":180,"wires":[]},{"id":"2c3a9cd.4420364","type":"split","z":"fa19d7ed.b2f408","name":"","splt":"+CMGL:","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":430,"y":260,"wires":[["801dbbc7.6e5578"]]},{"id":"f3fdb755.d4aa08","type":"comment","z":"fa19d7ed.b2f408","name":"Send SMS","info":"","x":100,"y":20,"wires":[]},{"id":"3d87828f.8c3d7e","type":"debug","z":"fa19d7ed.b2f408","name":"Success","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":620,"y":300,"wires":[]},{"id":"feca0699.da1068","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Success","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":300,"wires":[["3d87828f.8c3d7e"]]},{"id":"fd6df88a.627808","type":"debug","z":"fa19d7ed.b2f408","name":"Error","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":610,"y":340,"wires":[]},{"id":"8ef23e43.7d7d4","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Fail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":340,"wires":[["fd6df88a.627808"]]},{"id":"934ea042.fe8bd","type":"change","z":"fa19d7ed.b2f408","name":"Set Payload and Interval Time","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"resend_interval","pt":"msg","to":"sms_lookup_time","tot":"global"},{"t":"set","p":"SMS_Connected","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":600,"wires":[["f84ea7f9.581c78","899e52ee.9e8e9"]]},{"id":"99a20488.fc4998","type":"status","z":"fa19d7ed.b2f408","name":"SMS Connected?","scope":["af57df0f.33c1b"],"x":140,"y":620,"wires":[["7604ee2d.bd7ec"]]},{"id":"7604ee2d.bd7ec","type":"switch","z":"fa19d7ed.b2f408","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"node-red:common.status.connected","vt":"str"},{"t":"eq","v":"node-red:common.status.not-connected","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":620,"wires":[["934ea042.fe8bd"],["b257d0ca.51da3"]]},{"id":"b257d0ca.51da3","type":"change","z":"fa19d7ed.b2f408","name":"Ignore","rules":[{"t":"set","p":"resend_ignore","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"SMS_Connected","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":640,"wires":[["f84ea7f9.581c78"]]},{"id":"2aa5af02.4ddce","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":310,"y":380,"wires":[]},{"id":"45c49526.7d0adc","type":"change","z":"e3cbac21.52804","name":"True","rules":[{"t":"set","p":"TX7470_Connected","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":500,"wires":[[]]},{"id":"2e5d3911.600256","type":"status","z":"e3cbac21.52804","name":"TX7470 Connected?","scope":["6b0c8c4d.03ffd4"],"x":110,"y":520,"wires":[["7b148a21.9f1314"]]},{"id":"7b148a21.9f1314","type":"switch","z":"e3cbac21.52804","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"node-red:common.status.connected","vt":"str"},{"t":"eq","v":"node-red:common.status.not-connected","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":520,"wires":[["45c49526.7d0adc"],["4c495632.b55618"]]},{"id":"4c495632.b55618","type":"change","z":"e3cbac21.52804","name":"False","rules":[{"t":"set","p":"TX7470_Connected","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":540,"wires":[[]]},{"id":"b680f60b.313cd8","type":"change","z":"e3cbac21.52804","name":"True","rules":[{"t":"set","p":"TRX1_Connected","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":580,"wires":[[]]},{"id":"a1824dff.84417","type":"status","z":"e3cbac21.52804","name":"TRX1 Connected?","scope":["4ec6aeb2.e5b95"],"x":110,"y":600,"wires":[["ff66d1d0.c95c4"]]},{"id":"ff66d1d0.c95c4","type":"switch","z":"e3cbac21.52804","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"node-red:common.status.connected","vt":"str"},{"t":"eq","v":"node-red:common.status.not-connected","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":600,"wires":[["b680f60b.313cd8"],["8ae471a8.76a12"]]},{"id":"8ae471a8.76a12","type":"change","z":"e3cbac21.52804","name":"False","rules":[{"t":"set","p":"TRX1_Connected","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":620,"wires":[[]]},{"id":"a004c184.b0aea","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":940,"wires":[]},{"id":"adaf9b5a.787898","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":900,"wires":[["2b63c06f.f2c39"]]},{"id":"6876aacc.537724","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `SMS_Data` ( \t`index`\tINTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, \t`Phone_Number`\tTEXT, \t`Message`\tTEXT, \t`Timestamp`\tINTEGER, \t`T/R`\tINTEGER );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":900,"wires":[["adaf9b5a.787898"]]},{"id":"2b63c06f.f2c39","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":900,"wires":[]},{"id":"7fbff3a0.1eea4c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1060,"wires":[["c4f902a6.e9b84"]]},{"id":"c7eb0126.a6464","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":1060,"wires":[["7fbff3a0.1eea4c"]]},{"id":"70c36b91.bec6f4","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":940,"wires":[["a004c184.b0aea"]]},{"id":"b68e4e03.96702","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":940,"wires":[["70c36b91.bec6f4"]]},{"id":"4116d30f.76144c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":980,"wires":[]},{"id":"c3cce268.e43c9","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":980,"wires":[["4116d30f.76144c"]]},{"id":"5462f3ae.1ca42c","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":980,"wires":[["c3cce268.e43c9"]]},{"id":"c4f902a6.e9b84","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1060,"wires":[]},{"id":"7d35dfdb.df977","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1020,"wires":[]},{"id":"1f6e654e.265b2b","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1020,"wires":[["7d35dfdb.df977"]]},{"id":"5a89ea72.4a39a4","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":980,"y":1020,"wires":[["1f6e654e.265b2b"]]},{"id":"11066a1c.567f96","type":"comment","z":"ba76d305.cf8ad","name":"SMS_Data","info":"","x":1240,"y":860,"wires":[]},{"id":"ca3a05ef.30d808","type":"template","z":"fa19d7ed.b2f408","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `SMS_Data` ('Phone_Number', 'Message', 'Timestamp','T/R') \nVALUES ('{{number}}', '{{message}}', '{{timestamp}}','0');","output":"str","x":1060,"y":260,"wires":[["33af4711.c68a78"]]},{"id":"33af4711.c68a78","type":"sqlite","z":"fa19d7ed.b2f408","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":260,"wires":[[]]},{"id":"ca1175d4.6ab1a8","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["9664022a.04865","6e1139d9.34bc58"]]},{"id":"9664022a.04865","type":"template","z":"fa19d7ed.b2f408","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `SMS_Data` ('Phone_Number', 'Message', 'Timestamp','T/R') \nVALUES ('{{number}}', '{{message}}', '{{timestamp}}','1');","output":"str","x":600,"y":120,"wires":[["1a308fc7.211f"]]},{"id":"1a308fc7.211f","type":"sqlite","z":"fa19d7ed.b2f408","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":770,"y":120,"wires":[[]]},{"id":"6e1139d9.34bc58","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":160,"wires":[]},{"id":"ceaee21f.07fc6","type":"trigger","z":"fa19d7ed.b2f408","op1":"node-red:common.status.not-connected","op2":"node-red:common.status.connected","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"Turn off checking when sending","x":210,"y":580,"wires":[["7604ee2d.bd7ec"]]},{"id":"255c230c.2e7dac","type":"delay","z":"fa19d7ed.b2f408","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":200,"y":80,"wires":[["e5250da9.c3a64","5bf9882c.71b798","ca1175d4.6ab1a8","732d2686.571308"]]},{"id":"2604c8cb.6b0ac8","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":260,"wires":[["ca3a05ef.30d808","aca8dcf3.8cf6","7198dc76.3853d4","7509fa52.c5c934"]]},{"id":"499edad1.a36d34","type":"link in","z":"fa19d7ed.b2f408","name":"","links":["5bf9882c.71b798"],"x":55,"y":580,"wires":[["ceaee21f.07fc6"]]},{"id":"5bf9882c.71b798","type":"link out","z":"fa19d7ed.b2f408","name":"","links":["499edad1.a36d34"],"x":335,"y":40,"wires":[]},{"id":"32964d32.499912","type":"link in","z":"fa19d7ed.b2f408","name":"Send SMS","links":["6d4a28f4.10c778","33dac2b0.5dab4e","923b563a.662528"],"x":75,"y":80,"wires":[["255c230c.2e7dac"]]},{"id":"fdf7239e.58395","type":"websocket out","z":"fa19d7ed.b2f408","name":"","server":"4f629706.3fbcb8","client":"","x":1170,"y":220,"wires":[]},{"id":"aca8dcf3.8cf6","type":"switch","z":"fa19d7ed.b2f408","name":"","property":"beep","propertyType":"global","rules":[{"t":"neq","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1030,"y":220,"wires":[["fdf7239e.58395"]]},{"id":"aa2010b0.68176","type":"exec","z":"b7fc24bc.f191b8","command":"cat /etc/dhcpcd.conf","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"","x":476,"y":179,"wires":[["ea575dda.0bc82"],[],[]]},{"id":"ea575dda.0bc82","type":"function","z":"b7fc24bc.f191b8","name":"parse response","func":"var lines = msg.payload.split(\"\\n\");\nvar data = [];\n\nfor(var i=0; i< lines.length; i++){\n if(lines[i].indexOf(\"interface eth0\") != -1)\n break;\n}\n\n//check if interface eth0 is disabled\nif(i < lines.length && lines[i].indexOf(\"#\") >= 0) flow.set('disabled', true);\nelse flow.set('disabled', false);\n\nnode.send({topic:'interface eth0', payload:flow.get('disabled')})\n\ni++;\n\nfor(i; i< lines.length; i++){\n \n //new interface, not eth0\n if(lines[i].indexOf(\"static\") == -1)\n break;\n \n var tmp = lines[i].split(\"=\");\n if(tmp.length==2){\n var prop = tmp[0].split(' ')[1].trim();\n var value = tmp[1].trim();\n \n flow.set(prop, value);\n node.send({topic:prop, payload:value})\n }\n} ","outputs":1,"noerr":0,"x":716,"y":166,"wires":[["e8b089e.ea40d78"]]},{"id":"e8b089e.ea40d78","type":"switch","z":"b7fc24bc.f191b8","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"ip_address","vt":"str"},{"t":"eq","v":"routers","vt":"str"},{"t":"eq","v":"domain_name_servers","vt":"str"},{"t":"eq","v":"interface eth0","vt":"str"}],"checkall":"false","repair":false,"outputs":4,"x":888,"y":166,"wires":[["d7f06666.809228"],["a03176f2.f4b788"],["db26e759.f47118","9ac4a2fd.1d59a"],["ac474f12.f6559"]]},{"id":"d7f06666.809228","type":"ui_text_input","z":"b7fc24bc.f191b8","name":"ip_address","label":"Indirizzo IP","group":"5ea533e5.c35b8c","order":2,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"ip_address","x":1130,"y":120,"wires":[["9a91c24e.5286"]]},{"id":"a03176f2.f4b788","type":"ui_text_input","z":"b7fc24bc.f191b8","name":"router","label":"Router","group":"5ea533e5.c35b8c","order":3,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"routers","x":1109,"y":163,"wires":[["9a91c24e.5286"]]},{"id":"db26e759.f47118","type":"ui_text_input","z":"b7fc24bc.f191b8","name":"dns","label":"DNS","group":"5ea533e5.c35b8c","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"domain_name_servers","x":1109,"y":206,"wires":[["9a91c24e.5286"]]},{"id":"8f588de9.0eeb6","type":"exec","z":"b7fc24bc.f191b8","command":"sudo sed -i ","addpay":true,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"","x":510,"y":320,"wires":[[],[],[]]},{"id":"9571d782.89bc78","type":"ui_button","z":"b7fc24bc.f191b8","name":"reboot","group":"5ea533e5.c35b8c","order":5,"width":"3","height":"1","passthru":false,"label":"Reboot","color":"","bgcolor":"","icon":"","payload":"By pressing OK the device will be rebooted. If settings are wrong this may cause the device to be unreachable","payloadType":"str","topic":"","x":170,"y":480,"wires":[["b2e0ad3.39d6a5"]]},{"id":"c9d44da8.3061a","type":"exec","z":"b7fc24bc.f191b8","command":"sudo reboot","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":650,"y":480,"wires":[[],[],[]]},{"id":"e4a06170.270a","type":"ui_button","z":"b7fc24bc.f191b8","name":"refresh","group":"5ea533e5.c35b8c","order":6,"width":"3","height":"1","passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":111.44442749023438,"y":247.33291149139404,"wires":[["6c65ec82.b747b4","e69550e.4acfab"]]},{"id":"6c65ec82.b747b4","type":"delay","z":"b7fc24bc.f191b8","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":278.8888740539551,"y":247.44451141357422,"wires":[["aa2010b0.68176"]]},{"id":"e69550e.4acfab","type":"function","z":"b7fc24bc.f191b8","name":"send commands","func":"var properties = flow.get(\"properties\");\n\nvar disabled = flow.get(\"disabled\") ? '#' : '';\n\nif(disabled == '#'){\n //enable interface (replace only first occurance)\n var command = `'0,/#interface eth0/s//interface eth0/g;' /etc/dhcpcd.conf`;\n node.send({payload: command})\n}\n\nfor(var i=0;i\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n IP: {{global.ip}}
\n Serial: {{global.serial}}
\n Software Version: {{global.sw}}
\n Hardware Version: {{global.hw}}
\n Firmware Version: {{global.fw}}\n
\n \n
\n\n
\n

\n Set Aliases\n

\n

\nSet Quick Page\n

\n

\nSystem Settings\n
\n

\n

\nFlash Pattern Effects\n

\n

\nSMS Settings\n

\n\n\n
\n\n\n\n","output":"str","x":830,"y":140,"wires":[["e4466f0c.3d898"]]},{"id":"7f164aa2.d87fc4","type":"debug","z":"ce69645.1231098","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"req.cookies.god","x":860,"y":60,"wires":[]},{"id":"11b95135.e0704f","type":"debug","z":"ce69645.1231098","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"req.cookies.god","x":860,"y":180,"wires":[]},{"id":"72e29c18.6e9a54","type":"http response","z":"60528a1b.f32364","name":"","statusCode":"","headers":{},"x":790,"y":1220,"wires":[]},{"id":"f34c1b96.9c29d8","type":"change","z":"60528a1b.f32364","name":"Redirect to home page","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"home","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":1220,"wires":[["72e29c18.6e9a54","c2dc79e8.268df8"]]},{"id":"3bd78579.1468da","type":"http in","z":"60528a1b.f32364","name":"","url":"/home","method":"get","upload":false,"swaggerDoc":"","x":420,"y":1240,"wires":[["f34c1b96.9c29d8"]]},{"id":"fe0baef7.4d2b3","type":"http in","z":"60528a1b.f32364","name":"","url":"/","method":"get","upload":false,"swaggerDoc":"","x":430,"y":1200,"wires":[["f34c1b96.9c29d8"]]},{"id":"62ba8a0a.97b414","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":880,"y":560,"wires":[]},{"id":"ada0b574.ec19e8","type":"inject","z":"dad6f0f1.28177","name":"Send Page","topic":"","payload":"PAGE,911,0,Test Page","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":560,"y":460,"wires":[["734abd62.6c0054"]]},{"id":"640af3ab.6b161c","type":"serial in","z":"dad6f0f1.28177","name":"","serial":"5d6eb2f4.fc698c","x":790,"y":320,"wires":[["7388cd86.eb4434"]]},{"id":"7388cd86.eb4434","type":"debug","z":"dad6f0f1.28177","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":970,"y":320,"wires":[]},{"id":"acdf8298.10574","type":"debug","z":"9939c833.99b318","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1310,"y":420,"wires":[]},{"id":"7198dc76.3853d4","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":340,"wires":[]},{"id":"4325240c.074bfc","type":"function","z":"6824b2bf.b1e0fc","name":"Set Text Mode","func":"msg.payload=\"AT+CMGF=1\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":120,"wires":[["a78f118b.a95b6"]]},{"id":"b1c6a3b8.dcb17","type":"function","z":"6824b2bf.b1e0fc","name":"Set Text Parameters","func":"msg.payload = \"AT+CSMP=17,167,0,0\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":280,"wires":[["ea809a63.fb9388"]]},{"id":"390e5598.a2489a","type":"function","z":"6824b2bf.b1e0fc","name":"Set Telephone Number","func":"msg.payload=\"AT+CMGS=\\\"\" + msg.number +\"\\\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":360,"wires":[["53d43211.3b0b9c"]]},{"id":"e1763ed3.9ba2e","type":"function","z":"6824b2bf.b1e0fc","name":"Set Message Content","func":"msg.payload= msg.message +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":440,"wires":[["88a7cffa.94d8e"]]},{"id":"7dee774b.aef198","type":"function","z":"6824b2bf.b1e0fc","name":"Send Message","func":"msg.payload=\"\\x1A\";\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":520,"wires":[[]]},{"id":"267d0776.a38468","type":"function","z":"6824b2bf.b1e0fc","name":"Set Message Format","func":"msg.payload=\"AT+CSCS=\\\"GSM\\\"\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":200,"wires":[["b21ea1fe.6ffad"]]},{"id":"53d43211.3b0b9c","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":400,"wires":[["e1763ed3.9ba2e"]]},{"id":"88a7cffa.94d8e","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":480,"wires":[["7dee774b.aef198"]]},{"id":"ea809a63.fb9388","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":320,"wires":[["390e5598.a2489a"]]},{"id":"a78f118b.a95b6","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":160,"wires":[["267d0776.a38468"]]},{"id":"b21ea1fe.6ffad","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":240,"wires":[["b1c6a3b8.dcb17"]]},{"id":"899e52ee.9e8e9","type":"subflow:6824b2bf.b1e0fc","z":"fa19d7ed.b2f408","name":"","x":700,"y":560,"wires":[["62ba8a0a.97b414"]]},{"id":"7509fa52.c5c934","type":"function","z":"fa19d7ed.b2f408","name":"Split Message into pager id","func":"var result = /(\\d*),(.*)/;\nvar i = result.exec(msg.message || \"\");\n\nif (i !== null) {\n \nvar pager_number = i[1];\nvar message = i[2];\nvar sysID = global.get(\"sysID\");\nvar content = message;\nvar sendmessage = content.replace(/\\n/g, \" \");\nvar page = \"PAGE,\"+ pager_number + \",\"+ sysID + \",\" + sendmessage + \"\\n\";\nmsg.payload = page\nreturn msg;\n\n} else if (i === null) {\n \nvar sysID = global.get(\"sysID\");\nvar pager_number = global.get(\"default_number\");\nvar content = msg.message;\nvar sendmessage = content.replace(/\\n/g, \" \");\nvar page = \"PAGE,\"+ pager_number + \",\"+ sysID + \",\" + sendmessage + \"\\n\";\nmsg.payload = page\nreturn msg;\n\n} else {\n\t// Do nothing\n\treturn\n}","outputs":1,"noerr":0,"x":1100,"y":300,"wires":[["2d371436.d022bc","a868d008.fa7e2"]]},{"id":"2d371436.d022bc","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1290,"y":340,"wires":[]},{"id":"a868d008.fa7e2","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"5d6eb2f4.fc698c","x":1350,"y":300,"wires":[]},{"id":"61153a35.ede424","type":"comment","z":"7c3dbf78.7885c","name":"Build Webpage","info":"","x":100,"y":60,"wires":[]},{"id":"85e26070.df94c","type":"http response","z":"7c3dbf78.7885c","name":"","statusCode":"201","headers":{},"x":700,"y":80,"wires":[]},{"id":"8433a4c2.04e608","type":"template","z":"7c3dbf78.7885c","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n
\n\n\n\n\n\n\n","output":"str","x":570,"y":80,"wires":[["85e26070.df94c"]]},{"id":"d7a059ad.0b9b48","type":"change","z":"7c3dbf78.7885c","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall SMS Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":80,"wires":[["29b1aaf5.1b4b16"]]},{"id":"29b1aaf5.1b4b16","type":"template","z":"7c3dbf78.7885c","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var one = new WebSocket('ws://' + location.host + '/sms/receive/one');\nvar two = new WebSocket('ws://' + location.host + '/sms/receive/two');\nvar send = new WebSocket('ws://' + location.host + '/sms/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n// Change Two\ntwo.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"two\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n function load(){\n startTime();\n\n\n }\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n\n}\n","output":"str","x":450,"y":80,"wires":[["8433a4c2.04e608"]]},{"id":"e5058c36.42fb4","type":"comment","z":"7c3dbf78.7885c","name":"Handle Input from Webpage","info":"","x":140,"y":320,"wires":[]},{"id":"7a6d676e.37e228","type":"switch","z":"7c3dbf78.7885c","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":100,"wires":[["d7a059ad.0b9b48"],["6b3ad3e9.39b35c"]]},{"id":"6b3ad3e9.39b35c","type":"link out","z":"7c3dbf78.7885c","name":"back to settings","links":["4212ad6a.fb9f04"],"x":295,"y":120,"wires":[]},{"id":"1d28a554.3505fb","type":"http in","z":"7c3dbf78.7885c","name":"","url":"/sms","method":"post","upload":false,"swaggerDoc":"","x":100,"y":380,"wires":[["16af324f.f2797e","4ce292ed.5069bc","18cea72.5a5c159"]]},{"id":"2c031bdd.f5c594","type":"http response","z":"7c3dbf78.7885c","name":"","statusCode":"201","headers":{},"x":460,"y":460,"wires":[]},{"id":"16af324f.f2797e","type":"change","z":"7c3dbf78.7885c","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/sms","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":460,"wires":[["2c031bdd.f5c594"]]},{"id":"4ce292ed.5069bc","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.default_number","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":420,"wires":[["4ba68824.8a64d8"]]},{"id":"4ba68824.8a64d8","type":"change","z":"7c3dbf78.7885c","name":"","rules":[{"t":"set","p":"default_number","pt":"global","to":"payload.default_number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":420,"wires":[["a4395bb2.c65928"]]},{"id":"a4395bb2.c65928","type":"template","z":"7c3dbf78.7885c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET default_pager_number = '{{{payload.default_number}}}'\nWHERE ID = 1;","output":"str","x":700,"y":420,"wires":[["ce517527.bac3d8"]]},{"id":"ce517527.bac3d8","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":850,"y":420,"wires":[[]]},{"id":"653e063a.3aec78","type":"comment","z":"7c3dbf78.7885c","name":"Default Pager number","info":"","x":1040,"y":420,"wires":[]},{"id":"18cea72.5a5c159","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.sms_lookup_time","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":380,"wires":[["31f2d325.050f6c"]]},{"id":"4ba109b0.fd2d88","type":"template","z":"7c3dbf78.7885c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET sms_lookup_time = '{{payload.sms_lookup_time}}'\nWHERE ID = 1;","output":"str","x":700,"y":380,"wires":[["ea1a7c67.7b8e7"]]},{"id":"ea1a7c67.7b8e7","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":850,"y":380,"wires":[[]]},{"id":"63a65584.d73b0c","type":"comment","z":"7c3dbf78.7885c","name":"SMS Lookup Time","info":"","x":1030,"y":380,"wires":[]},{"id":"31f2d325.050f6c","type":"change","z":"7c3dbf78.7885c","name":"","rules":[{"t":"set","p":"sms_lookup_time","pt":"global","to":"payload.sms_lookup_time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":380,"wires":[["4ba109b0.fd2d88","5e7e5469.97945c"]]},{"id":"76ba6a52.373a64","type":"http in","z":"7c3dbf78.7885c","name":"","url":"/sms","method":"get","upload":false,"swaggerDoc":"","x":80,"y":100,"wires":[["7a6d676e.37e228"]]},{"id":"b1067c5c.09a0c","type":"comment","z":"7c3dbf78.7885c","name":"Put Data On the Webpage","info":"","x":130,"y":200,"wires":[]},{"id":"a0bd7cdf.afd92","type":"template","z":"7c3dbf78.7885c","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Pager to SMS Forwarding

\n \n
\n\n\n\n
\n\n
\n\n

\n \n\n \n

\n\n\n
\n\n

\n\n
\n\n
\n
Pager Number
\n
Phone Number
\n
\n{{#payload}}\n
\n
{{{pager}}}
\n
{{phone}}
\n
\n{{/payload}}\n","output":"str","x":830,"y":200,"wires":[["465a969d.0dd9c8"]]},{"id":"ae7ac240.608dd","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":250,"y":240,"wires":[["5d1c0e52.6b587","570f7ba7.4b96d4"]]},{"id":"5d1c0e52.6b587","type":"template","z":"7c3dbf78.7885c","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

SMS Receive Settings

\n\n
\nDefault Pager Number:
\n
\n
\n\n
\nSMS Poll Time (s):
\n
\n
","output":"str","x":830,"y":240,"wires":[["62d955f6.7b5f0c"]]},{"id":"eaa3275.c3cf8d8","type":"websocket in","z":"7c3dbf78.7885c","name":"","server":"dc2bb776.c508d8","client":"","x":100,"y":240,"wires":[["ae7ac240.608dd"]]},{"id":"465a969d.0dd9c8","type":"websocket out","z":"7c3dbf78.7885c","name":"","server":"97aed89c.6c8d08","client":"","x":1040,"y":200,"wires":[]},{"id":"62d955f6.7b5f0c","type":"websocket out","z":"7c3dbf78.7885c","name":"","server":"2ca8999c.456256","client":"","x":1040,"y":240,"wires":[]},{"id":"3b096d12.16f5d2","type":"change","z":"fa19d7ed.b2f408","name":"Set Payload and Interval Time","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"resend_interval","pt":"msg","to":"sms_lookup_time","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":680,"wires":[["f84ea7f9.581c78"]]},{"id":"b2829d55.caa52","type":"http in","z":"7c3dbf78.7885c","name":"","url":"/sms/forwarding","method":"post","upload":false,"swaggerDoc":"","x":120,"y":500,"wires":[["1253669b.8fe3e9","16af324f.f2797e","ec773d8b.beb5c"]]},{"id":"2adb401.a7bcfc","type":"link in","z":"fa19d7ed.b2f408","name":"poll time","links":["5e7e5469.97945c"],"x":315,"y":680,"wires":[["3b096d12.16f5d2"]]},{"id":"5e7e5469.97945c","type":"link out","z":"7c3dbf78.7885c","name":"","links":["2adb401.a7bcfc"],"x":655,"y":340,"wires":[]},{"id":"b448c422.472058","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1220,"wires":[]},{"id":"7f122458.818f2c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1180,"wires":[["a6003182.d8e39"]]},{"id":"182d57a7.d77778","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `pager_sms_forwarding` ( `index` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `pager` TEXT, `phone` TEXT )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":1180,"wires":[["7f122458.818f2c"]]},{"id":"a6003182.d8e39","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":1180,"wires":[]},{"id":"9e209a40.7d2618","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1220,"wires":[["b448c422.472058"]]},{"id":"8f630b6e.f81628","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'pager_sms_forwarding';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":1220,"wires":[["9e209a40.7d2618"]]},{"id":"b94c24.f4f1c3e","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1260,"wires":[]},{"id":"9c776827.be5998","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1260,"wires":[["b94c24.f4f1c3e"]]},{"id":"2835ab6a.cf4ca4","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'pager_sms_forwarding';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":1260,"wires":[["9c776827.be5998"]]},{"id":"d881dcd9.ae099","type":"comment","z":"ba76d305.cf8ad","name":"pager_sms_forwarding","info":"","x":1280,"y":1140,"wires":[]},{"id":"570f7ba7.4b96d4","type":"template","z":"7c3dbf78.7885c","name":"Select Callpoint Alias Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `pager_sms_forwarding`\nORDER BY `pager` ASC;\n","output":"str","x":460,"y":200,"wires":[["ac2b59b0.529ad8"]]},{"id":"ac2b59b0.529ad8","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":670,"y":200,"wires":[["a0bd7cdf.afd92"]]},{"id":"ec773d8b.beb5c","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.remove","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":540,"wires":[["c88c406a.ce661"]]},{"id":"c88c406a.ce661","type":"template","z":"7c3dbf78.7885c","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `pager_sms_forwarding`\nWHERE `pager`=\"{{{payload.remove}}}\";","output":"str","x":470,"y":540,"wires":[["5a354afc.5cf994"]]},{"id":"5a354afc.5cf994","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":540,"wires":[[]]},{"id":"d6fedd86.cb761","type":"template","z":"7c3dbf78.7885c","name":"Add to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `pager_sms_forwarding` ('pager', 'phone') VALUES ('{{{payload.pager}}}', '{{payload.phone}}');","output":"str","x":570,"y":500,"wires":[["89fc8f18.2c7cb"]]},{"id":"89fc8f18.2c7cb","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":500,"wires":[[]]},{"id":"1253669b.8fe3e9","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":500,"wires":[["78ace295.3d663c"]]},{"id":"78ace295.3d663c","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.phone","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":500,"wires":[["d6fedd86.cb761"],[]]},{"id":"923b563a.662528","type":"link out","z":"fa19d7ed.b2f408","name":"","links":["32964d32.499912"],"x":1075,"y":880,"wires":[]},{"id":"b5632527.ba5468","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"message","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":880,"wires":[["923b563a.662528"]]},{"id":"694e32c7.35392c","type":"comment","z":"fa19d7ed.b2f408","name":"Forward Page to SMS","info":"","x":160,"y":820,"wires":[]},{"id":"65839b56.756164","type":"link in","z":"fa19d7ed.b2f408","name":"","links":["c94a9d48.9c2c"],"x":120,"y":880,"wires":[["d0bf954e.3c7a78"]]},{"id":"7977ea89.64b574","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":630,"y":780,"wires":[]},{"id":"d0bf954e.3c7a78","type":"template","z":"fa19d7ed.b2f408","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT `phone`\nFROM `pager_sms_forwarding`\nWHERE `pager` = '{{pagerNumber}}'\n","output":"str","x":270,"y":880,"wires":[["c8362e7f.26036"]]},{"id":"c8362e7f.26036","type":"sqlite","z":"fa19d7ed.b2f408","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":450,"y":880,"wires":[["7977ea89.64b574","e65768a.55d9298"]]},{"id":"e6ee05cd.0b1b08","type":"template","z":"fa19d7ed.b2f408","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{part1}} {{part2}} {{sender}}","output":"str","x":780,"y":880,"wires":[["b5632527.ba5468"]]},{"id":"732d2686.571308","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":180,"wires":[]},{"id":"e65768a.55d9298","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"number","pt":"msg","to":"payload[0].phone","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":880,"wires":[["e6ee05cd.0b1b08"]]},{"id":"f2b86262.fdc9c","type":"deduplicate","z":"e3cbac21.52804","name":"","keyproperty":"","expiry":"20","x":850,"y":240,"wires":[["e8a93519.478388","9301bc45.dca2a"],["96f0724f.dc67"]]},{"id":"f83b7ae6.28ad58","type":"deduplicate","z":"c9436af2.6cae48","name":"","keyproperty":"","expiry":"30","x":650,"y":180,"wires":[["e5b11a3e.8893c8"],[]]},{"id":"f84ea7f9.581c78","type":"msg-resend","z":"fa19d7ed.b2f408","interval":"30","intervalUnit":"secs","maximum":"0","bytopic":false,"clone":false,"firstDelayed":true,"addCounters":false,"highRate":false,"outputCountField":"","outputMaxField":"","name":"","x":710,"y":640,"wires":[["6d4f4c3c.35d1e4"]]},{"id":"311030ac.d9f2b","type":"debug","z":"b8bd1cc3.4827","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":260,"wires":[]},{"id":"1bba0705.d72259","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"home","pt":"global","to":"payload[0].home","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":680,"wires":[[]]},{"id":"fcaddc98.cb117","type":"comment","z":"60528a1b.f32364","name":"Set home","info":"","x":760,"y":680,"wires":[]},{"id":"ee5d6812.a72308","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `home` FROM `settings`;","name":"CaptureCall","x":430,"y":680,"wires":[["1bba0705.d72259"]]},{"id":"c2dc79e8.268df8","type":"debug","z":"60528a1b.f32364","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":790,"y":1180,"wires":[]}] \ No newline at end of file +[{"id":"60528a1b.f32364","type":"tab","label":"Startup *","disabled":false,"info":"Used to setup system variables. \r\n\r\nThe main bulk of the flow is activated on boot\r\n\r\n* Set IP Address- Gets the system IP address, adds it to global.ip and also sets /ip in the json DB\r\n* Set system ID - Gets system ID from json DB and sets global.sysID - This is used to filter messages\r\n* Set Email Address - Gets last email from json DB and sets global.to\r\n* Add Power on Message to DB - Writes to DB when system Powers on\r\n* Set Serial Number - Gets Serial from json DB and sets global.serial\r\n* Set Software Version - Gets S/W Version from json DB and sets global.sw\r\n* Set Hardware Version - Gets H/W Version from json DB and sets global.hw\r\n* Set Firmware Version - Gets F/W Version from json DB and sets global.fw\r\n* Set Password - Gets system Password from json DB and sets global.password\r\n* Set Left Header Links - Gets json List of modules for main pages from json DB and sets global.left. Used to set contents list on main pages\r\n* Set Settings Links - Gets json List of settings pages for settings pages from json DB and sets global.setings_list. Used to set contents list on settings pages\r\n* Set sort by - Sets default sort coloum to \"index\" on boot\r\n* Set sort direction - Sets default sort direction to \"ASC\" on boot\r\n\r\nAlso on this Flow is the webpage that is served if a user tries to access a page they are not licenced for. this can be triggered from any page by a link node.\r\n\r\nFinally there is a collection of default data nodes. These add the injected data into the json DB. They only need to be ran once to populate the json DB\r\n\r\n* /sw,/hw,/fw - Used to set the versions shown on the settings pages\r\n* sysID - Used to set the system ID Filter\r\n* Modules - contains a JSON string used to set the Links to main pages and their displayed Names\r\n* Serial - Used to set the system serial number\r\n* Password - Used to set the default system password - 1234 at this time\r\n* Settings - contains a JSON string used to set the Links to settings pages and their displayed Names"},{"id":"e3cbac21.52804","type":"tab","label":"Receive Page & Add to DB Regex","disabled":false,"info":"This Flow does the following\r\n1. Recvied the page either from \r\n * LRS TX-7470-C232 (RS232 Node needed before. Switch node recommended to filter out startup messages and send confirmations)\r\n * RX1\r\nthis is currently changed by changing the nodes\r\n2. Checks msg.sysID matched global.sysID\r\n3. Forms SQL query to add page to DB\r\n4. Checks if msg.Status = Attended\r\n * If True changes status in DB from active to Handled Also updates late messages to handled\r\n * If False Outputs to other Flows.\r\n\r\nAlso on this flow are some example pager messages that can be injected manually.** to be removed in final version!**"},{"id":"23c43518.b3ff0a","type":"tab","label":"Pager Dynamic Display","disabled":false,"info":"When /display or / is accessed this flow builds a webpage by setting the page title, injecting the JS and HTML.\r\nEvery Second the inject node fires which queries the DB for all data with a status of Active or Late. This Data is phrased to work out the Display style and t oconvert the TS to local time. THis is then built into HTML code using Mustache to loop through the Data. Once completethis HTML Data is pushed to the webpage via a Websocket.\r\n\r\nWhen the user clicks on one of the lines of data, its Index is sent via websocket, This is tested to see if its not 'Open' (Sent by the webpage onload to refresh data) The status of the record matching the index is updated to manaully handled in the DB.\r\n\r\nWhen a new page is added to the DB the Link node is triggered to play a noise using the websocket"},{"id":"b8bd1cc3.4827","type":"tab","label":"First Aid Display","disabled":false,"info":""},{"id":"a6d65e53.c700b","type":"tab","label":"Conference Room","disabled":false,"info":""},{"id":"d0e2bfbf.dfe3f","type":"tab","label":"Table Display","disabled":false,"info":""},{"id":"9939c833.99b318","type":"tab","label":"Split Screen","disabled":false,"info":"When /display or / is accessed this flow builds a webpage by setting the page title, injecting the JS and HTML.\r\nEvery Second the inject node fires which queries the DB for all data with a status of Active or Late. This Data is phrased to work out the Display style and t oconvert the TS to local time. THis is then built into HTML code using Mustache to loop through the Data. Once completethis HTML Data is pushed to the webpage via a Websocket.\r\n\r\nWhen the user clicks on one of the lines of data, its Index is sent via websocket, This is tested to see if its not 'Open' (Sent by the webpage onload to refresh data) The status of the record matching the index is updated to manaully handled in the DB.\r\n\r\nWhen a new page is added to the DB the Link node is triggered to play a noise using the websocket"},{"id":"4ff720ae.e74bd","type":"tab","label":"Big Display","disabled":false,"info":""},{"id":"c8c5b763.cd1498","type":"tab","label":"Location Split","disabled":false,"info":""},{"id":"5f1f2b21.5baa74","type":"tab","label":"Browser Paging","disabled":false,"info":""},{"id":"b209c94d.26d798","type":"tab","label":"Log Display Daily","disabled":false,"info":""},{"id":"1c96dbb1.1bc354","type":"tab","label":"Log Display Full","disabled":false,"info":""},{"id":"53e35596.381c0c","type":"tab","label":"Quick Page","disabled":false,"info":""},{"id":"da0e8c29.a0583","type":"tab","label":"Free Page","disabled":false,"info":""},{"id":"b00e2d77.a9931","type":"tab","label":"Export","disabled":false,"info":""},{"id":"38ad3d43.e07282","type":"tab","label":"Login","disabled":false,"info":""},{"id":"ce69645.1231098","type":"tab","label":"Settings Menu","disabled":false,"info":""},{"id":"aefd70ef.7eada","type":"tab","label":"Set Alias","disabled":false,"info":""},{"id":"53762a60.6160b4","type":"tab","label":"Set Quick Page","disabled":false,"info":""},{"id":"d0562e73.de681","type":"tab","label":"Set Flash Pattern Effects","disabled":false,"info":""},{"id":"69336e92.97cdb","type":"tab","label":"System Settings","disabled":false,"info":""},{"id":"7c3dbf78.7885c","type":"tab","label":"SMS Settings","disabled":false,"info":""},{"id":"3c78672c.9cb1f8","type":"tab","label":"Engineer Settings","disabled":false,"info":""},{"id":"ba76d305.cf8ad","type":"tab","label":"DB Utilities","disabled":false,"info":""},{"id":"dad6f0f1.28177","type":"tab","label":"TX-7470-232 Controls","disabled":false,"info":""},{"id":"fa19d7ed.b2f408","type":"tab","label":"SMS RX and TX","disabled":false,"info":""},{"id":"643aaaf4.e44594","type":"tab","label":"Flow 1","disabled":true,"info":""},{"id":"c9436af2.6cae48","type":"tab","label":"Smart Repeater","disabled":true,"info":""},{"id":"b7fc24bc.f191b8","type":"tab","label":"IP Settings","disabled":true,"info":""},{"id":"ca9def01.26ba2","type":"subflow","name":"Send Page","info":"","in":[{"x":220,"y":160,"wires":[{"id":"d19364d9.208968"},{"id":"d51608e.09159f8"},{"id":"33ff1e8e.291482"},{"id":"fb44d9db.726018"}]}],"out":[]},{"id":"8f4a2a74.1d74a8","type":"subflow","name":"Receive Page LRS","info":"","category":"input","in":[{"x":60,"y":40,"wires":[{"id":"32b7704c.e1af"},{"id":"305e69b.97a0f96"}]}],"out":[{"x":1160,"y":120,"wires":[{"id":"349d8d25.ff88c2","port":0}]}]},{"id":"e61361fa.da19a","type":"subflow","name":"Send SMS","info":"","category":"","in":[{"x":360,"y":80,"wires":[{"id":"10de6977.bb8d37"}]}],"out":[{"x":640,"y":480,"wires":[{"id":"10de6977.bb8d37","port":0},{"id":"c0ac4507.b28cb8","port":0},{"id":"69592b7b.5ce814","port":0},{"id":"a0e3fbb3.2826c8","port":0},{"id":"220aa1d8.3e212e","port":0},{"id":"611f59c8.8b6658","port":0}]}]},{"id":"6824b2bf.b1e0fc","type":"subflow","name":"INIT SMS","info":"","category":"","in":[{"x":400,"y":120,"wires":[{"id":"4325240c.074bfc"}]}],"out":[{"x":780,"y":260,"wires":[{"id":"4325240c.074bfc","port":0},{"id":"267d0776.a38468","port":0},{"id":"b1c6a3b8.dcb17","port":0}]}]},{"id":"8ad92631.0da208","type":"websocket-listener","z":"","path":"/log-full/send","wholemsg":"true"},{"id":"c0402614.f01608","type":"websocket-listener","z":"","path":"/log-daily/receive","wholemsg":"true"},{"id":"32989c5a.d6ee14","type":"websocket-listener","z":"","path":"/log-full/receive","wholemsg":"true"},{"id":"fd38eee5.8bd8a","type":"sqlitedb","z":"","db":"./CaptureCall.db","mode":"RWC"},{"id":"e1c85b2c.abed18","type":"json-db-collection","z":"","name":"","collection":"settings","save":true},{"id":"d9d1357a.d4f118","type":"websocket-listener","z":"","path":"/display/receive","wholemsg":"true"},{"id":"95962f80.19ef3","type":"websocket-listener","z":"","path":"/display/send","wholemsg":"false"},{"id":"c7526c07.3fd51","type":"websocket-listener","z":"","path":"/log-daily/send","wholemsg":"true"},{"id":"c78d8a51.8b8ed8","type":"websocket-listener","z":"","path":"/export/send","wholemsg":"true"},{"id":"b7dfd67b.7d7948","type":"websocket-listener","z":"","path":"/export/receive","wholemsg":"true"},{"id":"18f900b5.35f87f","type":"websocket-listener","z":"","path":"/alert/global/prompt","wholemsg":"true"},{"id":"4d6db4a9.f35a1c","type":"websocket-listener","z":"","path":"/table/receive","wholemsg":"true"},{"id":"c2e44b88.6a4e78","type":"websocket-listener","z":"","path":"/table/send","wholemsg":"false"},{"id":"5d6eb2f4.fc698c","type":"serial-port","z":"","serialport":"/dev/ttyUSB-USBSERIAL","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"0x0D","bin":"false","out":"char","addchar":true,"responsetimeout":"10000"},{"id":"5e6c9ab1.74ef04","type":"websocket-listener","z":"","path":"/firstaid/receive","wholemsg":"true"},{"id":"addfeab3.3935e8","type":"websocket-listener","z":"","path":"/firstaid/send","wholemsg":"false"},{"id":"b03253f0.29251","type":"websocket-listener","z":"","path":"/quickpage/receive","wholemsg":"true"},{"id":"25343a6d.90cb36","type":"websocket-listener","z":"","path":"/quickpage/send","wholemsg":"false"},{"id":"d7115ac0.1e2888","type":"websocket-listener","z":"","path":"/login/send","wholemsg":"false"},{"id":"f92c2145.f46df","type":"websocket-listener","z":"","path":"/login/receive","wholemsg":"true"},{"id":"4f629706.3fbcb8","type":"websocket-listener","z":"","path":"/beep","wholemsg":"true"},{"id":"a0127eb8.b242b","type":"websocket-listener","z":"","path":"/setFP/send","wholemsg":"false"},{"id":"4f808f22.bd9c5","type":"websocket-listener","z":"","path":"/setFP/receive","wholemsg":"true"},{"id":"a08ab62d.cf01f8","type":"websocket-listener","z":"","path":"/split-screen/receive/one","wholemsg":"true"},{"id":"2dd9c4a8.1fbccc","type":"websocket-listener","z":"","path":"/split-screen/receive/two","wholemsg":"true"},{"id":"1bd09651.1c7e5a","type":"websocket-listener","z":"","path":"/split-screen/send","wholemsg":"false"},{"id":"a446718.a7f529","type":"websocket-listener","z":"","path":"/alias/receive/one","wholemsg":"true"},{"id":"f2da83eb.80921","type":"websocket-listener","z":"","path":"/alias/receive/two","wholemsg":"true"},{"id":"7d649c17.1d11a4","type":"websocket-listener","z":"","path":"/setQP/receive","wholemsg":"true"},{"id":"c91ee09b.1a258","type":"websocket-listener","z":"","path":"/setQP/send","wholemsg":"false"},{"id":"a0966341.283ff","type":"websocket-listener","z":"","path":"/system/send","wholemsg":"false"},{"id":"91b7d145.fc4e5","type":"websocket-listener","z":"","path":"/alert/global","wholemsg":"false"},{"id":"cc73b91d.aaa738","type":"websocket-listener","z":"","path":"/alias/send","wholemsg":"false"},{"id":"1a6bd275.73c88e","type":"websocket-listener","z":"","path":"/split-screen/receive","wholemsg":"true"},{"id":"e69cdd08.ba509","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"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"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":"4586ec4f.d85214","type":"websocket-listener","z":"","path":"/alert/export","wholemsg":"false"},{"id":"52036df9.0cfb64","type":"websocket-listener","z":"","path":"/alert/system/prompt","wholemsg":"false"},{"id":"15d62cbe.d62773","type":"websocket-listener","z":"","path":"/bar/receive","wholemsg":"true"},{"id":"7b602086.fa4f5","type":"websocket-listener","z":"","path":"/bar/send","wholemsg":"false"},{"id":"c2dca4df.1b2b98","type":"websocket-listener","z":"","path":"/conference/receive","wholemsg":"true"},{"id":"1a6d181c.211418","type":"websocket-listener","z":"","path":"/conference/send","wholemsg":"false"},{"id":"a6feaa7b.4b5558","type":"websocket-listener","z":"","path":"/location/send","wholemsg":"false"},{"id":"39f67bec.0b2fe4","type":"websocket-listener","z":"","path":"/location/receive","wholemsg":"true"},{"id":"654f3d23.7221e4","type":"websocket-listener","z":"","path":"/browserpage/receive","wholemsg":"true"},{"id":"922ce017.72c01","type":"websocket-listener","z":"","path":"/browserpage/send","wholemsg":"false"},{"id":"846cfc61.5ccfe","type":"websocket-listener","z":"","path":"/browserpage/receive/one","wholemsg":"true"},{"id":"bd6c3af.5c6d0c8","type":"serial-port","z":"","serialport":"/dev/ttyUSB-SMS_00","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"50","bin":"false","out":"time","addchar":false,"responsetimeout":""},{"id":"4c9759dc.0c6338","type":"serial-port","z":"","serialport":"/dev/ttyUSB-TRX1","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"50","bin":"false","out":"time","addchar":false,"responsetimeout":"10000"},{"id":"5ea533e5.c35b8c","type":"ui_group","z":"","name":"IP Settings","tab":"ac8c41d4.15972","disp":true,"width":"6","collapse":false},{"id":"ac8c41d4.15972","type":"ui_tab","z":"","name":"Settings","icon":"settings"},{"id":"ad147099.a69c3","type":"serial-port","serialport":"/dev/ttyS2","serialbaud":"1200","databits":"7","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":"false"},{"id":"9c75d562.473268","type":"websocket-listener","z":"","path":"/settings_list","wholemsg":"true"},{"id":"dc2bb776.c508d8","type":"websocket-listener","z":"","path":"/sms/send","wholemsg":"false"},{"id":"97aed89c.6c8d08","type":"websocket-listener","z":"","path":"/sms/receive/one","wholemsg":"true"},{"id":"2ca8999c.456256","type":"websocket-listener","z":"","path":"/sms/receive/two","wholemsg":"true"},{"id":"6c8b92a7.84a82c","type":"e-mail","z":"b00e2d77.a9931","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"CaptureCall System","x":1280,"y":1000,"wires":[]},{"id":"da56f422.c45fe8","type":"csv","z":"b00e2d77.a9931","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\n","temp":"Index, Call Point, Message, ReceivedTime, Status, StatusTime, ExportedTime, Recipient, System ID","skip":"0","x":890,"y":1020,"wires":[["e981d4fd.f427d8","8551674f.20b3f8"]]},{"id":"3f8aac1f.7c3ae4","type":"template","z":"b00e2d77.a9931","name":"Export All","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT \n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log`\nORDER BY `rxTime` DESC;","output":"str","x":340,"y":1060,"wires":[["f8461b70.bd71c8"]]},{"id":"e981d4fd.f427d8","type":"change","z":"b00e2d77.a9931","name":"Setup mail content","rules":[{"t":"set","p":"attachments","pt":"msg","to":"[{\t \"filename\": 'log.csv', \t \"content\": $$.payload\t}]","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"CaptureCall System Log","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Attached is the requested information from your CaptureCall system.","tot":"str"},{"t":"set","p":"to","pt":"msg","to":"to","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":1020,"wires":[["6c8b92a7.84a82c"]]},{"id":"a32b6729.85e8e8","type":"http in","z":"b00e2d77.a9931","name":"","url":"/export","method":"get","upload":false,"swaggerDoc":"","x":90,"y":200,"wires":[["cf30e34b.c1eb2"]]},{"id":"af06c87d.56a788","type":"comment","z":"b00e2d77.a9931","name":"Build Webpage","info":"","x":100,"y":40,"wires":[]},{"id":"cc70f131.afde4","type":"template","z":"b00e2d77.a9931","name":"Export New","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT\n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log` WHERE `exported` IS NULL","output":"str","x":350,"y":1020,"wires":[["f8461b70.bd71c8"]]},{"id":"f8a9f08f.97c9b","type":"template","z":"b00e2d77.a9931","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `log` SET `exported`= '{{timestamp}}'","output":"str","x":680,"y":820,"wires":[["1526f69b.ff5f29"]]},{"id":"f8461b70.bd71c8","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":530,"y":1020,"wires":[["2e1d4886.bea1a8"]]},{"id":"1526f69b.ff5f29","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":820,"wires":[[]]},{"id":"c3f8d5d0.283858","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Your eMail has been Sent","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":700,"wires":[["75f1d35f.d07dac","a5a593bb.63b9d"]]},{"id":"463f8c6f.4fd364","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Send Failed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":660,"wires":[["68d64bf.54ca2b4","d08f4aa4.66b1b8"]]},{"id":"9f4bb9c9.b550f8","type":"status","z":"b00e2d77.a9931","name":"","scope":["6c8b92a7.84a82c"],"x":80,"y":680,"wires":[["ba578bde.7214f8"]]},{"id":"ba578bde.7214f8","type":"switch","z":"b00e2d77.a9931","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"email.status.sendfail","vt":"str"},{"t":"eq","v":"email.status.sending","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":230,"y":680,"wires":[["463f8c6f.4fd364"],[],["c3f8d5d0.283858"]]},{"id":"3013dfe1.3ed01","type":"comment","z":"b00e2d77.a9931","name":"Catch Email Send Errors","info":"","x":130,"y":600,"wires":[]},{"id":"86082327.d62aa","type":"link in","z":"b00e2d77.a9931","name":"","links":["721569cb.074f58","8dc6af04.088a3"],"x":235,"y":1020,"wires":[["cc70f131.afde4"]]},{"id":"223b37e8.4b69d8","type":"link in","z":"b00e2d77.a9931","name":"","links":["2c82e51a.004a9a","9b0374d2.8917a8","34e0ce95.1b5ca2"],"x":235,"y":1060,"wires":[["3f8aac1f.7c3ae4"]]},{"id":"fed99ff9.b9bb1","type":"comment","z":"b00e2d77.a9931","name":"Send Email","info":"","x":90,"y":900,"wires":[]},{"id":"666f148c.df226c","type":"csv","z":"b00e2d77.a9931","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\n","temp":"Index, Call Point, Message, ReceivedTime, Status, StatusTime, ExportedTime, Recipient, System ID","skip":"0","x":890,"y":980,"wires":[["4ea4678b.48f808","8551674f.20b3f8"]]},{"id":"4ea4678b.48f808","type":"change","z":"b00e2d77.a9931","name":"Setup mail content","rules":[{"t":"set","p":"attachments","pt":"msg","to":"[{\t \"filename\": 'log.csv', \t \"content\": $$.payload\t}]","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"CaptureCall Daily Digest","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Attached is the requested information from your CaptureCall system.","tot":"str"},{"t":"set","p":"to","pt":"msg","to":"to","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":980,"wires":[["6c8b92a7.84a82c"]]},{"id":"94f5535a.df3bc","type":"template","z":"b00e2d77.a9931","name":"Export New","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT\n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log` WHERE `exported` IS NULL","output":"str","x":350,"y":980,"wires":[["445e65fd.5881dc"]]},{"id":"445e65fd.5881dc","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":530,"y":980,"wires":[["4df235b.7c5c0cc"]]},{"id":"f3405690.0119c8","type":"inject","z":"b00e2d77.a9931","name":"Export New Every Day","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"x":150,"y":980,"wires":[["94f5535a.df3bc","ebaeeace.a4f718","430823b4.54fdcc"]]},{"id":"a61b2d01.623e8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":120,"wires":[]},{"id":"c7008ce.9220c7","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":80,"wires":[["6f129008.96182"]]},{"id":"7e6e6b94.b4a724","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `log` ( \t`index`\tINTEGER PRIMARY KEY AUTOINCREMENT, \t`capcode`\tINTEGER, \t`pagerNumber`\tINTEGER, \t`sysID`\tINTEGER, \t`group`\tTEXT, \t`content`\tTEXT, \t`msgPart1`\tTEXT, \t`msgPart2`\tTEXT, \t`sender`\tTEXT, \t`rxTime`\tINTEGER, \t`status`\tINTEGER, \t`statusTime`\tREAL, \t`exported`\tINTEGER, \t`FP`\tTEXT, \t`payload`\tTEXT, \t`T/R`\tINTEGER );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":80,"wires":[["c7008ce.9220c7"]]},{"id":"6f129008.96182","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":80,"wires":[]},{"id":"ec443c0d.8626c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":240,"wires":[["24bd4830.57f6e8"]]},{"id":"9d1e6dbe.d89e2","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":240,"wires":[["ec443c0d.8626c"]]},{"id":"aed60ae.6b45df8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":120,"wires":[["a61b2d01.623e8"]]},{"id":"c8181b2e.7db228","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":120,"wires":[["aed60ae.6b45df8"]]},{"id":"b0a6ba65.a7d928","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":160,"wires":[]},{"id":"8b6bd144.83a25","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":160,"wires":[["b0a6ba65.a7d928"]]},{"id":"df2babd6.b81898","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":160,"wires":[["8b6bd144.83a25"]]},{"id":"4df235b.7c5c0cc","type":"function","z":"b00e2d77.a9931","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \nvar rxtime = new Date(msg.payload[i].rxTime);\nvar statusTime = new Date(msg.payload[i].statusTime);\nvar exportedTime = new Date(msg.payload[i].exported);\n\nif (msg.payload[i].exported === null) {\n msg.payload[i].ExportedTime = \"n/a\"\n} else {\nmsg.payload[i].ExportedTime = exportedTime\n}\n\nmsg.payload[i].StatusTime = statusTime\nmsg.payload[i].ReceivedTime = rxtime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":980,"wires":[["666f148c.df226c"]]},{"id":"75f1d35f.d07dac","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":780,"wires":[["582b503f.5fb22","f8a9f08f.97c9b"]]},{"id":"2e1d4886.bea1a8","type":"function","z":"b00e2d77.a9931","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \nvar rxtime = new Date(msg.payload[i].rxTime);\nvar statusTime = new Date(msg.payload[i].statusTime);\nvar exportedTime = new Date(msg.payload[i].exported);\n\nif (msg.payload[i].exported === null) {\n msg.payload[i].ExportedTime = \"n/a\"\n} else {\nmsg.payload[i].ExportedTime = exportedTime\n}\n\nmsg.payload[i].StatusTime = statusTime\nmsg.payload[i].ReceivedTime = rxtime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":1020,"wires":[["da56f422.c45fe8"]]},{"id":"24bd4830.57f6e8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":240,"wires":[]},{"id":"2fd5e4ed.597f5c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":200,"wires":[]},{"id":"37e42e66.009442","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":200,"wires":[["2fd5e4ed.597f5c"]]},{"id":"d201839b.347","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'log';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":200,"wires":[["37e42e66.009442"]]},{"id":"8551674f.20b3f8","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":940,"wires":[]},{"id":"1d4b9b6.2e75565","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":280,"wires":[["8b82ced7.840b7"]]},{"id":"f3efd6bc.d319a8","type":"inject","z":"ba76d305.cf8ad","name":"Clear Old Records","topic":"DELETE FROM `log` WHERE `index` IN (SELECT `index` FROM `log` ORDER BY `index` DESC LIMIT -1 OFFSET 2000) AND `exported` IS NOT NULL;","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":280,"wires":[["1d4b9b6.2e75565"]]},{"id":"8b82ced7.840b7","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":280,"wires":[]},{"id":"a352da15.0d4288","type":"template","z":"b00e2d77.a9931","name":"Clear Old Records","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `log` WHERE `index` IN (SELECT `index` FROM `log` ORDER BY `index` DESC LIMIT -1 OFFSET 2000) AND `exported` IS NOT NULL;","output":"str","x":510,"y":940,"wires":[["b59b1f4c.0ec78"]]},{"id":"b59b1f4c.0ec78","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":690,"y":940,"wires":[[]]},{"id":"ebaeeace.a4f718","type":"delay","z":"b00e2d77.a9931","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":940,"wires":[["a352da15.0d4288"]]},{"id":"582b503f.5fb22","type":"template","z":"b00e2d77.a9931","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export Successful','Export Successful', '{{timestamp}}', '{{timestamp}}');","output":"str","x":680,"y":780,"wires":[["5c50a3a4.23c89c"]]},{"id":"5c50a3a4.23c89c","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":780,"wires":[[]]},{"id":"ecca07b5.9ea578","type":"template","z":"b00e2d77.a9931","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export Failed','Export Failed', '{{timestamp}}', '{{timestamp}}');","output":"str","x":680,"y":620,"wires":[["b09e3e3f.0fe09"]]},{"id":"b09e3e3f.0fe09","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":620,"wires":[[]]},{"id":"33c3ae31.e41c62","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Daily Export Triggered','Daily Export Triggered to {{global.to}}', '{{timestamp}}', '{{timestamp}}');","output":"str","x":490,"y":900,"wires":[["e7b2f01e.3fbbf"]]},{"id":"e7b2f01e.3fbbf","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":900,"wires":[[]]},{"id":"68d64bf.54ca2b4","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":620,"wires":[["ecca07b5.9ea578"]]},{"id":"430823b4.54fdcc","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":900,"wires":[["33c3ae31.e41c62"]]},{"id":"bc4b27b0.6d1478","type":"link out","z":"e3cbac21.52804","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1815,"y":220,"wires":[]},{"id":"c94a9d48.9c2c","type":"link out","z":"e3cbac21.52804","name":"Add to DB","links":["a7862417.604e88","c7eb5365.d6ebd","562eef1b.5da85","8452a925.e651d8","ac279afc.5d13b8","81bc9a1b.ba8868","70de8433.1ad6bc","39c86da3.17b292","65839b56.756164"],"x":1175,"y":240,"wires":[]},{"id":"65be70e.baef89","type":"comment","z":"e3cbac21.52804","name":"Add to DB","info":"","x":1320,"y":180,"wires":[]},{"id":"f00ef931.2b7e68","type":"hostip","z":"60528a1b.f32364","name":"Host IP","x":420,"y":160,"wires":[["7ece05b1.f644dc","88463608.a1be98"]]},{"id":"88463608.a1be98","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"ip","pt":"global","to":"payload[0].address","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":120,"wires":[[]]},{"id":"66e288bb.f91b28","type":"inject","z":"60528a1b.f32364","name":"Initiate Global Variables","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"0","x":190,"y":160,"wires":[["f00ef931.2b7e68","7a7e9dde.7b8004","577e3b25.879e44","b6c859b7.94b658","75e740cb.10229","d57eea24.248848","1ecf1066.91d79","64152e36.bad9a","702ec949.a6b798","b97ab582.64ca48","e9329103.798d6","2787e72e.d4af98","5ea3efa2.1fb7a","6579a230.6630bc","ee5d6812.a72308"]]},{"id":"9a7d50bd.7cef2","type":"comment","z":"60528a1b.f32364","name":"Save IP Address","info":"","x":880,"y":160,"wires":[]},{"id":"7fda91ad.06b69","type":"template","z":"60528a1b.f32364","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload') \nVALUES ('0', '0', '{{global.sysID}}', '0', 'Power On ({{global.ip}})', 'n/a', 'System','{{payload}}', 'Power On', '{{payload}}', 'n/a', 'n/a');","output":"str","x":580,"y":200,"wires":[["64f95549.289fdc"]]},{"id":"64f95549.289fdc","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":200,"wires":[[]]},{"id":"7a7e9dde.7b8004","type":"delay","z":"60528a1b.f32364","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":430,"y":200,"wires":[["7fda91ad.06b69"]]},{"id":"adbc8745.6a7b98","type":"comment","z":"60528a1b.f32364","name":"Write Power On Message to Log","info":"","x":950,"y":200,"wires":[]},{"id":"8ef3cc6f.9a91a","type":"template","z":"60528a1b.f32364","name":"Left Header","field":"left","fieldType":"global","format":"handlebars","syntax":"mustache","template":"
\n\n

","output":"str","x":910,"y":640,"wires":[[]]},{"id":"bdee1a5f.1f3dc8","type":"comment","z":"60528a1b.f32364","name":"Set Left Header Links","info":"","x":1520,"y":640,"wires":[]},{"id":"5d9f879a.ab2cf8","type":"http response","z":"b00e2d77.a9931","name":"","statusCode":"201","headers":{},"x":760,"y":200,"wires":[]},{"id":"4e44e038.08395","type":"template","z":"b00e2d77.a9931","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
\n {{{global.left}}}\n
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":630,"y":200,"wires":[["5d9f879a.ab2cf8"]]},{"id":"cf30e34b.c1eb2","type":"change","z":"b00e2d77.a9931","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Export Menu","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":200,"wires":[["72aa7d10.d1af44"]]},{"id":"29aa4748.4a38f8","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"to","pt":"global","to":"payload[0].email","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":360,"wires":[[]]},{"id":"43bab4a0.45f19c","type":"comment","z":"60528a1b.f32364","name":"Set S/W Version","info":"","x":780,"y":480,"wires":[]},{"id":"43ccf7d3.ddd008","type":"comment","z":"60528a1b.f32364","name":"Set Email","info":"","x":760,"y":360,"wires":[]},{"id":"89ede062.46b22","type":"comment","z":"b00e2d77.a9931","name":"Put Settings On the Webpage","info":"","x":140,"y":280,"wires":[]},{"id":"a29f518.92ac7b","type":"websocket out","z":"b00e2d77.a9931","name":"","server":"b7dfd67b.7d7948","client":"","x":750,"y":320,"wires":[]},{"id":"1228ef46.2a9871","type":"template","z":"b00e2d77.a9931","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Click on the buttons below to email the relevant report immediately.

\n\n
\n\n

\n\n
\n\n

\n\n
\n\n

","output":"str","x":570,"y":320,"wires":[["a29f518.92ac7b"]]},{"id":"f72ff61b.e8d618","type":"link in","z":"b00e2d77.a9931","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","323185ec.ff19aa","439e3a4.33f4dc4","ce5be23d.4618f","64848176.9353c","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":455,"y":360,"wires":[["1228ef46.2a9871"]]},{"id":"2e977b67.7b7c54","type":"websocket in","z":"b00e2d77.a9931","name":"","server":"c78d8a51.8b8ed8","client":"","x":100,"y":320,"wires":[["b1ffa92d.ad84e8"]]},{"id":"e979859b.b1bd58","type":"switch","z":"b00e2d77.a9931","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":320,"wires":[["1228ef46.2a9871"]]},{"id":"72aa7d10.d1af44","type":"template","z":"b00e2d77.a9931","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/export/receive');\nvar send = new WebSocket('ws://' + location.host + '/export/send');\n\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":510,"y":200,"wires":[["4e44e038.08395"]]},{"id":"3e94fc51.b74054","type":"switch","z":"b00e2d77.a9931","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"},{"t":"eq","v":"ExportNew","vt":"str"},{"t":"eq","v":"ExportAll","vt":"str"},{"t":"eq","v":"ExportUSB","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":250,"y":460,"wires":[[],["cf368fd3.b1f24"],["296e6582.99004a"],["9ebb47d8.f65978"]]},{"id":"64248c60.900b94","type":"websocket in","z":"b00e2d77.a9931","name":"","server":"c78d8a51.8b8ed8","client":"","x":100,"y":460,"wires":[["3e94fc51.b74054"]]},{"id":"8dc6af04.088a3","type":"link out","z":"b00e2d77.a9931","name":"","links":["86082327.d62aa"],"x":815,"y":440,"wires":[]},{"id":"9b0374d2.8917a8","type":"link out","z":"b00e2d77.a9931","name":"","links":["223b37e8.4b69d8"],"x":815,"y":480,"wires":[]},{"id":"d27040b1.bd22","type":"comment","z":"b00e2d77.a9931","name":"Handle Input from Webpage","info":"","x":140,"y":400,"wires":[]},{"id":"878807fc.17f708","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export All','Export All to {{global.to}}', '{{timestamp}}', '{{timestamp}}');","output":"str","x":550,"y":480,"wires":[["36c49da8.b2b1c2"]]},{"id":"36c49da8.b2b1c2","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":480,"wires":[["9b0374d2.8917a8"]]},{"id":"3e07d8e1.991e78","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Export New','Export New to {{global.to}}', '{{timestamp}}', '{{timestamp}}');","output":"str","x":550,"y":440,"wires":[["6886cec4.f705c"]]},{"id":"6886cec4.f705c","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":440,"wires":[["8dc6af04.088a3"]]},{"id":"cf368fd3.b1f24","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":440,"wires":[["3e07d8e1.991e78"]]},{"id":"296e6582.99004a","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":480,"wires":[["878807fc.17f708"]]},{"id":"fd4ba03e.ba97d","type":"comment","z":"60528a1b.f32364","name":"Set Modules","info":"","x":1550,"y":680,"wires":[]},{"id":"7aa6b39d.f2722c","type":"http response","z":"60528a1b.f32364","name":"","statusCode":"201","headers":{},"x":840,"y":800,"wires":[]},{"id":"95a0170a.fdab58","type":"template","z":"60528a1b.f32364","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n \n\n\n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\nSorry you are not able to access this page\n
\n\n\n\n","output":"str","x":710,"y":800,"wires":[["7aa6b39d.f2722c"]]},{"id":"102ab00f.0b28b","type":"change","z":"60528a1b.f32364","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Unavaliable Module","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":800,"wires":[["6ec81c61.061cd4"]]},{"id":"6ec81c61.061cd4","type":"template","z":"60528a1b.f32364","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n// Display Popup\npopup.onmessage = function(d) {\n var txt = d.data;\n alert(txt);\n};\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":590,"y":800,"wires":[["95a0170a.fdab58"]]},{"id":"f13a1f16.82872","type":"link in","z":"60528a1b.f32364","name":"Not Licenced","links":["34ba01df.30c98e","981f0079.8aed3","ae2f0aa6.b83788","c1934064.6743e","3ef1e38d.001f0c","f99490de.c1fcb","28a27e6d.5aef12","7c60ce85.df3bb","1f567951.b54357","985d53b9.d1886","35068c2f.a9b8b4","7eec4d28.128ec4","e9c91e07.38088","c6b24bdc.0d6158","d2ce817e.0c903","70722b52.c7b7d4","ce2ef575.3ca4f8","1bdee69f.d69879","826d284d.cae348","a9e43bb2.c39a08","a09805de.c65d98","12e7e314.ca01cd","d3d1d66e.98d9a8","2c36e9b3.4b4696","c8fee362.8be85","c14eb3d.6de925","7ac9201a.5756a","f74bf0a0.7ec6","453c2b99.3d2654","3610e485.e6047c"],"x":375,"y":800,"wires":[["102ab00f.0b28b"]]},{"id":"6ca3eb83.432e44","type":"comment","z":"60528a1b.f32364","name":"Unlicenced Module Webpage","info":"this Flow is the webpage that is served if a user tries to access a page they are not licenced for. this can be triggered from any page by a link node.","x":480,"y":760,"wires":[]},{"id":"57140bc4.737114","type":"template","z":"b00e2d77.a9931","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'ExportUSB','Export All to USB', '{{timestamp}}', '{{timestamp}}');","output":"str","x":550,"y":520,"wires":[["aa2c8114.eb4a8"]]},{"id":"aa2c8114.eb4a8","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":520,"wires":[["2a3fe792.b505c8"]]},{"id":"9ebb47d8.f65978","type":"change","z":"b00e2d77.a9931","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":520,"wires":[["57140bc4.737114"]]},{"id":"2a3fe792.b505c8","type":"template","z":"b00e2d77.a9931","name":"Export All","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT \n`index` AS 'Index',\n`sender` AS 'Call Point',\n`content` AS 'Message',\n`rxTime`,\n`status` AS 'Status',\n`statusTime`,\n`exported`,\n`pagerNumber` AS 'Recipient',\n`sysID` AS 'System ID'\nFROM `log`\n\nORDER BY `rxTime` DESC;","output":"str","x":920,"y":480,"wires":[["f18406a.f7faef8"]]},{"id":"f18406a.f7faef8","type":"sqlite","z":"b00e2d77.a9931","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1070,"y":480,"wires":[["390160a5.8ab92"]]},{"id":"390160a5.8ab92","type":"function","z":"b00e2d77.a9931","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \nvar rxtime = new Date(msg.payload[i].rxTime);\nvar statusTime = new Date(msg.payload[i].statusTime);\nvar exportedTime = new Date(msg.payload[i].exported);\n\nif (msg.payload[i].exported === null) {\n msg.payload[i].ExportedTime = \"n/a\"\n} else {\nmsg.payload[i].ExportedTime = exportedTime\n}\n\nmsg.payload[i].StatusTime = statusTime\nmsg.payload[i].ReceivedTime = rxtime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1260,"y":480,"wires":[["ae68ab8d.892138"]]},{"id":"ae68ab8d.892138","type":"csv","z":"b00e2d77.a9931","name":"","sep":",","hdrin":"","hdrout":true,"multi":"one","ret":"\\n","temp":"Index, Call Point, Alias, Message, ReceivedTime, Status, StatusTime, ExportedTime, Recipient, System ID","skip":"0","x":1430,"y":480,"wires":[["37d0780.6d43088"]]},{"id":"6718e06d.1a7ba","type":"file","z":"b00e2d77.a9931","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","x":1690,"y":480,"wires":[["8733b6b6.ceecc8","5976af7.cc2d25"]]},{"id":"37d0780.6d43088","type":"template","z":"b00e2d77.a9931","name":"","field":"filename","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"/media/usb0/log/{{timestamp}}.csv","output":"str","x":1560,"y":480,"wires":[["6718e06d.1a7ba"]]},{"id":"df0dd902.e39c78","type":"catch","z":"b00e2d77.a9931","name":"","scope":["6718e06d.1a7ba"],"x":1690,"y":440,"wires":[["5c219c0f.48fa14","b5112973.1619b8"]]},{"id":"bc5cc87f.5767a8","type":"websocket out","z":"b00e2d77.a9931","name":"Show Alert for File Error","server":"4586ec4f.d85214","client":"","x":2090,"y":460,"wires":[]},{"id":"5c219c0f.48fa14","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Error exporting to USB, Please check USB Stick is inserted","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1860,"y":440,"wires":[["bc5cc87f.5767a8","88debd97.7e53e"]]},{"id":"8733b6b6.ceecc8","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Export Complete","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1860,"y":480,"wires":[["bc5cc87f.5767a8","88debd97.7e53e"]]},{"id":"5976af7.cc2d25","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1830,"y":520,"wires":[]},{"id":"b5112973.1619b8","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1830,"y":400,"wires":[]},{"id":"88debd97.7e53e","type":"debug","z":"b00e2d77.a9931","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2070,"y":540,"wires":[]},{"id":"9fd61880.516a68","type":"comment","z":"23c43518.b3ff0a","name":"Put Unprocessed On the Webpage","info":"","x":180,"y":240,"wires":[]},{"id":"ebcd4c65.6046a","type":"template","z":"23c43518.b3ff0a","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nWHERE `cleared` = '0'\nORDER BY `{{global.sort-by}}` {{global.direction}}","output":"str","x":310,"y":340,"wires":[["66291f5f.af93b"]]},{"id":"6264593.4e61aa8","type":"websocket out","z":"23c43518.b3ff0a","name":"","server":"d9d1357a.d4f118","client":"","x":1380,"y":340,"wires":[]},{"id":"dca11650.a5a9e8","type":"comment","z":"23c43518.b3ff0a","name":"Build Webpage","info":"","x":120,"y":20,"wires":[]},{"id":"66291f5f.af93b","type":"sqlite","z":"23c43518.b3ff0a","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":340,"wires":[["16a49dc6.39c7b2","1c5036dd.808169"]]},{"id":"75cd0257.5b5c8c","type":"template","z":"23c43518.b3ff0a","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Index
\n
Location
\n
Message
\n
Time
\n
Date
\n
Elapsed
\n
\n \n{{#payload}}\n
\n
{{{index}}}
\n
{{{part2}}} {{sender}}
\n
{{{part1}}}
\n
{{{displayTime}}}
\n
{{{displayDate}}}
\n
{{{elapsed}}}
\n
\n{{/payload}}","output":"str","x":1190,"y":340,"wires":[["6264593.4e61aa8"]]},{"id":"5ea79923.89c6a8","type":"function","z":"23c43518.b3ff0a","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":820,"y":340,"wires":[["ce83b6ba.b91948"]]},{"id":"ce83b6ba.b91948","type":"function","z":"23c43518.b3ff0a","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":340,"wires":[["75cd0257.5b5c8c"]]},{"id":"5c4d6c4d.b2cf34","type":"inject","z":"23c43518.b3ff0a","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":340,"wires":[["ebcd4c65.6046a"]]},{"id":"c0f55161.eb2e9","type":"websocket in","z":"23c43518.b3ff0a","name":"","server":"95962f80.19ef3","client":"","x":140,"y":440,"wires":[["d47e3460.18a298"]]},{"id":"e4b4571a.fa0ca8","type":"comment","z":"23c43518.b3ff0a","name":"Hide Message on Click","info":"","x":160,"y":400,"wires":[]},{"id":"3dc80a3a.37f5b6","type":"template","z":"23c43518.b3ff0a","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":440,"wires":[["81d2af9c.b2af1"]]},{"id":"81d2af9c.b2af1","type":"sqlite","z":"23c43518.b3ff0a","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":440,"wires":[["28ec47d.cd906b8"]]},{"id":"28ec47d.cd906b8","type":"link out","z":"23c43518.b3ff0a","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec"],"x":915,"y":440,"wires":[]},{"id":"bde9417c.ae3fa","type":"change","z":"23c43518.b3ff0a","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":440,"wires":[["3dc80a3a.37f5b6"]]},{"id":"47f470.6d282b9","type":"http response","z":"23c43518.b3ff0a","name":"","statusCode":"201","headers":{},"x":800,"y":120,"wires":[]},{"id":"9b9c90b8.58988","type":"template","z":"23c43518.b3ff0a","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n\n\n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n\n\n","output":"str","x":670,"y":120,"wires":[["47f470.6d282b9"]]},{"id":"5e777687.bf0378","type":"change","z":"23c43518.b3ff0a","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Dynamic Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":120,"wires":[["9b1e3c99.05267"]]},{"id":"d47e3460.18a298","type":"switch","z":"23c43518.b3ff0a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":440,"wires":[["bde9417c.ae3fa"],["b19f9c2a.0005a"]]},{"id":"ea0ecadf.2504f8","type":"comment","z":"e3cbac21.52804","name":"Receive Page","info":"","x":90,"y":140,"wires":[]},{"id":"4c566771.e36038","type":"template","z":"e3cbac21.52804","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'FP', 'rxTime', 'status', 'statusTime', 'exported', 'cleared','late','duplicate','T/R','payload') \nVALUES ('{{capcode}}', '{{pagerNumber}}', '{{sysID}}', '{{{group}}}', '{{part1}}', '{{part2}}', '{{sender}}', '{{{FP}}}','{{timestamp}}', '{{{status}}}', '{{timestamp}}', '{{exported}}', '{{cleared}}', '{{late}}', '{{duplicate}}', '0', '{{{payload}}}');","output":"str","x":1420,"y":220,"wires":[["76901721.920c58"]]},{"id":"c7eb5365.d6ebd","type":"link in","z":"e3cbac21.52804","name":"Received Page","links":["c94a9d48.9c2c"],"x":1255,"y":240,"wires":[["4c566771.e36038","d3cc339c.3f9a3","6fb08921.c8e198","1bb43e1a.eed742"]]},{"id":"76901721.920c58","type":"sqlite","z":"e3cbac21.52804","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1710,"y":220,"wires":[["bc4b27b0.6d1478"]]},{"id":"16a49dc6.39c7b2","type":"function","z":"23c43518.b3ff0a","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":340,"wires":[["5ea79923.89c6a8"]]},{"id":"734abd62.6c0054","type":"serial out","z":"dad6f0f1.28177","name":"","serial":"5d6eb2f4.fc698c","x":790,"y":260,"wires":[]},{"id":"66a1cd6e.22e4e4","type":"inject","z":"dad6f0f1.28177","name":"Enable Dry Contact 0","topic":"","payload":"SINP,1,911,Door ","payloadType":"string","repeat":"","crontab":"","once":false,"x":520,"y":140,"wires":[["734abd62.6c0054"]]},{"id":"8e4d5133.e1bf3","type":"inject","z":"dad6f0f1.28177","name":"Repeat Off","topic":"","payload":"RPTRX,0","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":560,"y":100,"wires":[["734abd62.6c0054"]]},{"id":"39d79a16.339446","type":"inject","z":"dad6f0f1.28177","name":"Enable Receive","topic":"","payload":"INTFMODE,1","payloadType":"string","repeat":"","crontab":"","once":false,"x":540,"y":220,"wires":[["734abd62.6c0054"]]},{"id":"cbe825bf.1337a8","type":"inject","z":"dad6f0f1.28177","name":"Send Page","topic":"","payload":"CCPAGE,0807288,TEST","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":560,"y":260,"wires":[["734abd62.6c0054"]]},{"id":"e34f4022.12139","type":"inject","z":"dad6f0f1.28177","name":"Enable Dry Contact 1","topic":"","payload":"SINP1,1,911,Door ","payloadType":"string","repeat":"","crontab":"","once":false,"x":520,"y":180,"wires":[["734abd62.6c0054"]]},{"id":"37e179b9.9b9f86","type":"comment","z":"b8bd1cc3.4827","name":"Put Unprocessed On the Webpage","info":"","x":200,"y":260,"wires":[]},{"id":"f1c61ac.2a61be8","type":"template","z":"b8bd1cc3.4827","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nWHERE `cleared` = '0' AND `duplicate` = '0'\nORDER BY `rxTime` DESC \nLIMIT 5;\n\n","output":"str","x":330,"y":300,"wires":[["f1a5e48e.f2da48"]]},{"id":"daef15a.4ef89e8","type":"websocket out","z":"b8bd1cc3.4827","name":"","server":"5e6c9ab1.74ef04","client":"","x":1390,"y":300,"wires":[]},{"id":"f1a5e48e.f2da48","type":"sqlite","z":"b8bd1cc3.4827","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":510,"y":300,"wires":[["c1b56b46.0f7818","5d19cfa1.ed974"]]},{"id":"8be4aba0.feaed8","type":"template","z":"b8bd1cc3.4827","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{#payload}}\n\n
\n {{{part1}}}\n
\n {{{part2}}} {{sender}}\n
\n {{{elapsed}}}\n
\n{{/payload}}","output":"str","x":1210,"y":300,"wires":[["daef15a.4ef89e8"]]},{"id":"3eca0fc8.c120d","type":"websocket in","z":"b8bd1cc3.4827","name":"","server":"addfeab3.3935e8","client":"","x":140,"y":460,"wires":[["c5eb9330.50819"]]},{"id":"1f847469.688d7c","type":"comment","z":"b8bd1cc3.4827","name":"Hide Message on Click","info":"","x":160,"y":420,"wires":[]},{"id":"cd533235.40194","type":"template","z":"b8bd1cc3.4827","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":440,"wires":[["3e54b72d.158e18"]]},{"id":"3e54b72d.158e18","type":"sqlite","z":"b8bd1cc3.4827","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":440,"wires":[["18e72d9f.360682"]]},{"id":"18e72d9f.360682","type":"link out","z":"b8bd1cc3.4827","name":"","links":["13c2aaaa.74d295","8452a925.e651d8","f72ff61b.e8d618","f8b2c7bc.b77368","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":915,"y":440,"wires":[]},{"id":"a760c9de.c3c958","type":"change","z":"b8bd1cc3.4827","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":440,"wires":[["cd533235.40194"]]},{"id":"c5eb9330.50819","type":"switch","z":"b8bd1cc3.4827","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":460,"wires":[["a760c9de.c3c958"],["91921094.a8632"]]},{"id":"8452a925.e651d8","type":"link in","z":"b8bd1cc3.4827","name":"Received Page","links":["c94a9d48.9c2c","91921094.a8632","18e72d9f.360682"],"x":215,"y":340,"wires":[["f1c61ac.2a61be8"]]},{"id":"c1b56b46.0f7818","type":"function","z":"b8bd1cc3.4827","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP === \"\") {\n msg.payload[i].style = \"default\"\n} else {\n msg.payload[i].style = msg.payload[i].FP \n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":300,"wires":[["7502bae2.b01d14","311030ac.d9f2b"]]},{"id":"91921094.a8632","type":"link out","z":"b8bd1cc3.4827","name":"","links":["8452a925.e651d8"],"x":375,"y":480,"wires":[]},{"id":"6d21559e.0372fc","type":"http in","z":"b8bd1cc3.4827","name":"","url":"/firstaid","method":"get","upload":false,"swaggerDoc":"","x":110,"y":220,"wires":[["e27d3777.8cf898","6d3d48bb.e324b8"]]},{"id":"8e112c9a.4a00a","type":"comment","z":"b8bd1cc3.4827","name":"Build Webpage","info":"","x":140,"y":20,"wires":[]},{"id":"23c32a03.41b276","type":"http response","z":"b8bd1cc3.4827","name":"","statusCode":"201","headers":{},"x":820,"y":160,"wires":[]},{"id":"598c3baa.7efd84","type":"template","z":"b8bd1cc3.4827","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":690,"y":160,"wires":[["23c32a03.41b276"]]},{"id":"4d7773b3.0108ec","type":"change","z":"b8bd1cc3.4827","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall First Aid Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":160,"wires":[["d3c7d55.b404528"]]},{"id":"33ff1e8e.291482","type":"function","z":"ca9def01.26ba2","name":"Payload to Page","func":"var message = msg.payload;\nvar sendmessage = message; //.replace(/\\n/g, \" \");\nvar capcode = msg.capcode;\nvar address = 0707288;//capcode;\nvar page = \"CCPAGE,\"+ address + \",\"+ sendmessage + \"\\n\";\nmsg.payload = page\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":220,"wires":[["2dd9fe99.b05ae2","8d0ad831.2c6d48"]]},{"id":"2dd9fe99.b05ae2","type":"debug","z":"ca9def01.26ba2","name":"Page Sent","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":180,"wires":[]},{"id":"7b760cf6.6127c4","type":"comment","z":"ca9def01.26ba2","name":"Send Page","info":"","x":140,"y":40,"wires":[]},{"id":"d51608e.09159f8","type":"switch","z":"ca9def01.26ba2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"null"},{"t":"cont","v":"undefined","vt":"str"},{"t":"cont","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":160,"wires":[["38ff2879.47e0b8"],["38ff2879.47e0b8"],["38ff2879.47e0b8"]]},{"id":"38ff2879.47e0b8","type":"change","z":"ca9def01.26ba2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Please Enter a Message to Send","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":140,"wires":[["f13e64e1.363ed8"]]},{"id":"d19364d9.208968","type":"switch","z":"ca9def01.26ba2","name":"","property":"capcode","propertyType":"msg","rules":[{"t":"null"},{"t":"cont","v":"undefined","vt":"str"},{"t":"cont","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":370,"y":100,"wires":[["ebe0115.f169ff"],["ebe0115.f169ff"],["ebe0115.f169ff"]]},{"id":"ebe0115.f169ff","type":"change","z":"ca9def01.26ba2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Please Select a User to Send a Page to","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":100,"wires":[["f13e64e1.363ed8"]]},{"id":"f13e64e1.363ed8","type":"delay","z":"ca9def01.26ba2","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":690,"y":120,"wires":[[]]},{"id":"fb44d9db.726018","type":"change","z":"ca9def01.26ba2","name":"","rules":[{"t":"set","p":"justSent","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":40,"wires":[[]]},{"id":"8d0ad831.2c6d48","type":"serial out","z":"ca9def01.26ba2","name":"","serial":"5d6eb2f4.fc698c","x":630,"y":220,"wires":[]},{"id":"4c251e8b.6402c","type":"inject","z":"ca9def01.26ba2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":220,"wires":[["33ff1e8e.291482"]]},{"id":"f5c9a8af.c8e3d8","type":"inject","z":"b8bd1cc3.4827","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":300,"wires":[["f1c61ac.2a61be8"]]},{"id":"d3c7d55.b404528","type":"template","z":"b8bd1cc3.4827","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/firstaid/receive');\n var send = new WebSocket('ws://' + location.host + '/firstaid/send');\n\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":570,"y":160,"wires":[["598c3baa.7efd84"]]},{"id":"7502bae2.b01d14","type":"function","z":"b8bd1cc3.4827","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":300,"wires":[["782036fe.ccf868"]]},{"id":"782036fe.ccf868","type":"function","z":"b8bd1cc3.4827","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":300,"wires":[["8be4aba0.feaed8"]]},{"id":"347129a0.c27516","type":"comment","z":"d0e2bfbf.dfe3f","name":"Put Unprocessed On the Webpage","info":"","x":200,"y":240,"wires":[]},{"id":"50ca75a6.b021bc","type":"template","z":"d0e2bfbf.dfe3f","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0'\nORDER BY `rxTime` ASC \nLIMIT 25;\n\n","output":"str","x":290,"y":280,"wires":[["fd8d56d.e7aa7a8"]]},{"id":"2ed84fa4.796ce","type":"websocket out","z":"d0e2bfbf.dfe3f","name":"","server":"4d6db4a9.f35a1c","client":"","x":1330,"y":280,"wires":[]},{"id":"fd8d56d.e7aa7a8","type":"sqlite","z":"d0e2bfbf.dfe3f","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":470,"y":280,"wires":[["95edf698.93a828"]]},{"id":"202c524f.39489e","type":"template","z":"d0e2bfbf.dfe3f","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n{{#payload}}\n\n
\n {{{part1}}}\n
\n {{{part2}}} {{sender}}\n
\n {{{elapsed}}}\n \n
\n{{/payload}}\n\n
","output":"str","x":1150,"y":280,"wires":[["2ed84fa4.796ce"]]},{"id":"c46324a1.00d1e8","type":"websocket in","z":"d0e2bfbf.dfe3f","name":"","server":"c2e44b88.6a4e78","client":"","x":140,"y":440,"wires":[["942c85de.4a0538"]]},{"id":"3d3f5ebf.ecd7d2","type":"comment","z":"d0e2bfbf.dfe3f","name":"Hide Message on Click","info":"","x":160,"y":400,"wires":[]},{"id":"f28c0a0f.a04258","type":"template","z":"d0e2bfbf.dfe3f","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":420,"wires":[["12068c22.433ac4"]]},{"id":"12068c22.433ac4","type":"sqlite","z":"d0e2bfbf.dfe3f","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":420,"wires":[["5f3d896d.781188"]]},{"id":"5f3d896d.781188","type":"link out","z":"d0e2bfbf.dfe3f","name":"","links":["13c2aaaa.74d295","7b129f21.76ae3","f72ff61b.e8d618","f8b2c7bc.b77368"],"x":915,"y":420,"wires":[]},{"id":"aa42f2de.8b38c","type":"change","z":"d0e2bfbf.dfe3f","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":420,"wires":[["f28c0a0f.a04258"]]},{"id":"942c85de.4a0538","type":"switch","z":"d0e2bfbf.dfe3f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":440,"wires":[["aa42f2de.8b38c"],["adc7e162.e371e"]]},{"id":"7b129f21.76ae3","type":"link in","z":"d0e2bfbf.dfe3f","name":"Received Page","links":["c94a9d48.9c2c","adc7e162.e371e","5f3d896d.781188"],"x":155,"y":320,"wires":[["50ca75a6.b021bc"]]},{"id":"95edf698.93a828","type":"function","z":"d0e2bfbf.dfe3f","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":280,"wires":[["6a1eea5b.f38504"]]},{"id":"adc7e162.e371e","type":"link out","z":"d0e2bfbf.dfe3f","name":"","links":["7b129f21.76ae3"],"x":375,"y":460,"wires":[]},{"id":"68f940a1.aa25a","type":"http in","z":"d0e2bfbf.dfe3f","name":"","url":"/table","method":"get","upload":false,"swaggerDoc":"","x":120,"y":160,"wires":[["1e6521b9.49276e"]]},{"id":"dd7be086.62c","type":"comment","z":"d0e2bfbf.dfe3f","name":"Build Webpage","info":"","x":140,"y":20,"wires":[]},{"id":"41327f62.b2296","type":"http response","z":"d0e2bfbf.dfe3f","name":"","statusCode":"201","headers":{},"x":760,"y":140,"wires":[]},{"id":"4d8cff25.18cce","type":"template","z":"d0e2bfbf.dfe3f","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n\n\n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":630,"y":140,"wires":[["41327f62.b2296"]]},{"id":"b20ec190.c8d73","type":"change","z":"d0e2bfbf.dfe3f","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Table Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":140,"wires":[["c20fda87.cc67c8"]]},{"id":"2efce273.a5ca5e","type":"inject","z":"d0e2bfbf.dfe3f","name":"","topic":"","payload":"","payloadType":"str","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":280,"wires":[["50ca75a6.b021bc"]]},{"id":"c20fda87.cc67c8","type":"template","z":"d0e2bfbf.dfe3f","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/table/receive');\n var send = new WebSocket('ws://' + location.host + '/table/send');\n\n \n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":510,"y":140,"wires":[["4d8cff25.18cce"]]},{"id":"6a1eea5b.f38504","type":"function","z":"d0e2bfbf.dfe3f","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":280,"wires":[["a93183fc.ce466"]]},{"id":"a93183fc.ce466","type":"function","z":"d0e2bfbf.dfe3f","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":990,"y":280,"wires":[["202c524f.39489e"]]},{"id":"b8fb71d2.ee132","type":"comment","z":"53e35596.381c0c","name":"Put Quick Page On the Webpage","info":"","x":190,"y":320,"wires":[]},{"id":"c4849d.0bb81b6","type":"template","z":"53e35596.381c0c","name":"Select Quick Page Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `quick_page`;","output":"str","x":230,"y":360,"wires":[["552dba34.1f3124"]]},{"id":"7b33fb9a.d5c6e4","type":"websocket out","z":"53e35596.381c0c","name":"","server":"b03253f0.29251","client":"","x":790,"y":360,"wires":[]},{"id":"552dba34.1f3124","type":"sqlite","z":"53e35596.381c0c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":430,"y":360,"wires":[["8ac6b75b.594968"]]},{"id":"8ac6b75b.594968","type":"template","z":"53e35596.381c0c","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n{{#payload}}\n\n
\n {{{content}}}\n
\n to \n
\n Pager {{pagerNumber}}:{{sysID}}\n
\n{{/payload}}\n\n
","output":"str","x":590,"y":360,"wires":[["7b33fb9a.d5c6e4"]]},{"id":"cfc68d0c.62c43","type":"websocket in","z":"53e35596.381c0c","name":"","server":"25343a6d.90cb36","client":"","x":160,"y":540,"wires":[["c9e38e8e.3efc5"]]},{"id":"68b8882e.ea23b8","type":"comment","z":"53e35596.381c0c","name":"Send Message on Click","info":"","x":160,"y":440,"wires":[]},{"id":"46042ba6.d8f454","type":"template","z":"53e35596.381c0c","name":"Get Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `quick_page`\nWHERE `index` = {{payload}};","output":"str","x":600,"y":460,"wires":[["cc8e6c1f.215e6"]]},{"id":"cc8e6c1f.215e6","type":"sqlite","z":"53e35596.381c0c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":750,"y":460,"wires":[["7b2e6691.d4da08","b52928ed.f9b338"]]},{"id":"e0895cf.e2cc3a","type":"change","z":"53e35596.381c0c","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":460,"wires":[["46042ba6.d8f454"]]},{"id":"a548061f.54f0e8","type":"switch","z":"53e35596.381c0c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":480,"wires":[["e0895cf.e2cc3a"],["17234e1e.8eeca2"]]},{"id":"b28b9e2d.bfccc","type":"link in","z":"53e35596.381c0c","name":"Received Page","links":["17234e1e.8eeca2","35084556.d6290a"],"x":75,"y":360,"wires":[["c4849d.0bb81b6"]]},{"id":"17234e1e.8eeca2","type":"link out","z":"53e35596.381c0c","name":"","links":["b28b9e2d.bfccc"],"x":415,"y":500,"wires":[]},{"id":"6ce28d0.bdfa474","type":"http in","z":"53e35596.381c0c","name":"","url":"/quickpage","method":"get","upload":false,"swaggerDoc":"","x":120,"y":240,"wires":[["7530d890.2f9e38"]]},{"id":"49c037c6.8dc4a8","type":"comment","z":"53e35596.381c0c","name":"Build Webpage","info":"","x":140,"y":20,"wires":[]},{"id":"1ec8e1d3.e5803e","type":"http response","z":"53e35596.381c0c","name":"","statusCode":"201","headers":{},"x":800,"y":220,"wires":[]},{"id":"89919094.304b","type":"template","z":"53e35596.381c0c","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n\n \n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":670,"y":220,"wires":[["1ec8e1d3.e5803e"]]},{"id":"22601c7c.9bf294","type":"change","z":"53e35596.381c0c","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Quick Page","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":220,"wires":[["6a9ce3d9.08b75c"]]},{"id":"6a9ce3d9.08b75c","type":"template","z":"53e35596.381c0c","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/quickpage/receive');\n var send = new WebSocket('ws://' + location.host + '/quickpage/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":550,"y":220,"wires":[["89919094.304b"]]},{"id":"297421bf.20dd2e","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":80,"wires":[["778882cf.77930c"]]},{"id":"9d24fe8d.65aec","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE \"quick_page\" ( `index` INTEGER PRIMARY KEY AUTOINCREMENT, `pagerNumber` INTEGER, `sysID` INTEGER, `content` TEXT, `FP` TEXT )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":80,"wires":[["297421bf.20dd2e"]]},{"id":"778882cf.77930c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":80,"wires":[]},{"id":"76d7a70a.2fcec8","type":"comment","z":"ba76d305.cf8ad","name":"Log","info":"","x":490,"y":40,"wires":[]},{"id":"de9a1c50.0387e","type":"comment","z":"ba76d305.cf8ad","name":"Quick Page","info":"","x":1230,"y":40,"wires":[]},{"id":"5380aeca.f0398","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":120,"wires":[]},{"id":"d2a7806a.847fb","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":120,"wires":[["5380aeca.f0398"]]},{"id":"6727d5f9.79503c","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":120,"wires":[["d2a7806a.847fb"]]},{"id":"13dadbb0.3bee54","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":240,"wires":[["881c792.ec4a688"]]},{"id":"42fa1f34.f12d1","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":240,"wires":[["13dadbb0.3bee54"]]},{"id":"71f5ce83.ae175","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":160,"wires":[]},{"id":"30d4a402.d0012c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":160,"wires":[["71f5ce83.ae175"]]},{"id":"fe233e7d.a51e","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":160,"wires":[["30d4a402.d0012c"]]},{"id":"881c792.ec4a688","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":240,"wires":[]},{"id":"ee95f3c1.3f828","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":200,"wires":[]},{"id":"a4a3a07e.f78fa","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":200,"wires":[["ee95f3c1.3f828"]]},{"id":"2d34ef10.10738","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'quick_page';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":980,"y":200,"wires":[["a4a3a07e.f78fa"]]},{"id":"7b2e6691.d4da08","type":"template","z":"53e35596.381c0c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.0.pagerNumber}},{{payload.0.sysID}},{{{payload.0.content}}}\\f{{{payload.0.FP}}}","output":"str","x":900,"y":460,"wires":[["3cb58cbd.165284","e1963d60.f46e6"]]},{"id":"3cb58cbd.165284","type":"serial out","z":"53e35596.381c0c","name":"","serial":"5d6eb2f4.fc698c","x":1110,"y":460,"wires":[]},{"id":"184ea2f9.fe199d","type":"switch","z":"e3cbac21.52804","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"\\x19A(\\d*)d\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\x0c?(.*)?\\x18|\\x19A(\\d*)d(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?\\x18|RECV,4,(\\d*),\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\%?0?C?(.*)?|RECV,4,(\\d*),(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?","vt":"str","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":240,"wires":[["1cbf532e.685a3d"],[]]},{"id":"bfe6947b.66f8f8","type":"template","z":"53e35596.381c0c","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'content', 'msgPart1', 'msgPart2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.0.pagerNumber}}', '{{payload.0.sysID}}', '0', '{{payload.0.content}}', 'n/a', 'n/a', '{{payload.0.sender}}','{{timestamp}}', 'Quick Page', '{{timestamp}}', '{{{payload.0.FP}}}', 'n/a','T');","output":"str","x":1040,"y":520,"wires":[["3c1f3e87.640562"]]},{"id":"3c1f3e87.640562","type":"sqlite","z":"53e35596.381c0c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":520,"wires":[["80365a9f.6e5ef8"]]},{"id":"b52928ed.f9b338","type":"change","z":"53e35596.381c0c","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":520,"wires":[["bfe6947b.66f8f8"]]},{"id":"80365a9f.6e5ef8","type":"link out","z":"53e35596.381c0c","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1335,"y":520,"wires":[]},{"id":"1bf9a4b6.f54f3b","type":"comment","z":"1c96dbb1.1bc354","name":"Put All On the Webpage","info":"","x":140,"y":320,"wires":[]},{"id":"40df00fd.261f1","type":"http response","z":"1c96dbb1.1bc354","name":"","statusCode":"201","headers":{},"x":760,"y":240,"wires":[]},{"id":"47e061c2.9cfec","type":"template","z":"1c96dbb1.1bc354","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `data`\nORDER BY `{{global.sort-by}}` {{global.direction}}","output":"str","x":450,"y":420,"wires":[["544d98ea.b79288"]]},{"id":"a7584546.9a1cb8","type":"websocket out","z":"1c96dbb1.1bc354","name":"","server":"32989c5a.d6ee14","client":"","x":1410,"y":420,"wires":[]},{"id":"8595684f.e6b5d8","type":"comment","z":"1c96dbb1.1bc354","name":"Build Webpage","info":"","x":100,"y":60,"wires":[]},{"id":"544d98ea.b79288","type":"sqlite","z":"1c96dbb1.1bc354","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":630,"y":420,"wires":[["958508cb.755b28"]]},{"id":"40e6251b.e6404c","type":"function","z":"1c96dbb1.1bc354","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":960,"y":420,"wires":[["3530697b.f604f6"]]},{"id":"bcfd7457.19e388","type":"link in","z":"1c96dbb1.1bc354","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","9b70e3c3.c129d","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","ce5be23d.4618f","64848176.9353c","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":175,"y":440,"wires":[["47e061c2.9cfec"]]},{"id":"ee469ce7.3e75a","type":"websocket in","z":"1c96dbb1.1bc354","name":"","server":"8ad92631.0da208","client":"","x":120,"y":360,"wires":[["dc337a0b.1d8a28"]]},{"id":"6763c15d.e3fa5","type":"template","z":"1c96dbb1.1bc354","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n\n\n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":630,"y":240,"wires":[["40df00fd.261f1"]]},{"id":"a74297ce.590ef8","type":"change","z":"1c96dbb1.1bc354","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Full Log","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":240,"wires":[["8e473da7.f3f4f"]]},{"id":"958508cb.755b28","type":"function","z":"1c96dbb1.1bc354","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":420,"wires":[["40e6251b.e6404c"]]},{"id":"3530697b.f604f6","type":"template","z":"1c96dbb1.1bc354","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Index
\n
Callpoint
\n
Message
\n
Receive Time
\n
Receive Date
\n
Status
\n
Status Time
\n
Status Date
\n
Export Time
\n
Export Date
\n
Recipient
\n
System ID
\n
Group
\n
Flash Pattern
\n
\n{{#payload}}\n
\n
{{index}}
\n
{{sender}}
\n
{{{part1}}}-{{{part2}}}
\n
{{displayTime}}
\n
{{displayDate}}
\n
{{status}}
\n
{{displayStatusTime}}
\n
{{displayStatusDate}}
\n
{{{displayExportedTime}}}
\n
{{{displayExportedDate}}}
\n
{{pagerNumber}}
\n
{{sysID}}
\n
{{group}}
\n
{{FP}}
\n
\n{{/payload}}","output":"str","x":1190,"y":420,"wires":[["a7584546.9a1cb8"]]},{"id":"8e473da7.f3f4f","type":"template","z":"1c96dbb1.1bc354","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/log-full/receive');\nvar send = new WebSocket('ws://' + location.host + '/log-full/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":510,"y":240,"wires":[["6763c15d.e3fa5"]]},{"id":"9e864380.21a48","type":"switch","z":"1c96dbb1.1bc354","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":360,"wires":[["f0d611c3.bfa1d"],["47e061c2.9cfec"]]},{"id":"f0d611c3.bfa1d","type":"change","z":"1c96dbb1.1bc354","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":360,"wires":[["1d5a046c.c6fa9c"]]},{"id":"1d5a046c.c6fa9c","type":"switch","z":"1c96dbb1.1bc354","name":"","property":"direction","propertyType":"global","rules":[{"t":"eq","v":"ASC","vt":"str"},{"t":"eq","v":"DESC","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":360,"wires":[["70b3cf79.3c274"],["aa735ccd.7575e"]]},{"id":"70b3cf79.3c274","type":"change","z":"1c96dbb1.1bc354","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":340,"wires":[["9b70e3c3.c129d"]]},{"id":"aa735ccd.7575e","type":"change","z":"1c96dbb1.1bc354","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"ASC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":380,"wires":[["9b70e3c3.c129d"]]},{"id":"9b70e3c3.c129d","type":"link out","z":"1c96dbb1.1bc354","name":"","links":["bcfd7457.19e388"],"x":1035,"y":360,"wires":[]},{"id":"38c97d52.720a32","type":"http in","z":"1c96dbb1.1bc354","name":"","url":"/log-full","method":"get","upload":false,"swaggerDoc":"","x":110,"y":260,"wires":[["ecde1301.2ebb3"]]},{"id":"577e3b25.879e44","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"index","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":240,"wires":[[]]},{"id":"b6c859b7.94b658","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":280,"wires":[[]]},{"id":"9da7d1fb.8f7cd","type":"http response","z":"b209c94d.26d798","name":"","statusCode":"201","headers":{},"x":760,"y":160,"wires":[]},{"id":"b3d8b7b0.5cd1d8","type":"comment","z":"b209c94d.26d798","name":"Build Webpage","info":"","x":120,"y":40,"wires":[]},{"id":"5e3e72a4.9cd99c","type":"template","z":"b209c94d.26d798","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n\n\n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":630,"y":160,"wires":[["9da7d1fb.8f7cd"]]},{"id":"14d14541.b18d6b","type":"template","z":"b209c94d.26d798","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/log-daily/receive');\nvar send = new WebSocket('ws://' + location.host + '/log-daily/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":510,"y":160,"wires":[["5e3e72a4.9cd99c"]]},{"id":"c6cb5bad.c0e8d8","type":"http in","z":"b209c94d.26d798","name":"","url":"/log-daily","method":"get","upload":false,"swaggerDoc":"","x":110,"y":180,"wires":[["5dda820c.bf5e2c"]]},{"id":"27fce5ac.018c5a","type":"change","z":"b209c94d.26d798","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Daily Log","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":160,"wires":[["14d14541.b18d6b"]]},{"id":"cd63b42b.c622b8","type":"switch","z":"e3cbac21.52804","name":"","property":"sysID","propertyType":"msg","rules":[{"t":"eq","v":"sysID","vt":"global"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":240,"wires":[["f2b86262.fdc9c"],[]]},{"id":"9ff12e3d.bf8a4","type":"inject","z":"dad6f0f1.28177","name":"Set Welcome Message","topic":"","payload":"WPROG,Capturecall","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":520,"y":300,"wires":[["734abd62.6c0054"]]},{"id":"ba2546c7.c3a838","type":"inject","z":"dad6f0f1.28177","name":"Set Pager Number on Pager","topic":"","payload":"CCPROG,1,0800080","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":500,"y":340,"wires":[["734abd62.6c0054"]]},{"id":"2e0a6b46.bba6d4","type":"inject","z":"dad6f0f1.28177","name":"Set All Page Number on Pager","topic":"","payload":"CCPROG,2,0807288","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":490,"y":380,"wires":[["734abd62.6c0054"]]},{"id":"45923828.f892f8","type":"inject","z":"dad6f0f1.28177","name":"Set System Code on Pager","topic":"","payload":"CCPROG,3,0800000","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":510,"y":420,"wires":[["734abd62.6c0054"]]},{"id":"aa834245.ef833","type":"inject","z":"60528a1b.f32364","name":"Settings","topic":"","payload":"[{\"Name\":\"Home\",\"Address\":\"/home\"},{\"Name\":\"Settings Menu\",\"Address\":\"/settings\"},{\"Name\":\"Log Out\",\"Address\":\"/login/clear\"}]","payloadType":"json","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":420,"y":980,"wires":[["fc768851.034bd8"]]},{"id":"fc768851.034bd8","type":"template","z":"60528a1b.f32364","name":"settings_list","field":"settings_list","fieldType":"global","format":"handlebars","syntax":"mustache","template":"\n
\n\n

","output":"str","x":570,"y":980,"wires":[[]]},{"id":"8701841e.83ae28","type":"comment","z":"60528a1b.f32364","name":"Set settings list","info":"","x":900,"y":980,"wires":[]},{"id":"9b687973.c1c618","type":"comment","z":"60528a1b.f32364","name":"Set Modules","info":"","x":730,"y":980,"wires":[]},{"id":"c1a00628.59b6f8","type":"http in","z":"38ad3d43.e07282","name":"","url":"/login","method":"get","upload":false,"swaggerDoc":"","x":140,"y":100,"wires":[["6192a8be.4d72c8"]]},{"id":"550b5a0f.5072d4","type":"comment","z":"38ad3d43.e07282","name":"Build Webpage","info":"","x":160,"y":60,"wires":[]},{"id":"c89bb567.c3cb18","type":"http response","z":"38ad3d43.e07282","name":"","statusCode":"","headers":{},"x":770,"y":120,"wires":[]},{"id":"2c769665.50ee0a","type":"template","z":"38ad3d43.e07282","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n \n \n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n \n
\n Please enter your Password:\n \n \n
\n\n
\n\n\n\n","output":"str","x":650,"y":120,"wires":[["c89bb567.c3cb18"]]},{"id":"25806f78.9cf92","type":"change","z":"38ad3d43.e07282","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Settings Login","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["32a07662.8f48aa"]]},{"id":"32a07662.8f48aa","type":"template","z":"38ad3d43.e07282","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/login/receive');\nvar send = new WebSocket('ws://' + location.host + '/login/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":530,"y":120,"wires":[["2c769665.50ee0a"]]},{"id":"d9b40d6b.4750d","type":"switch","z":"38ad3d43.e07282","name":"","property":"payload.password","propertyType":"msg","rules":[{"t":"eq","v":"Outtti5853","vt":"str"},{"t":"eq","v":"password","vt":"global"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":310,"y":240,"wires":[["af027ca6.8807c"],["78978698.738818"],["e7a85e8d.a40d2"]]},{"id":"feec4f17.d019f","type":"comment","z":"38ad3d43.e07282","name":"Handle Input from Webpage","info":"","x":200,"y":200,"wires":[]},{"id":"4212ad6a.fb9f04","type":"link in","z":"38ad3d43.e07282","name":"","links":["1154197f.e1f607","349faf1f.208a4","6376dfd7.0157b","81380517.b42f28","b88a2c28.954e5","bdc216af.c3bff8","d6762c10.0cdbe","d544b9ec.e25b78","48ed0abd.9ba044","3651a448.83f50c","6b3ad3e9.39b35c","14778f84.1ac3f"],"x":295,"y":140,"wires":[["25806f78.9cf92"]]},{"id":"67842090.6201b","type":"comment","z":"60528a1b.f32364","name":"Defaults","info":"* /sw,/hw,/fw - Used to set the versions shown on the settings pages\n* sysID - Used to set the system ID Filter\n* Modules - contains a JSON string used to set the Links to main pages and their displayed Names\n* Serial - Used to set the system serial number\n* Password - Used to set the default system password - 1234 at this time\n* Settings - contains a JSON string used to set the Links to settings pages and their displayed Names","x":1300,"y":360,"wires":[]},{"id":"e7a85e8d.a40d2","type":"change","z":"38ad3d43.e07282","name":"Redirect to /Login","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/login","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":280,"wires":[["c89bb567.c3cb18"]]},{"id":"78978698.738818","type":"function","z":"38ad3d43.e07282","name":"Make Admin","func":"msg.cookies = { admin: {\n value: true,\n maxAge: 300000\n }};\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":240,"wires":[["e7a85e8d.a40d2"]]},{"id":"aa135bce.84f318","type":"function","z":"38ad3d43.e07282","name":"Remove Admin","func":"msg.cookies = { };\nmsg.cookies[\"admin\"] = false;\nmsg.cookies[\"god\"] = false;\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":300,"wires":[["e7a85e8d.a40d2"]]},{"id":"d5467695.376cc8","type":"http in","z":"38ad3d43.e07282","name":"","url":"/login/submit","method":"get","upload":false,"swaggerDoc":"","x":160,"y":240,"wires":[["d9b40d6b.4750d"]]},{"id":"6192a8be.4d72c8","type":"switch","z":"38ad3d43.e07282","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":100,"wires":[["eb0b90cc.4383"],["25806f78.9cf92"]]},{"id":"eb0b90cc.4383","type":"link out","z":"38ad3d43.e07282","name":"back to menu","links":["53c094fc.bf043c"],"x":375,"y":60,"wires":[]},{"id":"aed19d60.1bcf1","type":"http in","z":"38ad3d43.e07282","name":"","url":"/login/clear","method":"get","upload":false,"swaggerDoc":"","x":160,"y":300,"wires":[["aa135bce.84f318"]]},{"id":"c070b318.2640f","type":"http in","z":"ce69645.1231098","name":"","url":"/settings","method":"get","upload":false,"swaggerDoc":"","x":110,"y":140,"wires":[["e8bbabec.1eb078"]]},{"id":"1ce62238.e590ce","type":"comment","z":"ce69645.1231098","name":"Build Webpage","info":"","x":120,"y":100,"wires":[]},{"id":"e4466f0c.3d898","type":"http response","z":"ce69645.1231098","name":"","statusCode":"","headers":{},"x":1010,"y":120,"wires":[]},{"id":"8d29f36c.245ee","type":"template","z":"ce69645.1231098","name":"HTML Engineer","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n IP: {{global.ip}}
\n Serial: {{global.serial}}
\n Software Version: {{global.sw}}
\n Hardware Version: {{global.hw}}
\n Firmware Version: {{global.fw}}
\n
\n SMS Connected? : {{global.SMS_Connected}}
\n RX1 Connected? : {{global.TRX1_Connected}}
\n TX7470 Connected? : {{global.TX7470_Connected}}\n
\n \n
\n\n
\n

\n Set Aliases\n

\n

\nSet Quick Page\n

\n

\nSystem Settings\n
\n

\n

\nFlash Pattern Effects\n

\n

\nSMS Settings\n

\n \n

\nEngineering\n

\n\n\n
\n\n\n\n","output":"str","x":840,"y":100,"wires":[["e4466f0c.3d898"]]},{"id":"9a894be0.c3ef68","type":"change","z":"ce69645.1231098","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Settings Menu","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["301ebffb.48325"]]},{"id":"301ebffb.48325","type":"template","z":"ce69645.1231098","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/settings/receive');\nvar send = new WebSocket('ws://' + location.host + '/settings/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":530,"y":120,"wires":[["2c156ca7.752364"]]},{"id":"e8bbabec.1eb078","type":"switch","z":"ce69645.1231098","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":140,"wires":[["9a894be0.c3ef68"],["81380517.b42f28"]]},{"id":"81380517.b42f28","type":"link out","z":"ce69645.1231098","name":"back to settings","links":["4212ad6a.fb9f04","7e3a0a42.252994"],"x":375,"y":160,"wires":[]},{"id":"53c094fc.bf043c","type":"link in","z":"ce69645.1231098","name":"","links":["eb0b90cc.4383","cb188988.089818"],"x":155,"y":180,"wires":[["e8bbabec.1eb078"]]},{"id":"af027ca6.8807c","type":"function","z":"38ad3d43.e07282","name":"Make Admin (No Timeout)","func":"msg.cookies = { admin: {\n value: true\n },god: {\n value: true\n }};\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":200,"wires":[["e7a85e8d.a40d2"]]},{"id":"4996d159.b234a","type":"http in","z":"69336e92.97cdb","name":"","url":"/system","method":"get","upload":false,"swaggerDoc":"","x":110,"y":100,"wires":[["7c4201a8.b3066"]]},{"id":"187a93b1.32310c","type":"comment","z":"69336e92.97cdb","name":"Build Webpage","info":"","x":120,"y":60,"wires":[]},{"id":"199c7ecc.549871","type":"http response","z":"69336e92.97cdb","name":"","statusCode":"","headers":{},"x":750,"y":80,"wires":[]},{"id":"cacfd3ca.9f14e","type":"template","z":"69336e92.97cdb","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n \n
\n
\nLog eMail Address:\n\n
\n
\n\n
\n
\n\n\n
\n
\nSet System Time (date and time):\n \n \n
\n
\n\n
\n\n
\n
\nBeep Style:\n\n\n
\n
\n\n
\n \n
\n
\nChange Password:\n \n
\n
\n
\n\n
\n
\n\n\n\nSet WIFI (Caution Do NOT Adjust Whilst Using WIFI,Reboot to Take Effect)\n
\n
\nSSID:
\nPassword: \n
\n
\n\n\n
\n
\nClear Exported Data (this cannot be undone):\n
\n
\n\n
\n \n
\n
\nReset Entire Database (this cannot be undone):\n
\n
\n\n
\n
\n\n \n \n\n\n\n
\n
\nShutdown CaptureCall. WARNING you must reconnect power to re-start\n
\n
\n
\n\n\n","output":"str","x":630,"y":80,"wires":[["199c7ecc.549871"]]},{"id":"1e8420df.7c031f","type":"change","z":"69336e92.97cdb","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall System Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":80,"wires":[["98ed7ab7.2cd148"]]},{"id":"98ed7ab7.2cd148","type":"template","z":"69336e92.97cdb","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/system/receive');\nvar send = new WebSocket('ws://' + location.host + '/system/send');\n\n\nvar msg = 0; // Make Incoming WS \n\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n function load(){\n startTime();\n\n }\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n\n}","output":"str","x":510,"y":80,"wires":[["cacfd3ca.9f14e"]]},{"id":"362fd6bc.ba6c3a","type":"comment","z":"69336e92.97cdb","name":"Handle Input from Webpage","info":"","x":160,"y":160,"wires":[]},{"id":"7c4201a8.b3066","type":"switch","z":"69336e92.97cdb","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":100,"wires":[["1e8420df.7c031f"],["b88a2c28.954e5"]]},{"id":"b88a2c28.954e5","type":"link out","z":"69336e92.97cdb","name":"back to settings","links":["4212ad6a.fb9f04","7e3a0a42.252994"],"x":355,"y":120,"wires":[]},{"id":"125ae207.80eb3e","type":"debug","z":"69336e92.97cdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":370,"y":240,"wires":[]},{"id":"c7c45d8f.12889","type":"http in","z":"69336e92.97cdb","name":"","url":"/system","method":"post","upload":false,"swaggerDoc":"","x":110,"y":360,"wires":[["125ae207.80eb3e","c9f6a9fb.0edea8","f050cc3.7a73d3","c8a190e9.9de6f","5d7de49b.eeb99c","189c8a46.070806","7de72cac.c0aa54","b469ec62.d0cd9","873751a0.b7a04","94c17315.5561f"]]},{"id":"99040fdf.f6567","type":"http response","z":"69336e92.97cdb","name":"","statusCode":"","headers":{},"x":490,"y":200,"wires":[]},{"id":"c9f6a9fb.0edea8","type":"change","z":"69336e92.97cdb","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/system","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":200,"wires":[["99040fdf.f6567"]]},{"id":"f050cc3.7a73d3","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.Oldpassword","propertyType":"msg","rules":[{"t":"eq","v":"password","vt":"global"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":280,"wires":[["fb03dcb8.2779c"]]},{"id":"fb03dcb8.2779c","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.Newpassword","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":280,"wires":[["d2cffd80.616a"]]},{"id":"c8a190e9.9de6f","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.resetLog","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":320,"wires":[["ecbc89e0.affb98"]]},{"id":"50f38ebe.b90e6","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"DELETE FROM 'data';","name":"CaptureCall","x":1230,"y":320,"wires":[["8f47f31.57d841"]]},{"id":"8f47f31.57d841","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"DELETE FROM sqlite_sequence WHERE name = 'data';","name":"CaptureCall","x":1390,"y":320,"wires":[[]]},{"id":"d34e5b49.7bf368","type":"exec","z":"69336e92.97cdb","command":"sudo ./node-red-static/bin/set_time.sh","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":750,"y":440,"wires":[[],[],[]]},{"id":"5d7de49b.eeb99c","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.dtime","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":440,"wires":[["78bc6495.20be4c"]]},{"id":"78bc6495.20be4c","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.dtime","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":440,"wires":[["d34e5b49.7bf368"]]},{"id":"dd4326a.4c6d8d8","type":"comment","z":"60528a1b.f32364","name":"Initiate on Boot","info":"Sets Global Variables from JSON DB\n\n* Set IP Address- Gets the system IP address, adds it to global.ip and also sets /ip in the json DB\n* Set system ID - Gets system ID from json DB and sets global.sysID - This is used to filter messages\n* Set Email Address - Gets last email from json DB and sets global.to\n* Add Power on Message to DB - Writes to DB when system Powers on\n* Set Serial Number - Gets Serial from json DB and sets global.serial\n* Set Software Version - Gets S/W Version from json DB and sets global.sw\n* Set Hardware Version - Gets H/W Version from json DB and sets global.hw\n* Set Firmware Version - Gets F/W Version from json DB and sets global.fw\n* Set Password - Gets system Password from json DB and sets global.password\n* Set Left Header Links - Gets json List of modules for main pages from json DB and sets global.left. Used to set contents list on main pages\n* Set Settings Links - Gets json List of settings pages for settings pages from json DB and sets global.setings_list. Used to set contents list on settings pages\n* Set sort by - Sets default sort coloum to \"index\" on boot\n* Set sort direction - Sets default sort direction to \"ASC\" on boot","x":160,"y":100,"wires":[]},{"id":"8c59e2f4.29158","type":"file","z":"69336e92.97cdb","name":"","filename":"/etc/wpa_supplicant/wpa_supplicant.conf","appendNewline":false,"createDir":true,"overwriteFile":"true","x":720,"y":540,"wires":[[]]},{"id":"9b1e3c99.05267","type":"template","z":"23c43518.b3ff0a","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/display/receive');\nvar send = new WebSocket('ws://' + location.host + '/display/send');\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":550,"y":120,"wires":[["9b9c90b8.58988"]]},{"id":"73f17ab3.8171b4","type":"websocket out","z":"e3cbac21.52804","name":"","server":"4f629706.3fbcb8","client":"","x":1150,"y":180,"wires":[]},{"id":"189c8a46.070806","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.beep","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":500,"wires":[["d3b7c6b5.1adc78"]]},{"id":"d3b7c6b5.1adc78","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"beep","pt":"global","to":"payload.beep","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":500,"wires":[["d4b6378c.272a18"]]},{"id":"e8a93519.478388","type":"switch","z":"e3cbac21.52804","name":"","property":"beep","propertyType":"global","rules":[{"t":"neq","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1010,"y":180,"wires":[["73f17ab3.8171b4"]]},{"id":"1fcc7681.3b52f9","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer","method":"get","upload":false,"swaggerDoc":"","x":110,"y":100,"wires":[["ae6afdf1.ec95"]]},{"id":"cb5867c.68a8f98","type":"comment","z":"3c78672c.9cb1f8","name":"Build Webpage","info":"","x":120,"y":60,"wires":[]},{"id":"a2067d6d.88795","type":"http response","z":"3c78672c.9cb1f8","name":"","statusCode":"","headers":{},"x":850,"y":60,"wires":[]},{"id":"37cbd25.2782f2e","type":"template","z":"3c78672c.9cb1f8","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n Override User Password\n
\nNew Password:
\n
\n
\n\n
\nSystem ID:
\n
\n
\n\nSW,HW,FW Versions\n
\n
\nS/W Version:

\nH/W Version:

\nF/W Version:

\nSerial Number:
\n
\n
\n\nModules \n
\n
\n Dynamic Display
\n First Aid
\n Conference Room
\n Table Display
\n Daily Log
\n Full Log
\n Quick Page
\n Free Page
\n Browser Page
\n Split Screen
\n Big Display
\n Bar Display Split
\n Export
\n \n
\n\nHome Page \n
\n
\n Dynamic Display
\n First Aid
\n Conference Room
\n Table Display
\n Daily Log
\n Full Log
\n Quick Page
\n Free Page
\n Browser Page
\n Split Screen
\n Big
\nLocation Split
\n Export
\n \n
\n\n
\n\n\n\n","output":"str","x":730,"y":60,"wires":[["a2067d6d.88795"]]},{"id":"fa3ed0c3.ed4f2","type":"change","z":"3c78672c.9cb1f8","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"Engineer Settings (You Shouldnt Be here!!)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":60,"wires":[["5399ea08.e994d4"]]},{"id":"5399ea08.e994d4","type":"template","z":"3c78672c.9cb1f8","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/engineer/receive');\nvar send = new WebSocket('ws://' + location.host + '/engineer/send');\n\n\nvar msg = 0; // Make Incoming WS \n\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n function load(){\n startTime();\n\n\n }\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n\n}\n","output":"str","x":610,"y":60,"wires":[["37cbd25.2782f2e"]]},{"id":"7cdf9f1.64cb96","type":"comment","z":"3c78672c.9cb1f8","name":"Handle Input from Webpage","info":"","x":160,"y":180,"wires":[]},{"id":"ae6afdf1.ec95","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":100,"wires":[["955921b8.9204b"],["6a4a330d.caa02c"]]},{"id":"6a4a330d.caa02c","type":"link out","z":"3c78672c.9cb1f8","name":"back to settings","links":["4212ad6a.fb9f04"],"x":475,"y":100,"wires":[]},{"id":"50515aa1.2eb434","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":350,"y":220,"wires":[]},{"id":"4542c4dd.010acc","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer","method":"post","upload":false,"swaggerDoc":"","x":120,"y":380,"wires":[["50515aa1.2eb434","c015747.3acb388","43cb6fdc.1deb8","94144d51.57536","8c38994d.e15088","b63c9f87.5f014","5a8a591e.ae8e38","a7cda32c.2c3ea"]]},{"id":"b2ea038a.746bf","type":"http response","z":"3c78672c.9cb1f8","name":"","statusCode":"","headers":{},"x":490,"y":500,"wires":[]},{"id":"c015747.3acb388","type":"change","z":"3c78672c.9cb1f8","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/engineer","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":500,"wires":[["b2ea038a.746bf"]]},{"id":"43cb6fdc.1deb8","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.Newpassword","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":300,"wires":[["8d460834.a08b98"]]},{"id":"8d460834.a08b98","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"password","pt":"global","to":"payload.Newpassword","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":300,"wires":[["4fb7501b.1e92b"]]},{"id":"955921b8.9204b","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"req.cookies.god","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":80,"wires":[["fa3ed0c3.ed4f2"],["6a4a330d.caa02c"]]},{"id":"94144d51.57536","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.sw","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":340,"wires":[["2ecb85ed.adc67a"]]},{"id":"8c38994d.e15088","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.hw","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":380,"wires":[["b054030c.77671"]]},{"id":"b63c9f87.5f014","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.fw","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":420,"wires":[["12fa8d82.9467a2"]]},{"id":"5a8a591e.ae8e38","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.serial","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":460,"wires":[["3b656b80.fb4db4"]]},{"id":"94ec7853.b41548","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer/modules","method":"post","upload":false,"swaggerDoc":"","x":150,"y":620,"wires":[["c015747.3acb388","eb8a0340.f959c","149a9733.581029"]]},{"id":"7de72cac.c0aa54","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.SSID","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":540,"wires":[["e1a70dd2.314ae"]]},{"id":"e1a70dd2.314ae","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1ap_scan=1fast_reauth=1country=GBnetwork={\tssid=\"{{SSID}}\"\tpsk=\"{{wifiPassword}}\"}","output":"str","x":480,"y":540,"wires":[["8c59e2f4.29158"]]},{"id":"eb8a0340.f959c","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.modules","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":620,"wires":[["f73fccf0.915ef"]]},{"id":"f73fccf0.915ef","type":"split","z":"3c78672c.9cb1f8","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":530,"y":620,"wires":[["7dd493ab.1e829c"]]},{"id":"7dd493ab.1e829c","type":"split","z":"3c78672c.9cb1f8","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":650,"y":620,"wires":[["b7556597.feb648"]]},{"id":"b7556597.feb648","type":"join","z":"3c78672c.9cb1f8","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":"num","reduceFixup":"","x":770,"y":620,"wires":[["4e8b463d.b7a8e8"]]},{"id":"4e8b463d.b7a8e8","type":"join","z":"3c78672c.9cb1f8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":890,"y":620,"wires":[["a914fc2c.03001","30a21c3d.2546d4"]]},{"id":"a914fc2c.03001","type":"template","z":"3c78672c.9cb1f8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[{{#payload}}{\"Name\": \"{{0}}\",\"Address\": \"{{1}}\"},{{/payload}}{\"Name\": \"Settings\",\"Address\": \"login\"}]","output":"str","x":1020,"y":620,"wires":[["b3351a4d.0d92c8","a1c2cf8c.f9e76","e8d7c8d7.9a90f8"]]},{"id":"6768ce45.ac79b","type":"template","z":"3c78672c.9cb1f8","name":"Left Header","field":"left","fieldType":"global","format":"handlebars","syntax":"mustache","template":"
\n\n

","output":"str","x":1310,"y":620,"wires":[[]]},{"id":"b3351a4d.0d92c8","type":"json","z":"3c78672c.9cb1f8","name":"","property":"payload","action":"","pretty":false,"x":1150,"y":620,"wires":[["6768ce45.ac79b","302cfd77.c37b22"]]},{"id":"302cfd77.c37b22","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1310,"y":580,"wires":[]},{"id":"e27d3777.8cf898","type":"switch","z":"b8bd1cc3.4827","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":280,"y":180,"wires":[["4d7773b3.0108ec"],["7eec4d28.128ec4"]]},{"id":"7eec4d28.128ec4","type":"link out","z":"b8bd1cc3.4827","name":"","links":["f13a1f16.82872"],"x":415,"y":200,"wires":[]},{"id":"6d3d48bb.e324b8","type":"debug","z":"b8bd1cc3.4827","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":220,"wires":[]},{"id":"30a21c3d.2546d4","type":"split","z":"3c78672c.9cb1f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1000,"y":660,"wires":[["17fbd4b7.b3e2db"]]},{"id":"17fbd4b7.b3e2db","type":"split","z":"3c78672c.9cb1f8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1130,"y":660,"wires":[["a821f15.e4ab71"]]},{"id":"a821f15.e4ab71","type":"join","z":"3c78672c.9cb1f8","name":"","mode":"custom","build":"string","property":"payload.1","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1250,"y":660,"wires":[["93b50442.d6ff88"]]},{"id":"93b50442.d6ff88","type":"join","z":"3c78672c.9cb1f8","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":1370,"y":660,"wires":[["6d78fc51.e4be64"]]},{"id":"6d78fc51.e4be64","type":"template","z":"3c78672c.9cb1f8","name":"","field":"modules","fieldType":"global","format":"handlebars","syntax":"mustache","template":"/{{{payload}}}","output":"str","x":1500,"y":660,"wires":[[]]},{"id":"1e6521b9.49276e","type":"switch","z":"d0e2bfbf.dfe3f","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":160,"wires":[["b20ec190.c8d73"],["e9c91e07.38088"]]},{"id":"e9c91e07.38088","type":"link out","z":"d0e2bfbf.dfe3f","name":"","links":["f13a1f16.82872"],"x":355,"y":180,"wires":[]},{"id":"815b7467.abb828","type":"switch","z":"23c43518.b3ff0a","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"/display","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":120,"wires":[["5e777687.bf0378"],["c6b24bdc.0d6158"]]},{"id":"c6b24bdc.0d6158","type":"link out","z":"23c43518.b3ff0a","name":"","links":["f13a1f16.82872"],"x":335,"y":160,"wires":[]},{"id":"5dda820c.bf5e2c","type":"switch","z":"b209c94d.26d798","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":180,"wires":[["27fce5ac.018c5a"],["d2ce817e.0c903"]]},{"id":"d2ce817e.0c903","type":"link out","z":"b209c94d.26d798","name":"","links":["f13a1f16.82872"],"x":355,"y":200,"wires":[]},{"id":"ecde1301.2ebb3","type":"switch","z":"1c96dbb1.1bc354","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":260,"wires":[["a74297ce.590ef8"],["70722b52.c7b7d4"]]},{"id":"70722b52.c7b7d4","type":"link out","z":"1c96dbb1.1bc354","name":"","links":["f13a1f16.82872"],"x":355,"y":280,"wires":[]},{"id":"7530d890.2f9e38","type":"switch","z":"53e35596.381c0c","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":240,"wires":[["22601c7c.9bf294"],["ce2ef575.3ca4f8"]]},{"id":"ce2ef575.3ca4f8","type":"link out","z":"53e35596.381c0c","name":"","links":["f13a1f16.82872"],"x":395,"y":260,"wires":[]},{"id":"9a8592b4.48574","type":"http in","z":"da0e8c29.a0583","name":"","url":"/freepage","method":"get","upload":false,"swaggerDoc":"","x":150,"y":280,"wires":[["28ed18d2.41fe48"]]},{"id":"193f6c.ae4d9094","type":"comment","z":"da0e8c29.a0583","name":"Build Webpage","info":"","x":160,"y":60,"wires":[]},{"id":"96c00b4.7fb27f8","type":"http response","z":"da0e8c29.a0583","name":"","statusCode":"201","headers":{},"x":820,"y":260,"wires":[]},{"id":"58f43d6a.217ba4","type":"template","z":"da0e8c29.a0583","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n\n \n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n \n
\nMessage:
\nPager Number:
\n\n
\n
\n\n
\n\n\n\n","output":"str","x":690,"y":260,"wires":[["96c00b4.7fb27f8"]]},{"id":"a549a41f.be52a8","type":"change","z":"da0e8c29.a0583","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Free Page","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":260,"wires":[["2d6935b5.0e1e5a"]]},{"id":"2d6935b5.0e1e5a","type":"template","z":"da0e8c29.a0583","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"\nvar msg = 0; // Make Incoming WS Global\n\n\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":570,"y":260,"wires":[["58f43d6a.217ba4"]]},{"id":"b5c989c8.493098","type":"template","z":"da0e8c29.a0583","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg}}}","output":"str","x":580,"y":440,"wires":[["8df845ff.456a78"]]},{"id":"8df845ff.456a78","type":"serial out","z":"da0e8c29.a0583","name":"","serial":"5d6eb2f4.fc698c","x":790,"y":440,"wires":[]},{"id":"32d66138.55bfde","type":"template","z":"da0e8c29.a0583","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `DATA` ('capcode', 'pagerNumber', 'sysID', 'group', 'content', 'msgPart1', 'msgPart2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0', '{{payload.msg}}', 'n/a', 'n/a', '0','{{timestamp}}', 'Free Page', '{{timestamp}}', 'n/a', 'n/a','T');","output":"str","x":720,"y":480,"wires":[["1a95ace0.4a9ab3"]]},{"id":"1a95ace0.4a9ab3","type":"sqlite","z":"da0e8c29.a0583","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":910,"y":480,"wires":[["5ce459da.1e66f8"]]},{"id":"8b3e4b35.77b2b8","type":"change","z":"da0e8c29.a0583","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":480,"wires":[["32d66138.55bfde"]]},{"id":"5ce459da.1e66f8","type":"link out","z":"da0e8c29.a0583","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1015,"y":480,"wires":[]},{"id":"28ed18d2.41fe48","type":"switch","z":"da0e8c29.a0583","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":280,"wires":[["a549a41f.be52a8"],["1bdee69f.d69879"]]},{"id":"1bdee69f.d69879","type":"link out","z":"da0e8c29.a0583","name":"","links":["f13a1f16.82872"],"x":415,"y":300,"wires":[]},{"id":"4266164c.a16568","type":"http in","z":"da0e8c29.a0583","name":"","url":"/freepage","method":"post","upload":false,"swaggerDoc":"","x":160,"y":460,"wires":[["98e4013d.1c2f1","b3ff9920.1c52c8"]]},{"id":"98e4013d.1c2f1","type":"switch","z":"da0e8c29.a0583","name":"","property":"payload.msg","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":460,"wires":[["8dd98e0a.18474"]]},{"id":"8dd98e0a.18474","type":"switch","z":"da0e8c29.a0583","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":460,"wires":[["b5c989c8.493098","8b3e4b35.77b2b8"]]},{"id":"85475c00.6943d8","type":"http response","z":"da0e8c29.a0583","name":"","statusCode":"","headers":{},"x":490,"y":400,"wires":[]},{"id":"b3ff9920.1c52c8","type":"change","z":"da0e8c29.a0583","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/freepage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":400,"wires":[["85475c00.6943d8"]]},{"id":"8855b97e.ed5368","type":"http in","z":"d0562e73.de681","name":"","url":"/setFP","method":"get","upload":false,"swaggerDoc":"","x":110,"y":80,"wires":[["4f94a092.61ad8"]]},{"id":"715fcf0c.2295f","type":"comment","z":"d0562e73.de681","name":"Build Webpage","info":"","x":120,"y":40,"wires":[]},{"id":"23569d68.5a06c2","type":"http response","z":"d0562e73.de681","name":"","statusCode":"","headers":{},"x":730,"y":60,"wires":[]},{"id":"9f2607db.34b9e8","type":"template","z":"d0562e73.de681","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":610,"y":60,"wires":[["23569d68.5a06c2"]]},{"id":"2a483322.2e26cc","type":"change","z":"d0562e73.de681","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Flash Pattern Effects","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":60,"wires":[["20a5e394.a75b0c"]]},{"id":"14929ad3.d3b6d5","type":"comment","z":"d0562e73.de681","name":"Put Data On the Webpage","info":"","x":150,"y":140,"wires":[]},{"id":"4ee69f48.01c99","type":"websocket out","z":"d0562e73.de681","name":"","server":"4f808f22.bd9c5","client":"","x":950,"y":180,"wires":[]},{"id":"5ab39dc5.a847d4","type":"template","z":"d0562e73.de681","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\n
\n
\nDefault
\nBackground Color: Font Color: Flash
\nVibe 1
\nBackground Color: Font Color: Flash
\nVibe 2
\nBackground Color: Font Color: Flash
\nVibe 3
\nBackground Color: Font Color: Flash
\n \nBeep 1
\nBackground Color: Font Color: Flash
\nBeep 2
\nBackground Color: Font Color: Flash
\nBeep 3
\nBackground Color: Font Color: Flash
\n\nVibe/Beep 1
\nBackground Color: Font Color: Flash
\nVibe/Beep 2
\nBackground Color: Font Color: Flash
\nVibe/Beep 3
\nBackground Color: Font Color: Flash
\n\nLookdown
\nBackground Color: Font Color: Flash
\n\n\n\n
\n\n
","output":"str","x":770,"y":180,"wires":[["4ee69f48.01c99"]]},{"id":"9d79df3.aaa812","type":"websocket in","z":"d0562e73.de681","name":"","server":"a0127eb8.b242b","client":"","x":120,"y":180,"wires":[["be2427dd.44de28"]]},{"id":"f19f0b88.1da698","type":"switch","z":"d0562e73.de681","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":180,"wires":[["3b021a54.3400d6"]]},{"id":"20a5e394.a75b0c","type":"template","z":"d0562e73.de681","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/setFP/receive');\nvar send = new WebSocket('ws://' + location.host + '/setFP/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":490,"y":60,"wires":[["9f2607db.34b9e8"]]},{"id":"611efccd.97f434","type":"comment","z":"d0562e73.de681","name":"Handle Input from Webpage","info":"","x":160,"y":240,"wires":[]},{"id":"4f94a092.61ad8","type":"switch","z":"d0562e73.de681","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":80,"wires":[["2a483322.2e26cc"],["a3483953.4356f8"]]},{"id":"a3483953.4356f8","type":"link out","z":"d0562e73.de681","name":"back to settings","links":["4212ad6a.fb9f04"],"x":335,"y":100,"wires":[]},{"id":"80ccb8a9.a8b6b8","type":"http in","z":"d0562e73.de681","name":"","url":"/setFP","method":"post","upload":false,"swaggerDoc":"","x":110,"y":340,"wires":[["bcbf0cd6.00d0d","b72a4410.a678b8","91650265.06ee3","8edd4cbd.dc908"]]},{"id":"e753d0a.a94ac3","type":"http response","z":"d0562e73.de681","name":"","statusCode":"","headers":{},"x":410,"y":300,"wires":[]},{"id":"bcbf0cd6.00d0d","type":"change","z":"d0562e73.de681","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/setFP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":300,"wires":[["e753d0a.a94ac3"]]},{"id":"7e96f9d2.8aca18","type":"file","z":"d0562e73.de681","name":"","filename":"./node-red-static/FP.css","appendNewline":false,"createDir":false,"overwriteFile":"true","x":470,"y":340,"wires":[[]]},{"id":"b72a4410.a678b8","type":"template","z":"d0562e73.de681","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"/* Flash Patterns */\n.default {\n background-color: {{payload.defaultBG}};\n color: {{payload.defaultFont}};\n animation: {{payload.defaultFlash}} linear 1s infinite;\n \n\n}\n\n.V1 {\n background-color: {{payload.V1BG}};\n color: {{payload.V1Font}};\n animation: {{payload.V1Flash}} linear 1s infinite;\n}\n\n.V2 {\n background-color: {{payload.V2BG}};\n color: {{payload.V2Font}};\n animation: {{payload.V2Flash}} linear 1s infinite;\n }\n\n.V3 {\n background-color: {{payload.V3BG}};\n color: {{payload.V3Font}};\n animation: {{payload.V3Flash}} linear 1s infinite;\n}\n\n.B1 {\n background-color: {{payload.B1BG}};\n color: {{payload.B1Font}};\n animation: {{payload.B1Flash}} linear 1s infinite;\n}\n\n.B2 {\n background-color: {{payload.B2BG}};\n color: {{payload.B2Font}};\n animation: {{payload.B2Flash}} linear 1s infinite;\n}\n\n.B3 {\n background-color: {{payload.B3BG}};\n color: {{payload.B3Font}};\n animation: {{payload.B3Flash}} linear 1s infinite;\n}\n\n.VB1 {\n background-color: {{payload.VB1BG}};\n color: {{payload.VB1Font}};\n animation: {{payload.VB1Flash}} linear 1s infinite;\n}\n\n.VB2 { background-color: {{payload.VB2BG}};\ncolor: {{payload.VB2Font}};\n animation: {{payload.VB2Flash}} linear 1s infinite;\n }\n\n.VB3 {\n background-color: {{payload.VB3BG}};\n color: {{payload.VB3Font}};\n animation: {{payload.VB3Flash}} linear 1s infinite;\n}\n\n.B1b3 {\n background-color: {{payload.B1b3BG}};\n color: {{payload.B1b3Font}};\n animation: {{payload.B1b3Flash}} linear 1s infinite;\n}\n\n@keyframes checked {\n0% { opacity: 1; } \n\t50% { opacity: .1; } \n\t100% { opacity: 1; }\n}","output":"str","x":280,"y":340,"wires":[["7e96f9d2.8aca18"]]},{"id":"7e7fe23b.84c74c","type":"split","z":"60528a1b.f32364","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":890,"y":680,"wires":[["afbb1eb0.29539"]]},{"id":"afbb1eb0.29539","type":"split","z":"60528a1b.f32364","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1020,"y":680,"wires":[["ff45b5a4.aa7888"]]},{"id":"ff45b5a4.aa7888","type":"join","z":"60528a1b.f32364","name":"","mode":"custom","build":"string","property":"payload.1","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1140,"y":680,"wires":[["19139a6d.7e50d6"]]},{"id":"19139a6d.7e50d6","type":"join","z":"60528a1b.f32364","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":1260,"y":680,"wires":[["d70e1277.46b2"]]},{"id":"d70e1277.46b2","type":"template","z":"60528a1b.f32364","name":"","field":"modules","fieldType":"global","format":"handlebars","syntax":"mustache","template":"/{{{payload}}}","output":"str","x":1390,"y":680,"wires":[[]]},{"id":"91650265.06ee3","type":"debug","z":"d0562e73.de681","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":420,"wires":[]},{"id":"72e42bd5.2616a4","type":"template","z":"60528a1b.f32364","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET ip = '{{ip}}', sysID = '{{sysID}}', email = '{{email}}', serial = '{{serial}}', beep = '{{beep}}', sw = '{{sw}}', hw = '{{hw}}', fw = '{{fw}}', password = '{{password}}', modules = '{{modules}}', settings = '{{settings}}', sortby = '{{sortby}}', direction = '{{direction}}'\nWHERE ID = 1;","output":"str","x":580,"y":1040,"wires":[["fb23c3fd.6aaee"]]},{"id":"fb23c3fd.6aaee","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":1040,"wires":[["ed7000ef.81664"]]},{"id":"b16ad8ab.ea9388","type":"inject","z":"60528a1b.f32364","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":1040,"wires":[["72e42bd5.2616a4"]]},{"id":"ed7000ef.81664","type":"debug","z":"60528a1b.f32364","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":1040,"wires":[]},{"id":"57680870.a4fee8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":460,"wires":[]},{"id":"40e8a718.7db078","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":420,"wires":[["5c137e7c.eafe6"]]},{"id":"51df7832.56f338","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE \"settings\" ( `ID` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, `ip` TEXT, `sysID` INTEGER, `home` TEXT, `email` TEXT, `serial` TEXT, `beep` TEXT, `sw` TEXT, `hw` TEXT, `fw` TEXT, `password` TEXT, `modules` TEXT, `settings` TEXT, `sms_lookup_time` INTEGER, `default_pager_number` INTEGER )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":420,"wires":[["40e8a718.7db078"]]},{"id":"5c137e7c.eafe6","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":420,"wires":[]},{"id":"9613dd14.40516","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":580,"wires":[["4c6d8b9f.7c4cc4"]]},{"id":"87545ba1.2ba438","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":580,"wires":[["9613dd14.40516"]]},{"id":"abdc0875.b34ba8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":460,"wires":[["57680870.a4fee8"]]},{"id":"475501bd.5f68b","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":460,"wires":[["abdc0875.b34ba8"]]},{"id":"2d395ca8.d5cbf4","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":500,"wires":[]},{"id":"1f6d8d53.6e5823","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":500,"wires":[["2d395ca8.d5cbf4"]]},{"id":"1da18834.e7d818","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":500,"wires":[["1f6d8d53.6e5823"]]},{"id":"4c6d8b9f.7c4cc4","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":580,"wires":[]},{"id":"4b450df0.e83c84","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":540,"wires":[]},{"id":"bad165b9.945888","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":540,"wires":[["4b450df0.e83c84"]]},{"id":"12e4d3cf.a38c7c","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'settings';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":540,"wires":[["bad165b9.945888"]]},{"id":"a035d2e1.6932a","type":"comment","z":"ba76d305.cf8ad","name":"Settings","info":"","x":500,"y":380,"wires":[]},{"id":"4ac7d74f.7f2f58","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":620,"wires":[["80b030ab.c8c21"]]},{"id":"615f1b49.7d75d4","type":"inject","z":"ba76d305.cf8ad","name":"Build Blank","topic":"INSERT INTO `settings`(`ID`,`ip`,`sysID`,`home`,`email`,`serial`,`beep`,`sw`,`hw`,`fw`,`password`,`modules`,`settings`) VALUES (1,\"NULL\",0,\"Dynamic Display\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"1234\",'[{\"Name\": \"Go to Dynamic Display\",\"Address\": \"display\"},{\"Name\": \"Go to First Aid Display\",\"Address\": \"firstaid\"},{\"Name\": \"Go to Table Display\",\"Address\": \"table\"},{\"Name\": \"Go to Daily Log\",\"Address\": \"log-daily\"},{\"Name\": \"Go to Full Log\",\"Address\": \"log-full\"},{\"Name\": \"Go to Quick Page\",\"Address\": \"quickpage\"},{\"Name\": \"Go to Free Page\",\"Address\": \"freepage\"},{\"Name\": \"Go to Split Screen\",\"Address\": \"split-screen\"},{\"Name\": \"Go to Settings\",\"Address\": \"login\"}]','[ { \"Name\": \"Home\", \"Address\": \"\" }, {\"Name\": \"Settings Menu\",\"Address\": \"settings\"},{\"Name\": \"Log Out\",\"Address\": \"login/clear\"} ]');","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":620,"wires":[["4ac7d74f.7f2f58"]]},{"id":"80b030ab.c8c21","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":620,"wires":[]},{"id":"7ece05b1.f644dc","type":"template","z":"60528a1b.f32364","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET ip = '{{payload[0].address}}'\nWHERE ID = 1;","output":"str","x":560,"y":160,"wires":[["13ca5266.4f02ce"]]},{"id":"13ca5266.4f02ce","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":710,"y":160,"wires":[[]]},{"id":"a94eeb3d.5f0798","type":"comment","z":"60528a1b.f32364","name":"Reset Default sort to Index","info":"","x":670,"y":240,"wires":[]},{"id":"24af3739.9123f8","type":"comment","z":"60528a1b.f32364","name":"Reset Default sort Direction to Descending","info":"","x":720,"y":280,"wires":[]},{"id":"d57eea24.248848","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `email` FROM `settings`;","name":"CaptureCall","x":430,"y":360,"wires":[["29aa4748.4a38f8"]]},{"id":"6504a56c.dec16c","type":"comment","z":"60528a1b.f32364","name":"Set Global IP Address","info":"","x":900,"y":120,"wires":[]},{"id":"29000af8.4b1dd6","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"sysID","pt":"global","to":"payload[0].sysID","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":320,"wires":[[]]},{"id":"f8c63b29.6d2638","type":"comment","z":"60528a1b.f32364","name":"Set sysID","info":"","x":760,"y":320,"wires":[]},{"id":"75e740cb.10229","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `sysID` FROM `settings`;","name":"CaptureCall","x":430,"y":320,"wires":[["29000af8.4b1dd6"]]},{"id":"6d072298.ce0c6c","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"serial","pt":"global","to":"payload[0].serial","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":400,"wires":[[]]},{"id":"3dcdfe5b.03ee22","type":"comment","z":"60528a1b.f32364","name":"Set Serial","info":"","x":760,"y":400,"wires":[]},{"id":"1ecf1066.91d79","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `serial` FROM `settings`;","name":"CaptureCall","x":430,"y":400,"wires":[["6d072298.ce0c6c"]]},{"id":"b226a04c.535eb","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"beep","pt":"global","to":"payload[0].beep","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":440,"wires":[[]]},{"id":"71a41ac8.736de4","type":"comment","z":"60528a1b.f32364","name":"Set beep","info":"","x":760,"y":440,"wires":[]},{"id":"64152e36.bad9a","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `beep` FROM `settings`;","name":"CaptureCall","x":430,"y":440,"wires":[["b226a04c.535eb"]]},{"id":"956c0a4b.435d18","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"sw","pt":"global","to":"payload[0].sw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":480,"wires":[[]]},{"id":"702ec949.a6b798","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `sw` FROM `settings`;","name":"CaptureCall","x":430,"y":480,"wires":[["956c0a4b.435d18"]]},{"id":"36f03d71.440912","type":"comment","z":"60528a1b.f32364","name":"Set H/W Version","info":"","x":780,"y":520,"wires":[]},{"id":"afb53090.a53f7","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"hw","pt":"global","to":"payload[0].hw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":520,"wires":[[]]},{"id":"b97ab582.64ca48","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `hw` FROM `settings`;","name":"CaptureCall","x":430,"y":520,"wires":[["afb53090.a53f7"]]},{"id":"6aed35a2.f6254c","type":"comment","z":"60528a1b.f32364","name":"Set F/W Version","info":"","x":780,"y":560,"wires":[]},{"id":"d36a9d78.9203","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"fw","pt":"global","to":"payload[0].fw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":560,"wires":[[]]},{"id":"e9329103.798d6","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `fw` FROM `settings`;","name":"CaptureCall","x":430,"y":560,"wires":[["d36a9d78.9203"]]},{"id":"67a9b493.e3fe5c","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"password","pt":"global","to":"payload[0].password","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":600,"wires":[[]]},{"id":"33e54f6c.30f9e","type":"comment","z":"60528a1b.f32364","name":"Set password","info":"","x":810,"y":600,"wires":[]},{"id":"2787e72e.d4af98","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `password` FROM `settings`;","name":"CaptureCall","x":430,"y":600,"wires":[["67a9b493.e3fe5c"]]},{"id":"4fb7501b.1e92b","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET password = '{{{payload.password}}}'\nWHERE ID = 1;","output":"str","x":680,"y":300,"wires":[["616085bf.e2beec"]]},{"id":"616085bf.e2beec","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":300,"wires":[[]]},{"id":"a1c2cf8c.f9e76","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET modules = '{{{payload}}}'\nWHERE ID = 1;","output":"str","x":1300,"y":540,"wires":[["4dd2cde6.07a074","55534cbe.57ef14"]]},{"id":"4dd2cde6.07a074","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1450,"y":540,"wires":[[]]},{"id":"75c7b90a.961778","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET sw = '{{{payload.sw}}}'\nWHERE ID = 1;","output":"str","x":640,"y":340,"wires":[["bd146bf.801c898"]]},{"id":"bd146bf.801c898","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":790,"y":340,"wires":[[]]},{"id":"20e10feb.cf737","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET hw = '{{{payload.hw}}}'\nWHERE ID = 1;","output":"str","x":640,"y":380,"wires":[["e80c7be9.9ace28"]]},{"id":"e80c7be9.9ace28","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":790,"y":380,"wires":[[]]},{"id":"8416e01a.3a8d6","type":"comment","z":"3c78672c.9cb1f8","name":"Password","info":"","x":980,"y":300,"wires":[]},{"id":"8e87cea6.9a0d9","type":"comment","z":"3c78672c.9cb1f8","name":"sw","info":"","x":930,"y":340,"wires":[]},{"id":"6bdc1aab.84a294","type":"comment","z":"3c78672c.9cb1f8","name":"hw","info":"","x":930,"y":380,"wires":[]},{"id":"e422f09f.92a03","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET fw = '{{{payload.fw}}}'\nWHERE ID = 1;","output":"str","x":640,"y":420,"wires":[["9cc31680.08ceb8"]]},{"id":"9cc31680.08ceb8","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":790,"y":420,"wires":[[]]},{"id":"efbe982a.feae18","type":"comment","z":"3c78672c.9cb1f8","name":"fw","info":"","x":930,"y":420,"wires":[]},{"id":"2006e9b0.a7d446","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET serial = '{{{payload.serial}}}'\nWHERE ID = 1;","output":"str","x":660,"y":460,"wires":[["a64a089f.8939a8"]]},{"id":"a64a089f.8939a8","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":460,"wires":[[]]},{"id":"238ca74a.e623a8","type":"comment","z":"3c78672c.9cb1f8","name":"serial","info":"","x":950,"y":460,"wires":[]},{"id":"a7cda32c.2c3ea","type":"switch","z":"3c78672c.9cb1f8","name":"","property":"payload.sysID","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":260,"wires":[["24bf5ab5.e2a7d6"]]},{"id":"24bf5ab5.e2a7d6","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"sysID","pt":"global","to":"payload.sysID","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":260,"wires":[["37d3eeb3.bec942"]]},{"id":"37d3eeb3.bec942","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET sysID = '{{payload.sysID}}'\nWHERE ID = 1;","output":"str","x":660,"y":260,"wires":[["2848e3d3.d0019c"]]},{"id":"2848e3d3.d0019c","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":260,"wires":[[]]},{"id":"c194319b.6aaa5","type":"comment","z":"3c78672c.9cb1f8","name":"sysID","info":"","x":950,"y":260,"wires":[]},{"id":"2ecb85ed.adc67a","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"sw","pt":"global","to":"payload.sw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":340,"wires":[["75c7b90a.961778"]]},{"id":"b054030c.77671","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"hw","pt":"global","to":"payload.hw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":380,"wires":[["20e10feb.cf737"]]},{"id":"12fa8d82.9467a2","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"fw","pt":"global","to":"payload.fw","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":420,"wires":[["e422f09f.92a03"]]},{"id":"3b656b80.fb4db4","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"serial","pt":"global","to":"payload.serial","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":460,"wires":[["2006e9b0.a7d446"]]},{"id":"d2cffd80.616a","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"password","pt":"global","to":"payload.Newpassword","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":280,"wires":[["10577483.1658ab"]]},{"id":"10577483.1658ab","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET password = '{{payload.Newpassword}}'\nWHERE ID = 1;","output":"str","x":810,"y":280,"wires":[["f7b2c8cf.8744f8"]]},{"id":"f7b2c8cf.8744f8","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":960,"y":280,"wires":[[]]},{"id":"b50de3ac.d427d","type":"comment","z":"69336e92.97cdb","name":"Password","info":"","x":1110,"y":280,"wires":[]},{"id":"d4b6378c.272a18","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET beep = '{{payload.beep}}'\nWHERE ID = 1;","output":"str","x":660,"y":500,"wires":[["a472fd8f.cc606"]]},{"id":"a472fd8f.cc606","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":500,"wires":[[]]},{"id":"cd7b9816.b1a838","type":"comment","z":"69336e92.97cdb","name":"Beep","info":"","x":950,"y":500,"wires":[]},{"id":"8edd4cbd.dc908","type":"template","z":"d0562e73.de681","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `colors`\nSET \n`defaultBG` = '{{payload.defaultBG}}',\n`defaultFont` = '{{payload.defaultFont}}',\n`defaultFlash` = '{{payload.defaultFlash}}',\n`V1BG` = '{{payload.V1BG}}',\n`V1Font` = '{{payload.V1Font}}',\n`V1Flash` = '{{payload.V1Flash}}',\n`V2BG` = '{{payload.V2BG}}',\n`V2Font` = '{{payload.V2Font}}',\n`V2Flash` = '{{payload.V2Flash}}',\n`V3BG` = '{{payload.V3BG}}',\n`V3Font` = '{{payload.V3Font}}',\n`V3Flash` = '{{payload.V3Flash}}',\n`B1BG` = '{{payload.B1BG}}',\n`B1Font` = '{{payload.B1Font}}',\n`B1Flash` = '{{payload.B1Flash}}',\n`B2BG` = '{{payload.B2BG}}',\n`B2Font` = '{{payload.B2Font}}',\n`B2Flash` = '{{payload.B2Flash}}',\n`B3BG` = '{{payload.B3BG}}',\n`B3Font` = '{{payload.B3Font}}',\n`B3Flash` = '{{payload.B3Flash}}',\n`VB1BG` = '{{payload.VB1BG}}',\n`VB1Font` = '{{payload.VB1Font}}',\n`VB1Flash` = '{{payload.VB1Flash}}',\n`VB2BG` = '{{payload.defaultBG}}',\n`VB2Font` = '{{payload.VB2Font}}',\n`VB2Flash` = '{{payload.VB2Flash}}',\n`VB3BG` = '{{payload.VB3BG}}',\n`VB3Font` = '{{payload.VB3Font}}',\n`VB3Flash` = '{{payload.VB3Flash}}',\n`B1b3BG` = '{{payload.B1b3BG}}',\n`B1b3Font` = '{{payload.B1b3Font}}',\n`B1b3Flash` = '{{payload.B1b3Flash}}'\nWHERE ID = 1;","output":"str","x":280,"y":380,"wires":[["f7d5473c.3e6488"]]},{"id":"f7d5473c.3e6488","type":"sqlite","z":"d0562e73.de681","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":430,"y":380,"wires":[[]]},{"id":"5e336be9.76b194","type":"comment","z":"d0562e73.de681","name":"FP Colors","info":"","x":580,"y":380,"wires":[]},{"id":"3b021a54.3400d6","type":"sqlite","z":"d0562e73.de681","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `colors`;","name":"CaptureCall","x":590,"y":180,"wires":[["d31a057.54931f8","5ab39dc5.a847d4"]]},{"id":"d31a057.54931f8","type":"debug","z":"d0562e73.de681","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[0]","x":610,"y":260,"wires":[]},{"id":"b359f9e7.8eb888","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":460,"wires":[]},{"id":"85a50328.58f91","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":420,"wires":[["c97062da.9cd87"]]},{"id":"e6dff7e2.499de8","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `colors` ( \t`ID`\tINTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, \t`defaultBG`\tINTEGER, \t`defaultFont`\tINTEGER, \t`defaultFlash`\tTEXT, \t`V1BG`\tINTEGER, \t`V1Font`\tINTEGER, \t`V1Flash`\tTEXT, `V2BG`\tINTEGER, \t`V2Font`\tINTEGER, \t`V2Flash`\tTEXT, `V3BG`\tINTEGER, \t`V3Font`\tINTEGER, \t`V3Flash`\tTEXT, `B1BG`\tINTEGER, \t`B1Font`\tINTEGER, \t`B1Flash`\tTEXT, `B2BG`\tINTEGER, \t`B2Font`\tINTEGER, \t`B2Flash`\tTEXT, `B3BG`\tINTEGER, \t`B3Font`\tINTEGER, \t`B3Flash`\tTEXT, `VB1BG`\tINTEGER, \t`VB1Font`\tINTEGER, \t`VB1Flash`\tTEXT, `VB2BG`\tINTEGER, \t`VB2Font`\tINTEGER, \t`VB2Flash`\tTEXT, `VB3BG`\tINTEGER, \t`VB3Font`\tINTEGER, \t`VB3Flash`\tTEXT, `B1b3BG`\tINTEGER, \t`B1b3Font`\tINTEGER, \t`B1b3Flash`\tTEXT );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":420,"wires":[["85a50328.58f91"]]},{"id":"c97062da.9cd87","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1410,"y":420,"wires":[]},{"id":"12729fac.b0518","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":580,"wires":[["228a7978.3f8ee6"]]},{"id":"26e09611.ca020a","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":580,"wires":[["12729fac.b0518"]]},{"id":"808fb896.6bc138","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":460,"wires":[["b359f9e7.8eb888"]]},{"id":"27f3b071.e469e","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":460,"wires":[["808fb896.6bc138"]]},{"id":"c778da44.5ea878","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":500,"wires":[]},{"id":"539dc36d.fa222c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":500,"wires":[["c778da44.5ea878"]]},{"id":"f3584fe.28529b","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":500,"wires":[["539dc36d.fa222c"]]},{"id":"228a7978.3f8ee6","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":580,"wires":[]},{"id":"54044754.6691d8","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":540,"wires":[]},{"id":"d36d4b0d.d951c8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":540,"wires":[["54044754.6691d8"]]},{"id":"27b9a10f.09813e","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'colors';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1000,"y":540,"wires":[["d36d4b0d.d951c8"]]},{"id":"486767ea.69d218","type":"comment","z":"ba76d305.cf8ad","name":"Colors","info":"","x":1250,"y":380,"wires":[]},{"id":"33e449ab.039e96","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1250,"y":620,"wires":[["ee2c5cca.e43b2"]]},{"id":"ce78853a.c47cf8","type":"inject","z":"ba76d305.cf8ad","name":"Build Blank","topic":"INSERT INTO `colors`(`ID`,`defaultBG`, `defaultFont`, `defaultFlash` ,`V1BG`, `V1Font`, `V1Flash` ,`V2BG`, `V2Font`, `V2Flash` ,`V3BG`, `V3Font`, `V3Flash` ,`B1BG`, `B1Font`, `B1Flash` ,`B2BG`, `B2Font`, `B2Flash` ,`B3BG`, `B3Font`, `B3Flash` ,`VB1BG`, `VB1Font`, `VB1Flash` ,`VB2BG`, `VB2Font`, `VB2Flash` ,`VB3BG`, `VB3Font`, `VB3Flash` ,`B1b3BG`, `B1b3Font`, `B1b3Flash`) VALUES (1,\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\",\"NULL\");","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":620,"wires":[["33e449ab.039e96"]]},{"id":"ee2c5cca.e43b2","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1410,"y":620,"wires":[]},{"id":"53ef0d3c.2f1ab4","type":"comment","z":"9939c833.99b318","name":"Put Unprocessed On the Webpage","info":"","x":180,"y":220,"wires":[]},{"id":"43e3479.f2432b8","type":"http in","z":"9939c833.99b318","name":"","url":"/split-screen","method":"get","upload":false,"swaggerDoc":"","x":120,"y":160,"wires":[["2c5430ff.3123f"]]},{"id":"64ebaca6.468d04","type":"template","z":"9939c833.99b318","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN pagerAlias ON data.pagerNumber = pagerAlias.pagerNumber\nWHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `T/R` = 1\nORDER BY `rxTime` DESC;","output":"str","x":370,"y":260,"wires":[["1ca1dc8e.ddbd13"]]},{"id":"f862321.2f6e7d","type":"websocket out","z":"9939c833.99b318","name":"","server":"a08ab62d.cf01f8","client":"","x":1460,"y":260,"wires":[]},{"id":"eea0957b.ea1d38","type":"comment","z":"9939c833.99b318","name":"Build Webpage","info":"","x":120,"y":20,"wires":[]},{"id":"1ca1dc8e.ddbd13","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":550,"y":260,"wires":[["bcbbf453.9c3be8"]]},{"id":"75811f80.19931","type":"template","z":"9939c833.99b318","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n \n  Quick Message:\n  Recipient:\n  Append Time:\n
\n
\n
","output":"str","x":1070,"y":220,"wires":[["7abdfa8f.f06af4","a7538406.5b50f8"]]},{"id":"29af0c05.167c54","type":"http response","z":"9939c833.99b318","name":"","statusCode":"201","headers":{},"x":820,"y":160,"wires":[]},{"id":"ea314091.3deb1","type":"template","z":"9939c833.99b318","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n \n\n\n \n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n\n\n\n\n\n","output":"str","x":690,"y":160,"wires":[["29af0c05.167c54"]]},{"id":"4b6b4ad.def5eb4","type":"change","z":"9939c833.99b318","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Split Screen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":160,"wires":[["34ba9fd9.0d6b2"]]},{"id":"44b5460f.fe4328","type":"function","z":"9939c833.99b318","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":260,"wires":[["4c539035.d5ee7"]]},{"id":"34ba9fd9.0d6b2","type":"template","z":"9939c833.99b318","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/split-screen/receive');\nvar one = new WebSocket('ws://' + location.host + '/split-screen/receive/one');\nvar two = new WebSocket('ws://' + location.host + '/split-screen/receive/two');\nvar send = new WebSocket('ws://' + location.host + '/split-screen/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n// Change Two\ntwo.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"two\").innerHTML = msg.payload;\n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":570,"y":160,"wires":[["ea314091.3deb1"]]},{"id":"2c5430ff.3123f","type":"switch","z":"9939c833.99b318","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"/split-screen","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["4b6b4ad.def5eb4"],["a72b8463.b905e8"]]},{"id":"a72b8463.b905e8","type":"link out","z":"9939c833.99b318","name":"","links":["f13a1f16.82872"],"x":415,"y":200,"wires":[]},{"id":"d14f8279.4648c","type":"websocket out","z":"9939c833.99b318","name":"","server":"2dd9c4a8.1fbccc","client":"","x":1280,"y":300,"wires":[]},{"id":"6b55aec3.28832","type":"template","z":"9939c833.99b318","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Callpoint
\n
Message
\n
Receive Time
\n
\n{{#payload}}\n
\n
{{{alias}}}{{^alias}}{{sender}}{{/alias}}
\n
{{{part1}}}-{{{part2}}}
\n
{{displayTime}}
\n
\n{{/payload}}","output":"str","x":1070,"y":300,"wires":[["d14f8279.4648c"]]},{"id":"5ea3efa2.1fb7a","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `modules` FROM `settings`;","name":"CaptureCall","x":430,"y":640,"wires":[["a8a636bc.460278"]]},{"id":"149a9733.581029","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":360,"y":680,"wires":[]},{"id":"55534cbe.57ef14","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":1440,"y":500,"wires":[]},{"id":"e8d7c8d7.9a90f8","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1230,"y":460,"wires":[]},{"id":"a8a636bc.460278","type":"json","z":"60528a1b.f32364","name":"","property":"payload.0.modules","action":"","pretty":true,"x":570,"y":640,"wires":[["45a5ba11.d51434"]]},{"id":"45a5ba11.d51434","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].modules","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":640,"wires":[["7e7fe23b.84c74c","8ef3cc6f.9a91a"]]},{"id":"e9663b25.2ecdf8","type":"comment","z":"b209c94d.26d798","name":"Put All On the Webpage","info":"","x":140,"y":240,"wires":[]},{"id":"572a891c.622e28","type":"template","z":"b209c94d.26d798","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM data WHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `sender` != \"System\"\nORDER BY `{{global.sort-by}}` {{global.direction}}","output":"str","x":470,"y":340,"wires":[["29fa674e.c38bc8"]]},{"id":"dc7b6d43.82fea","type":"websocket out","z":"b209c94d.26d798","name":"","server":"c0402614.f01608","client":"","x":1440,"y":340,"wires":[]},{"id":"29fa674e.c38bc8","type":"sqlite","z":"b209c94d.26d798","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":340,"wires":[["23fab3c1.0aebac"]]},{"id":"e3e5acdd.18f9","type":"function","z":"b209c94d.26d798","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":340,"wires":[["9658fb59.3ebfe8"]]},{"id":"4a4f10a5.b3051","type":"link in","z":"b209c94d.26d798","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","906b7dc8.7a615","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","ce5be23d.4618f","64848176.9353c","e5f646d.fb382b8","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":175,"y":360,"wires":[["572a891c.622e28"]]},{"id":"23fab3c1.0aebac","type":"function","z":"b209c94d.26d798","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":340,"wires":[["e3e5acdd.18f9"]]},{"id":"9658fb59.3ebfe8","type":"template","z":"b209c94d.26d798","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Index
\n
Callpoint
\n
Message
\n
Receive Time
\n
Receive Date
\n
Cleared?
\n
Status
\n
Status Time
\n
Status Date
\n
Recipient
\n
System ID
\n
\n{{#payload}}\n
\n
{{index}}
\n
{{sender}}
\n
{{{part1}}}-{{{part2}}}
\n
{{displayTime}}
\n
{{displayDate}}
\n
{{cleared}}
\n
{{status}}
\n
{{displayStatusTime}}
\n
{{displayStatusDate}}
\n
{{pagerNumber}}
\n
{{sysID}}
\n
\n{{/payload}}","output":"str","x":1210,"y":340,"wires":[["dc7b6d43.82fea"]]},{"id":"8aed6be1.ef9ee8","type":"switch","z":"b209c94d.26d798","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":280,"wires":[["1fbb2868.8151c8"],["572a891c.622e28"]]},{"id":"1fbb2868.8151c8","type":"change","z":"b209c94d.26d798","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":260,"wires":[["b2f96c3b.4bd61"]]},{"id":"b2f96c3b.4bd61","type":"switch","z":"b209c94d.26d798","name":"","property":"direction","propertyType":"global","rules":[{"t":"eq","v":"ASC","vt":"str"},{"t":"eq","v":"DESC","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":730,"y":280,"wires":[["4f227785.08f048"],["c10df447.d42fe8"]]},{"id":"4f227785.08f048","type":"change","z":"b209c94d.26d798","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":260,"wires":[["906b7dc8.7a615"]]},{"id":"c10df447.d42fe8","type":"change","z":"b209c94d.26d798","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"ASC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":300,"wires":[["906b7dc8.7a615"]]},{"id":"906b7dc8.7a615","type":"link out","z":"b209c94d.26d798","name":"","links":["4a4f10a5.b3051"],"x":1055,"y":280,"wires":[]},{"id":"8e929840.f614b8","type":"websocket in","z":"b209c94d.26d798","name":"","server":"c7526c07.3fd51","client":"","x":90,"y":280,"wires":[["6c8e43b1.7985ec"]]},{"id":"4cfa91f3.ed729","type":"template","z":"9939c833.99b318","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM data\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `T/R` = 0\nORDER BY `rxTime` DESC ;\n","output":"str","x":370,"y":300,"wires":[["462cb1cd.d5668"]]},{"id":"462cb1cd.d5668","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":550,"y":300,"wires":[["9dcbe880.cbfd68"]]},{"id":"d6b3daac.f529a8","type":"function","z":"9939c833.99b318","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":880,"y":300,"wires":[["6b55aec3.28832"]]},{"id":"310fbd39.4aefd2","type":"link in","z":"9939c833.99b318","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","baaeb70f.7624e8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":215,"y":260,"wires":[["4cfa91f3.ed729","64ebaca6.468d04"]]},{"id":"9dcbe880.cbfd68","type":"function","z":"9939c833.99b318","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":300,"wires":[["d6b3daac.f529a8"]]},{"id":"84a5871.9fe7f78","type":"websocket in","z":"9939c833.99b318","name":"","server":"1bd09651.1c7e5a","client":"","x":140,"y":380,"wires":[["5d6cae62.a1bb1"]]},{"id":"ef7571cc.7263e","type":"template","z":"9939c833.99b318","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg.0}}}{{{payload.msg.1}}}","output":"str","x":1000,"y":540,"wires":[["ce99cc49.66e21"]]},{"id":"ce99cc49.66e21","type":"serial out","z":"9939c833.99b318","name":"","serial":"5d6eb2f4.fc698c","x":1210,"y":520,"wires":[]},{"id":"6274cf00.0a1c2","type":"template","z":"9939c833.99b318","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0', '{{{payload.msg.0}}}','{{{payload.msg.1}}} - {{time}}', 'Split Screen', '{{timestamp}}', 'From Split Screen', '{{timestamp}}', 'n/a', 'n/a',1);","output":"str","x":1140,"y":460,"wires":[["a8dab2.0050755"]]},{"id":"a8dab2.0050755","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1310,"y":460,"wires":[["50e59502.8aad2c"]]},{"id":"c6d4d9ae.312498","type":"change","z":"9939c833.99b318","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":460,"wires":[["6274cf00.0a1c2","acdf8298.10574"]]},{"id":"50e59502.8aad2c","type":"link out","z":"9939c833.99b318","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885"],"x":1415,"y":460,"wires":[]},{"id":"11250122.c6d38f","type":"http in","z":"9939c833.99b318","name":"","url":"/split-screen","method":"post","upload":false,"swaggerDoc":"","x":130,"y":500,"wires":[["a6576438.126eb8","d7ea00f6.43c3f","7793973e.ce5438"]]},{"id":"a6576438.126eb8","type":"switch","z":"9939c833.99b318","name":"","property":"payload.msg","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":520,"wires":[["d9c7bd92.31891"]]},{"id":"d9c7bd92.31891","type":"switch","z":"9939c833.99b318","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":520,"wires":[["a195fdab.e7d59"]]},{"id":"371f81d8.dcb76e","type":"http response","z":"9939c833.99b318","name":"","statusCode":"","headers":{},"x":450,"y":480,"wires":[]},{"id":"d7ea00f6.43c3f","type":"change","z":"9939c833.99b318","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/split-screen","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":480,"wires":[["371f81d8.dcb76e"]]},{"id":"a195fdab.e7d59","type":"switch","z":"9939c833.99b318","name":"Add Time?","property":"payload.time","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":520,"wires":[["f397bfa5.91fa5"],["ef7571cc.7263e","2c2ddbc9.0d1744"]]},{"id":"f3ba90d6.e35a8","type":"template","z":"9939c833.99b318","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg.0}}}{{{payload.msg.1}}} - {{time}}","output":"str","x":1000,"y":500,"wires":[["ce99cc49.66e21"]]},{"id":"28ef9eb6.42bf32","type":"http in","z":"aefd70ef.7eada","name":"","url":"/alias","method":"get","upload":false,"swaggerDoc":"","x":140,"y":100,"wires":[["45d27d60.5ea254"]]},{"id":"9711d2d6.97894","type":"comment","z":"aefd70ef.7eada","name":"Build Webpage","info":"","x":160,"y":60,"wires":[]},{"id":"9ab051c9.9e6c2","type":"http response","z":"aefd70ef.7eada","name":"","statusCode":"","headers":{},"x":770,"y":80,"wires":[]},{"id":"fd17d86b.67bd68","type":"template","z":"aefd70ef.7eada","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n
\n\n\n\n","output":"str","x":650,"y":80,"wires":[["9ab051c9.9e6c2"]]},{"id":"985b6867.2a1678","type":"change","z":"aefd70ef.7eada","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Alias Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":80,"wires":[["93423381.4c2d"]]},{"id":"a86c760c.7b36a8","type":"comment","z":"aefd70ef.7eada","name":"Put Data On the Webpage","info":"","x":190,"y":160,"wires":[]},{"id":"94b47d04.ae69c","type":"websocket out","z":"aefd70ef.7eada","name":"","server":"a446718.a7f529","client":"","x":1320,"y":240,"wires":[]},{"id":"71c32cea.d4ec34","type":"template","z":"aefd70ef.7eada","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Set Callpoint Alias

\n \n
\n\n\nBackground Color:\nFont Color:\n\n
\n\n
\n\n

\n\n\n

\n\n
\n\n
\n
Alias
\n
Number
\n
Background Color
\n
Font Color
\n
\n{{#payload}}\n
\n
{{{alias}}}
\n
{{callpoint}}
\n
\n
\n
\n{{/payload}}\n
","output":"str","x":1110,"y":200,"wires":[["b6d177b6.5ed828"]]},{"id":"b512bc0d.d43f","type":"websocket in","z":"aefd70ef.7eada","name":"","server":"cc73b91d.aaa738","client":"","x":160,"y":200,"wires":[["5de04be1.0479d4"]]},{"id":"4f3bb7d.e64b048","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":200,"wires":[["f348a3c8.85d4f","1be0c166.45d06f"]]},{"id":"93423381.4c2d","type":"template","z":"aefd70ef.7eada","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var one = new WebSocket('ws://' + location.host + '/alias/receive/one');\nvar two = new WebSocket('ws://' + location.host + '/alias/receive/two');\nvar send = new WebSocket('ws://' + location.host + '/alias/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n// Change Two\ntwo.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"two\").innerHTML = msg.payload;\n};\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":530,"y":80,"wires":[["fd17d86b.67bd68"]]},{"id":"1157baf1.be4815","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":420,"wires":[["dae3733e.a0988","e986d976.0314d8"]]},{"id":"bc148d76.a62","type":"websocket in","z":"aefd70ef.7eada","name":"","server":"cc73b91d.aaa738","client":"","x":160,"y":420,"wires":[["1157baf1.be4815"]]},{"id":"36d8bcee.9da994","type":"comment","z":"aefd70ef.7eada","name":"Handle Input from Webpage","info":"","x":200,"y":360,"wires":[]},{"id":"45d27d60.5ea254","type":"switch","z":"aefd70ef.7eada","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":100,"wires":[["985b6867.2a1678"],["d6762c10.0cdbe"]]},{"id":"d6762c10.0cdbe","type":"link out","z":"aefd70ef.7eada","name":"back to settings","links":["4212ad6a.fb9f04","7e3a0a42.252994"],"x":355,"y":120,"wires":[]},{"id":"f348a3c8.85d4f","type":"template","z":"aefd70ef.7eada","name":"Select Callpoint Alias Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `callpoint_Alias`\nORDER BY `alias` ASC;\n","output":"str","x":740,"y":200,"wires":[["ad32f728.22c268"]]},{"id":"ad32f728.22c268","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":950,"y":200,"wires":[["71c32cea.d4ec34"]]},{"id":"dae3733e.a0988","type":"template","z":"aefd70ef.7eada","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `callpoint_Alias`\nWHERE `alias`=\"{{{payload}}}\";","output":"str","x":470,"y":400,"wires":[["74d9e28c.999adc"]]},{"id":"74d9e28c.999adc","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":420,"wires":[["2aef09c2.a99756","f348a3c8.85d4f","1be0c166.45d06f"]]},{"id":"a8a41f6c.c859c","type":"http response","z":"aefd70ef.7eada","name":"","statusCode":"","headers":{},"x":950,"y":420,"wires":[]},{"id":"2aef09c2.a99756","type":"change","z":"aefd70ef.7eada","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/alias","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":420,"wires":[["a8a41f6c.c859c"]]},{"id":"3fc6dfd3.b70a3","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":760,"wires":[]},{"id":"832fc0b1.28f94","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":720,"wires":[["976ebe96.056fb"]]},{"id":"d57c20e3.ee9b5","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `callpoint_alias` ( \t`alias`\tTEXT NOT NULL UNIQUE, \t`callpoint`\tINTEGER, \t`bgColor`\tTEXT, \t`ftColor`\tTEXT, \tPRIMARY KEY(`alias`) );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":720,"wires":[["832fc0b1.28f94"]]},{"id":"976ebe96.056fb","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":720,"wires":[]},{"id":"d5b1ce4.fc2243","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":760,"wires":[["3fc6dfd3.b70a3"]]},{"id":"6e9ee648.335c78","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'callpoint_Alias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":760,"wires":[["d5b1ce4.fc2243"]]},{"id":"248f1d7c.5d1392","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":800,"wires":[]},{"id":"77797078.887ca","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":800,"wires":[["248f1d7c.5d1392"]]},{"id":"5bf69e06.abe9c","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'callpoint_Alias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":800,"wires":[["77797078.887ca"]]},{"id":"6db20a0e.856054","type":"comment","z":"ba76d305.cf8ad","name":"Callpoint Alias","info":"","x":510,"y":680,"wires":[]},{"id":"11f87268.98cf0e","type":"catch","z":"aefd70ef.7eada","name":"","scope":["2682099a.780f86"],"x":890,"y":600,"wires":[["2aef09c2.a99756"]]},{"id":"7600a838.ea1d88","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":760,"wires":[]},{"id":"dfbe9a4a.a1b5b8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":720,"wires":[["e7a282a3.524fe"]]},{"id":"7a138fdf.f91a1","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `pagerAlias` ( \t`alias`\tTEXT NOT NULL UNIQUE,\t`pagerNumber`\tINTEGER, \tPRIMARY KEY(`pagerNumber`) );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":720,"wires":[["dfbe9a4a.a1b5b8"]]},{"id":"e7a282a3.524fe","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":720,"wires":[]},{"id":"aa037a7f.c6f688","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":760,"wires":[["7600a838.ea1d88"]]},{"id":"aecab930.dc9588","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'pagerAlias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":760,"wires":[["aa037a7f.c6f688"]]},{"id":"5908d21c.0f52cc","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":800,"wires":[]},{"id":"fd18b4b1.d2b8b8","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":800,"wires":[["5908d21c.0f52cc"]]},{"id":"e3504781.f45ab8","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'pagerAlias';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":800,"wires":[["fd18b4b1.d2b8b8"]]},{"id":"7fe45b38.db3764","type":"comment","z":"ba76d305.cf8ad","name":"Pager Alias","info":"","x":1250,"y":680,"wires":[]},{"id":"652c145.e95fbec","type":"template","z":"aefd70ef.7eada","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Set Pager Alias

\n\n
\n\n\n \n
\n\n
\n

\n\n\n

\n\n
\n \n
\n
Alias
\n
Number
\n
\n{{#payload}}\n
\n
{{{alias}}}
\n
{{pagerNumber}}
\n
\n{{/payload}}","output":"str","x":1110,"y":240,"wires":[["94b47d04.ae69c"]]},{"id":"b6d177b6.5ed828","type":"websocket out","z":"aefd70ef.7eada","name":"","server":"f2da83eb.80921","client":"","x":1320,"y":200,"wires":[]},{"id":"1be0c166.45d06f","type":"template","z":"aefd70ef.7eada","name":"Select Pager Alias Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `pagerAlias`\nORDER BY `alias` ASC;","output":"str","x":750,"y":240,"wires":[["3cc69ef9.e1d652"]]},{"id":"3cc69ef9.e1d652","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":950,"y":240,"wires":[["652c145.e95fbec"]]},{"id":"d1ca6275.be209","type":"template","z":"aefd70ef.7eada","name":"Add Alias to DB (Callpoint)","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `callpoint_Alias` ('alias', 'callpoint', 'bgColor', 'ftColor') VALUES ('{{{payload.alias}}}', '{{payload.callpoint}}', '{{payload.bgColor}}', '{{payload.ftColor}}');","output":"str","x":680,"y":640,"wires":[["2682099a.780f86","535c1893.ec9098"]]},{"id":"2682099a.780f86","type":"sqlite","z":"aefd70ef.7eada","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":910,"y":640,"wires":[["2aef09c2.a99756"]]},{"id":"c66c8b92.74ac88","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.alias","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":640,"wires":[["9eb090eb.f8e7b"]]},{"id":"155d7c3a.46dc04","type":"http in","z":"aefd70ef.7eada","name":"","url":"/alias/callpoint","method":"post","upload":false,"swaggerDoc":"","x":170,"y":640,"wires":[["c66c8b92.74ac88"]]},{"id":"535c1893.ec9098","type":"debug","z":"aefd70ef.7eada","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":900,"y":700,"wires":[]},{"id":"9eb090eb.f8e7b","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.callpoint","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":640,"wires":[["d1ca6275.be209"],["2aef09c2.a99756"]]},{"id":"aebb3baa.6eb7a8","type":"template","z":"aefd70ef.7eada","name":"Add Alias to DB (Pager Number)","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `pagerAlias` ('alias', 'pagerNumber') VALUES ('{{payload.alias}}', '{{payload.pager}}');","output":"str","x":670,"y":700,"wires":[["2682099a.780f86","535c1893.ec9098"]]},{"id":"f73e9b49.4b30c8","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.alias","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":700,"wires":[["551d4a9f.207a94"]]},{"id":"3936b9d7.0c8a46","type":"http in","z":"aefd70ef.7eada","name":"","url":"/alias/pager","method":"post","upload":false,"swaggerDoc":"","x":170,"y":700,"wires":[["f73e9b49.4b30c8"]]},{"id":"551d4a9f.207a94","type":"switch","z":"aefd70ef.7eada","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":700,"wires":[["aebb3baa.6eb7a8"],["2aef09c2.a99756"]]},{"id":"e986d976.0314d8","type":"template","z":"aefd70ef.7eada","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `pagerAlias`\nWHERE `alias`=\"{{{payload}}}\";","output":"str","x":470,"y":440,"wires":[["74d9e28c.999adc"]]},{"id":"9e910a95.ff8228","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `pagerAlias`;","name":"CaptureCall","x":910,"y":220,"wires":[["75811f80.19931"]]},{"id":"f397bfa5.91fa5","type":"moment","z":"9939c833.99b318","name":"","topic":"","input":"","inputType":"date","inTz":"Etc/UTC","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss","locale":"en_US","output":"time","outputType":"msg","outTz":"Etc/ETC/GMT","x":820,"y":500,"wires":[["f3ba90d6.e35a8","c6d4d9ae.312498"]]},{"id":"e9175bc6.696678","type":"http in","z":"53762a60.6160b4","name":"","url":"/setQP","method":"get","upload":false,"swaggerDoc":"","x":110,"y":80,"wires":[["c6e6ed59.8e76a"]]},{"id":"ec979ea5.33cb9","type":"comment","z":"53762a60.6160b4","name":"Build Webpage","info":"","x":120,"y":40,"wires":[]},{"id":"e3bb57cc.a2b9a8","type":"http response","z":"53762a60.6160b4","name":"","statusCode":"","headers":{},"x":730,"y":60,"wires":[]},{"id":"ae41ee14.e3ce3","type":"template","z":"53762a60.6160b4","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":610,"y":60,"wires":[["e3bb57cc.a2b9a8"]]},{"id":"ac0517b6.d9e3f8","type":"change","z":"53762a60.6160b4","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Quick Page Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":60,"wires":[["e03e5ad0.d30828"]]},{"id":"7d82eb2d.b0c5f4","type":"comment","z":"53762a60.6160b4","name":"Put Data On the Webpage","info":"","x":150,"y":140,"wires":[]},{"id":"a840eab1.b75478","type":"websocket out","z":"53762a60.6160b4","name":"","server":"7d649c17.1d11a4","client":"","x":1190,"y":180,"wires":[]},{"id":"ffb39ddf.99166","type":"template","z":"53762a60.6160b4","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Set Quick Messages

\n \n
\n \n
\n\n Pager Number:
\n System ID:
\n\n\n \n \n Beep Time (s)(Blank for Default):\n Beep Style:
\n Vibe Time (s)(Blank for Default):\n Vibe Style:
\n\n\n
\n
\n\n
\n\n
\n
\n\n\n
\n
\n
\n\n\n
\n
Message
\n
\n{{#payload}}\n
\n
{{{content}}}
\n
\n{{/payload}}\n","output":"str","x":1010,"y":180,"wires":[["a840eab1.b75478"]]},{"id":"92aec48c.fadac8","type":"switch","z":"53762a60.6160b4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":180,"wires":[["9f4fce9b.9166c"]]},{"id":"e03e5ad0.d30828","type":"template","z":"53762a60.6160b4","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/setQP/receive');\nvar send = new WebSocket('ws://' + location.host + '/setQP/send');\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":490,"y":60,"wires":[["ae41ee14.e3ce3"]]},{"id":"fc4eff16.dd3f8","type":"switch","z":"53762a60.6160b4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"},{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":300,"wires":[[],["7f378075.f7be8"]]},{"id":"4e627db0.a3e074","type":"websocket in","z":"53762a60.6160b4","name":"","server":"c91ee09b.1a258","client":"","x":120,"y":300,"wires":[["fc4eff16.dd3f8"]]},{"id":"bc4c68fa.9963a8","type":"comment","z":"53762a60.6160b4","name":"Handle Input from Webpage","info":"","x":160,"y":240,"wires":[]},{"id":"c6e6ed59.8e76a","type":"switch","z":"53762a60.6160b4","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":80,"wires":[["ac0517b6.d9e3f8"],["13b61216.32c1de"]]},{"id":"13b61216.32c1de","type":"link out","z":"53762a60.6160b4","name":"back to settings","links":["167e6a6e.86b396"],"x":335,"y":100,"wires":[]},{"id":"9f4fce9b.9166c","type":"template","z":"53762a60.6160b4","name":"Select Quick Page Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `quick_page`\nORDER BY `content` ASC;\n","output":"str","x":650,"y":180,"wires":[["564be98d.3a55c8"]]},{"id":"564be98d.3a55c8","type":"sqlite","z":"53762a60.6160b4","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":850,"y":180,"wires":[["ffb39ddf.99166","bcc3d7d2.eb5e98"]]},{"id":"7f378075.f7be8","type":"template","z":"53762a60.6160b4","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `quick_page`\nWHERE `index`={{payload}};","output":"str","x":430,"y":300,"wires":[["d9aa645.2a16c98"]]},{"id":"d9aa645.2a16c98","type":"sqlite","z":"53762a60.6160b4","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":610,"y":300,"wires":[["cdcb98ae.5c59b8","9f4fce9b.9166c"]]},{"id":"6b47318.4e6cbd","type":"template","z":"53762a60.6160b4","name":"Add Quick Page to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `quick_page` ('pagerNumber', 'sysID', 'content', 'FP') VALUES ('{{payload.pagerNumber}}', '{{payload.sysID}}', '{{{payload.content}}}','{{{payload.Beep}}}{{{payload.beep}}}{{{payload.Vibe}}}{{{payload.vibe}}}');","output":"str","x":940,"y":360,"wires":[["d5ea3a46.87db18","fe3e481f.ed3938"]]},{"id":"d5ea3a46.87db18","type":"sqlite","z":"53762a60.6160b4","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1130,"y":360,"wires":[["cdcb98ae.5c59b8"]]},{"id":"97d8194e.7a33a8","type":"http response","z":"53762a60.6160b4","name":"","statusCode":"","headers":{},"x":910,"y":300,"wires":[]},{"id":"10135363.fe9ead","type":"switch","z":"53762a60.6160b4","name":"","property":"payload.pagerNumber","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":600,"wires":[["958dd024.861a1"]]},{"id":"462fce27.0f5ca","type":"http in","z":"53762a60.6160b4","name":"","url":"/setQP","method":"post","upload":false,"swaggerDoc":"","x":110,"y":360,"wires":[["afe8f3e1.75e91","10135363.fe9ead"]]},{"id":"cdcb98ae.5c59b8","type":"change","z":"53762a60.6160b4","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/setQP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":300,"wires":[["97d8194e.7a33a8"]]},{"id":"958dd024.861a1","type":"switch","z":"53762a60.6160b4","name":"","property":"payload.Beep","propertyType":"msg","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":600,"wires":[["1d87eeb9.d998e1"],["53e2c166.67fc3"]]},{"id":"53e2c166.67fc3","type":"template","z":"53762a60.6160b4","name":"","field":"payload.Beep","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"B{{payload.Beep}}","output":"str","x":540,"y":620,"wires":[["1d87eeb9.d998e1"]]},{"id":"1d87eeb9.d998e1","type":"switch","z":"53762a60.6160b4","name":"","property":"payload.Vibe","propertyType":"msg","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":600,"wires":[["6b47318.4e6cbd"],["bfe05008.2f677"]]},{"id":"bfe05008.2f677","type":"template","z":"53762a60.6160b4","name":"","field":"payload.Vibe","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"V{{payload.Vibe}}","output":"str","x":780,"y":660,"wires":[["6b47318.4e6cbd"]]},{"id":"afe8f3e1.75e91","type":"debug","z":"53762a60.6160b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":270,"y":640,"wires":[]},{"id":"fe3e481f.ed3938","type":"debug","z":"53762a60.6160b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":1120,"y":400,"wires":[]},{"id":"e037583e.2056e8","type":"websocket in","z":"53762a60.6160b4","name":"","server":"c91ee09b.1a258","client":"","x":120,"y":180,"wires":[["ed2981b.7cb698"]]},{"id":"bcbbf453.9c3be8","type":"change","z":"9939c833.99b318","name":"","rules":[{"t":"set","p":"data","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":260,"wires":[["44b5460f.fe4328"]]},{"id":"a69165f3.061688","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `quick_page`;","name":"CaptureCall","x":550,"y":220,"wires":[["7bc4367c.81c528"]]},{"id":"7bc4367c.81c528","type":"change","z":"9939c833.99b318","name":"","rules":[{"t":"set","p":"quickpage","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":220,"wires":[["9e910a95.ff8228"]]},{"id":"bcaa4b58.b00838","type":"websocket in","z":"69336e92.97cdb","name":"","server":"a0966341.283ff","client":"","x":150,"y":640,"wires":[["dca52341.8c16b"]]},{"id":"dca52341.8c16b","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Shutdown","vt":"str"},{"t":"regex","v":"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":640,"wires":[[],["546dfdb9.54b494","34e58403.6dd92c"]]},{"id":"3f515a45.9371e6","type":"exec","z":"69336e92.97cdb","command":"shutdown -P now","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"","x":1590,"y":560,"wires":[["b9a5b18a.866ae"],["b9a5b18a.866ae"],["b9a5b18a.866ae"]]},{"id":"e4294a05.13e988","type":"delay","z":"69336e92.97cdb","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1420,"y":560,"wires":[["3f515a45.9371e6","18c59546.2acbbb"]]},{"id":"29adcff4.e3f22","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"CaptureCall is Shutting Down... Please Close your Browser (If Necessary)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":580,"wires":[["a61d55ea.1456e8"]]},{"id":"513b3c7d.0c1584","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Power Off','Power Off', '{{timestamp}}', '{{timestamp}}');","output":"str","x":1560,"y":600,"wires":[["3cfca496.2234dc"]]},{"id":"3cfca496.2234dc","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1710,"y":600,"wires":[[]]},{"id":"2915607d.c556d","type":"change","z":"69336e92.97cdb","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":600,"wires":[["513b3c7d.0c1584"]]},{"id":"b9a5b18a.866ae","type":"debug","z":"69336e92.97cdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1800,"y":560,"wires":[]},{"id":"7ac5988d.f9d118","type":"template","z":"69336e92.97cdb","name":"Clear","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `data` WHERE `exported` IS NOT NULL;","output":"str","x":1210,"y":380,"wires":[["ed55d58.3ba2528"]]},{"id":"ed55d58.3ba2528","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1350,"y":380,"wires":[["6249b7a0.8bf748"]]},{"id":"6249b7a0.8bf748","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Records Deleted","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":380,"wires":[["a3140b4b.44c628"]]},{"id":"a3140b4b.44c628","type":"change","z":"69336e92.97cdb","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":380,"wires":[["49f2faea.1f4d04"]]},{"id":"49f2faea.1f4d04","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` (`sender`, `status`, `content`, `statusTime`, `rxTime`) VALUES ('System', 'Records Deleted','Records Deleted', '{{timestamp}}', '{{timestamp}}');","output":"str","x":1820,"y":380,"wires":[["9811c3df.4feea"]]},{"id":"9811c3df.4feea","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1970,"y":380,"wires":[[]]},{"id":"b469ec62.d0cd9","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.resetLogExported","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":380,"wires":[["978eafdb.f4837"]]},{"id":"546dfdb9.54b494","type":"change","z":"69336e92.97cdb","name":"","rules":[{"t":"set","p":"to","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":640,"wires":[["8eab886c.96a868"]]},{"id":"3af57aa4.fb33f6","type":"template","z":"69336e92.97cdb","name":"Log Export","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `log` ('capcode', 'pagerNumber', 'sysID', 'group', 'content', 'msgPart1', 'msgPart2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload') \nVALUES ('0', '0', '0', '0', 'eMail Changed to {{global.to}}', 'n/a', 'n/a', 'System','{{timestamp}}', 'eMail Address Changed', '{{timestamp}}', 'n/a', 'n/a');\n","output":"str","x":770,"y":640,"wires":[["ffa14edd.0db52"]]},{"id":"ffa14edd.0db52","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":930,"y":640,"wires":[["38eb5a75.961926"]]},{"id":"8eab886c.96a868","type":"change","z":"69336e92.97cdb","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":640,"wires":[["3af57aa4.fb33f6"]]},{"id":"38eb5a75.961926","type":"link out","z":"69336e92.97cdb","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":1035,"y":640,"wires":[]},{"id":"2f6a8d56.b55d32","type":"http in","z":"3c78672c.9cb1f8","name":"","url":"/engineer/home","method":"post","upload":false,"swaggerDoc":"","x":140,"y":800,"wires":[["f5dc6436.88d388","c8941714.162de8","c015747.3acb388"]]},{"id":"f5dc6436.88d388","type":"debug","z":"3c78672c.9cb1f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":360,"y":800,"wires":[]},{"id":"ecb26282.47ff2","type":"template","z":"3c78672c.9cb1f8","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET home = '{{{payload.home}}}'\nWHERE ID = 1;","output":"str","x":540,"y":840,"wires":[["1d39beb6.73a071"]]},{"id":"1d39beb6.73a071","type":"sqlite","z":"3c78672c.9cb1f8","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":690,"y":840,"wires":[[]]},{"id":"c8941714.162de8","type":"change","z":"3c78672c.9cb1f8","name":"","rules":[{"t":"set","p":"home","pt":"global","to":"payload.home","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":840,"wires":[["ecb26282.47ff2"]]},{"id":"e990cea.1b2c23","type":"comment","z":"9939c833.99b318","name":"Left Side HTML","info":"","x":1680,"y":260,"wires":[]},{"id":"b88a294d.c11af8","type":"comment","z":"9939c833.99b318","name":"Right Side HTML","info":"","x":1520,"y":300,"wires":[]},{"id":"3157d2d8.f5f64e","type":"comment","z":"9939c833.99b318","name":"Headder and Body HTML","info":"","x":730,"y":120,"wires":[]},{"id":"b4c20ac6.7b8b68","type":"websocket in","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":910,"y":320,"wires":[["977a8359.456ba"]]},{"id":"708df698.457618","type":"websocket out","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":670,"y":320,"wires":[]},{"id":"ecbc89e0.affb98","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Reset Entire Database? WARNING: THIS CANNOT BE UNDONE!","output":"str","x":480,"y":320,"wires":[["708df698.457618"]]},{"id":"977a8359.456ba","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Reset Entire Database? WARNING: THIS CANNOT BE UNDONE!","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1090,"y":320,"wires":[["50f38ebe.b90e6"]]},{"id":"7faecb37.609ff4","type":"websocket out","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":670,"y":380,"wires":[]},{"id":"978eafdb.f4837","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Clear Exported Data? WARNING: THIS CANNOT BE UNDONE!","output":"str","x":480,"y":380,"wires":[["7faecb37.609ff4"]]},{"id":"580fce15.d73ed","type":"websocket in","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":910,"y":380,"wires":[["b67de664.bdfe78"]]},{"id":"b67de664.bdfe78","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Clear Exported Data? WARNING: THIS CANNOT BE UNDONE!","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1090,"y":380,"wires":[["7ac5988d.f9d118"]]},{"id":"39e06a8.af14296","type":"template","z":"9939c833.99b318","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Message
\n
Recipient
\n
Sent Time
\n
\n{{#data}}\n
\n
{{{part1}}}{{{part2}}}
\n
{{{alias}}}
\n
{{displayTime}}
\n
\n{{/data}}","output":"str","x":1250,"y":260,"wires":[["f862321.2f6e7d"]]},{"id":"12ad5379.1db21d","type":"websocket out","z":"9939c833.99b318","name":"","server":"1a6bd275.73c88e","client":"","x":1450,"y":220,"wires":[]},{"id":"4c539035.d5ee7","type":"function","z":"9939c833.99b318","name":"Convert Time to local","func":"var array = msg.data\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.data[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.data[i].displayDate = displayDate\n msg.data[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":260,"wires":[["39e06a8.af14296"]]},{"id":"b263223c.6f42f","type":"template","z":"9939c833.99b318","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0','{{{payload.msg.0}}}', '{{{payload.msg.1}}}', '0','{{timestamp}}', 'From Split Screen', '{{timestamp}}', 'n/a', 'n/a',1);","output":"str","x":1140,"y":580,"wires":[["c441337a.e7c32"]]},{"id":"c441337a.e7c32","type":"sqlite","z":"9939c833.99b318","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1310,"y":580,"wires":[["bd619cd9.3f938"]]},{"id":"2c2ddbc9.0d1744","type":"change","z":"9939c833.99b318","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":580,"wires":[["b263223c.6f42f"]]},{"id":"bd619cd9.3f938","type":"link out","z":"9939c833.99b318","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885"],"x":1415,"y":580,"wires":[]},{"id":"d9bf7487.dc9358","type":"websocket out","z":"b00e2d77.a9931","name":"","server":"4586ec4f.d85214","client":"","x":760,"y":740,"wires":[]},{"id":"a5a593bb.63b9d","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Email Sent","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":740,"wires":[["d9bf7487.dc9358"]]},{"id":"9ea76e9a.07424","type":"websocket out","z":"b00e2d77.a9931","name":"","server":"4586ec4f.d85214","client":"","x":740,"y":580,"wires":[]},{"id":"d08f4aa4.66b1b8","type":"change","z":"b00e2d77.a9931","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Email Failed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":580,"wires":[["9ea76e9a.07424"]]},{"id":"e92ec401.1e4398","type":"sqlite","z":"69336e92.97cdb","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"UPDATE `settings`\nSET email = {{payload}}\nWHERE ID = 1;","name":"","x":620,"y":680,"wires":[[]]},{"id":"34e58403.6dd92c","type":"template","z":"69336e92.97cdb","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET email = '{{payload}}'\nWHERE ID = 1;","output":"str","x":460,"y":680,"wires":[["e92ec401.1e4398"]]},{"id":"bcc3d7d2.eb5e98","type":"debug","z":"53762a60.6160b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1020,"y":140,"wires":[]},{"id":"e6c24b92.a57b38","type":"websocket in","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":1090,"y":580,"wires":[["db08ab58.800e18"]]},{"id":"93221454.7725a8","type":"websocket out","z":"69336e92.97cdb","name":"","server":"52036df9.0cfb64","client":"","x":850,"y":580,"wires":[]},{"id":"a61d55ea.1456e8","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"WARNING: You will need to physically disconnect and then re-connect power to CaptureCall in order to power-up again. Continue?","output":"str","x":660,"y":580,"wires":[["93221454.7725a8"]]},{"id":"a106b608.8de0a8","type":"websocket out","z":"69336e92.97cdb","name":"","server":"91b7d145.fc4e5","client":"","x":1740,"y":520,"wires":[]},{"id":"18c59546.2acbbb","type":"template","z":"69336e92.97cdb","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"CaptureCall is Shutting Down Please Close your Browser","output":"str","x":1570,"y":520,"wires":[["a106b608.8de0a8"]]},{"id":"873751a0.b7a04","type":"switch","z":"69336e92.97cdb","name":"","property":"payload.power","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":580,"wires":[["29adcff4.e3f22"]]},{"id":"94c17315.5561f","type":"debug","z":"69336e92.97cdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":110,"y":520,"wires":[]},{"id":"db08ab58.800e18","type":"switch","z":"69336e92.97cdb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"WARNING: You will need to physically disconnect and then re-connect power to CaptureCall in order to power-up again. Continue?","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1270,"y":580,"wires":[["e4294a05.13e988","2915607d.c556d"]]},{"id":"5cda5ed2.7e206","type":"http in","z":"23c43518.b3ff0a","name":"","url":"/display","method":"get","upload":false,"swaggerDoc":"","x":90,"y":120,"wires":[["815b7467.abb828"]]},{"id":"c2eec6b6.fa5fb8","type":"http in","z":"5f1f2b21.5baa74","name":"","url":"/browserpage","method":"get","upload":false,"swaggerDoc":"","x":150,"y":120,"wires":[["d6ecfc58.84801"]]},{"id":"5f7f2f85.bd9a8","type":"comment","z":"5f1f2b21.5baa74","name":"Build Webpage","info":"","x":320,"y":20,"wires":[]},{"id":"33c85dd8.3ce032","type":"change","z":"5f1f2b21.5baa74","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Browser Paging","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":100,"wires":[["86bceee6.a0441"]]},{"id":"1eb935a5.ba2dfa","type":"template","z":"5f1f2b21.5baa74","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"PAGE,{{payload.pager}},{{global.sysID}},{{{payload.msg.0}}}{{{payload.msg.1}}}","output":"str","x":660,"y":520,"wires":[["4c83195b.01c008"]]},{"id":"4c83195b.01c008","type":"serial out","z":"5f1f2b21.5baa74","name":"","serial":"5d6eb2f4.fc698c","x":810,"y":520,"wires":[]},{"id":"2fa388fc.037688","type":"template","z":"5f1f2b21.5baa74","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `data` ('capcode', 'pagerNumber', 'sysID', 'group', 'part1', 'part2', 'sender', 'rxTime', 'status', 'statusTime', 'FP', 'payload','T/R') \nVALUES ('0', '{{payload.pager}}', '{{global.sysID}}', '0', '{{payload.msg.0}}', '{{payload.msg.1}}', '0','{{timestamp}}', 'Browser Page', '{{timestamp}}', 'n/a', 'n/a','1');","output":"str","x":800,"y":560,"wires":[["e565330c.a5c13"]]},{"id":"e565330c.a5c13","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":990,"y":560,"wires":[["d667da62.00c798"]]},{"id":"3e90d93.5bbd626","type":"change","z":"5f1f2b21.5baa74","name":"Time","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":560,"wires":[["2fa388fc.037688"]]},{"id":"d667da62.00c798","type":"link out","z":"5f1f2b21.5baa74","name":"to Log","links":["13c2aaaa.74d295","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b"],"x":1095,"y":560,"wires":[]},{"id":"b1422f10.7c277","type":"http in","z":"5f1f2b21.5baa74","name":"","url":"/browserpage","method":"post","upload":false,"swaggerDoc":"","x":170,"y":460,"wires":[["6316a30.d05ed5c","1b4c8754.791ac9"]]},{"id":"6316a30.d05ed5c","type":"switch","z":"5f1f2b21.5baa74","name":"","property":"payload.msg","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":540,"wires":[["d3526ec8.6f8e2"]]},{"id":"d3526ec8.6f8e2","type":"switch","z":"5f1f2b21.5baa74","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":540,"wires":[["1eb935a5.ba2dfa","3e90d93.5bbd626"]]},{"id":"61d4836a.0e058c","type":"http response","z":"5f1f2b21.5baa74","name":"","statusCode":"","headers":{},"x":570,"y":460,"wires":[]},{"id":"1b4c8754.791ac9","type":"change","z":"5f1f2b21.5baa74","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/browserpage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":460,"wires":[["61d4836a.0e058c"]]},{"id":"ecac2614.625bd8","type":"comment","z":"a6d65e53.c700b","name":"Put Unprocessed On the Webpage","info":"","x":260,"y":300,"wires":[]},{"id":"693be647.1a3a18","type":"template","z":"a6d65e53.c700b","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0'\nORDER BY `rxTime` DESC \nLIMIT 5;\n\n","output":"str","x":390,"y":340,"wires":[["60641487.2aa19c"]]},{"id":"4a1a619f.d1abd","type":"websocket out","z":"a6d65e53.c700b","name":"","server":"c2dca4df.1b2b98","client":"","x":1470,"y":340,"wires":[]},{"id":"60641487.2aa19c","type":"sqlite","z":"a6d65e53.c700b","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":340,"wires":[["427f9ac6.8b9f24","5468c6f1.8007a8"]]},{"id":"4af20cc1.cde7e4","type":"template","z":"a6d65e53.c700b","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{#payload}}\n\n
\n {{{part1}}}\n
\n {{{part2}}} {{sender}}\n
\n {{{elapsed}}}\n
\n{{/payload}}","output":"str","x":1270,"y":340,"wires":[["4a1a619f.d1abd"]]},{"id":"bdd6e52e.c3f978","type":"websocket in","z":"a6d65e53.c700b","name":"","server":"1a6d181c.211418","client":"","x":180,"y":500,"wires":[["a1241fd2.c98bd"]]},{"id":"bfa9de91.5aefa","type":"comment","z":"a6d65e53.c700b","name":"Hide Message on Click","info":"","x":220,"y":460,"wires":[]},{"id":"389e0e76.89cba2","type":"template","z":"a6d65e53.c700b","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', `cleared` = 1 WHERE `index` = {{payload}};","output":"str","x":670,"y":480,"wires":[["f2e136eb.ba69f8"]]},{"id":"f2e136eb.ba69f8","type":"sqlite","z":"a6d65e53.c700b","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":870,"y":480,"wires":[["65178d5f.6c89f4"]]},{"id":"65178d5f.6c89f4","type":"link out","z":"a6d65e53.c700b","name":"","links":["13c2aaaa.74d295","81bc9a1b.ba8868","f72ff61b.e8d618","f8b2c7bc.b77368","18c85238.12770e","e7fc0665.f65b68","bcfd7457.19e388","4a4f10a5.b3051","b5c92d.f71dc6d","243d97b4.836608","2b072128.63ebce","9f9249fe.868128","e1745f49.c16d5","310fbd39.4aefd2","5c2e41bd.c154c","5926e1bf.54874","a33f9456.00f078","b09c63b7.c9885","a62b911a.4bb8b","7943dd69.607604"],"x":975,"y":480,"wires":[]},{"id":"2d06e176.b31b5e","type":"change","z":"a6d65e53.c700b","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":480,"wires":[["389e0e76.89cba2"]]},{"id":"a1241fd2.c98bd","type":"switch","z":"a6d65e53.c700b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":500,"wires":[["2d06e176.b31b5e"],["f15b3465.3f4f58"]]},{"id":"81bc9a1b.ba8868","type":"link in","z":"a6d65e53.c700b","name":"Received Page","links":["c94a9d48.9c2c","f15b3465.3f4f58","65178d5f.6c89f4"],"x":275,"y":380,"wires":[["693be647.1a3a18"]]},{"id":"427f9ac6.8b9f24","type":"function","z":"a6d65e53.c700b","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":340,"wires":[["2ca0ae66.d871a2"]]},{"id":"f15b3465.3f4f58","type":"link out","z":"a6d65e53.c700b","name":"","links":["81bc9a1b.ba8868"],"x":435,"y":520,"wires":[]},{"id":"bd49881d.1db498","type":"http in","z":"a6d65e53.c700b","name":"","url":"/conference","method":"get","upload":false,"swaggerDoc":"","x":160,"y":220,"wires":[["c6ca1d6f.8bcf5","3ee50bd6.525a64"]]},{"id":"30f4d6fa.9ba46a","type":"comment","z":"a6d65e53.c700b","name":"Build Webpage","info":"","x":200,"y":60,"wires":[]},{"id":"d7033cb5.a545c","type":"http response","z":"a6d65e53.c700b","name":"","statusCode":"201","headers":{},"x":840,"y":200,"wires":[]},{"id":"a814b6a0.1e4978","type":"template","z":"a6d65e53.c700b","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n\n {{title}}\n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n {{{global.left}}}\n
\n\n
\n

{{title}}

\n
\n\n
\n
\n
\n\n
\n\n
\n
\n\n\n\n","output":"str","x":710,"y":200,"wires":[["d7033cb5.a545c"]]},{"id":"70360a1e.d34914","type":"change","z":"a6d65e53.c700b","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Conference Room Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":200,"wires":[["f8260adf.30aca8"]]},{"id":"e784227f.6661c","type":"inject","z":"a6d65e53.c700b","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":340,"wires":[["693be647.1a3a18"]]},{"id":"f8260adf.30aca8","type":"template","z":"a6d65e53.c700b","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":" var receive = new WebSocket('ws://' + location.host + '/conference/receive');\n var send = new WebSocket('ws://' + location.host + '/conference/send');\n\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n//Play Sound\nsend.onmessage = function(d) {\nvar audio = document.getElementById(\"beep\"); \n audio.play()\n};\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":590,"y":200,"wires":[["a814b6a0.1e4978"]]},{"id":"2ca0ae66.d871a2","type":"function","z":"a6d65e53.c700b","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":920,"y":340,"wires":[["5dc3c713.2c4ff8"]]},{"id":"5dc3c713.2c4ff8","type":"function","z":"a6d65e53.c700b","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(11, 8); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1110,"y":340,"wires":[["4af20cc1.cde7e4"]]},{"id":"c6ca1d6f.8bcf5","type":"switch","z":"a6d65e53.c700b","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":220,"wires":[["70360a1e.d34914"],["12e7e314.ca01cd"]]},{"id":"12e7e314.ca01cd","type":"link out","z":"a6d65e53.c700b","name":"","links":["f13a1f16.82872"],"x":435,"y":240,"wires":[]},{"id":"3ee50bd6.525a64","type":"debug","z":"a6d65e53.c700b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":260,"wires":[]},{"id":"5468c6f1.8007a8","type":"debug","z":"a6d65e53.c700b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":730,"y":300,"wires":[]},{"id":"1cbf532e.685a3d","type":"function","z":"e3cbac21.52804","name":"Split Received Pager Data ","func":"//Regex to match both RX1 and LRS TX7470 See Explanation File\nvar result = msg.payload.match(/\\x19A(\\d*)d\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\x0c?(.*)?\\x18|\\x19A(\\d*)d(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?\\x18|RECV,4,(\\d*),\\[?(\\d*)?\\]?(.*)-(\\S+)\\s(\\d+)?\\:?(\\w*)?\\s?\\d?\\%?0?C?(.*)?|RECV,4,(\\d*),(\\S*)\\s?(\\d+)?\\:?(\\w*)?\\s?\\d?/);\n\n//Group Regex Results\nvar capcode = result[1]||result[8]||result[12]||result[19];\nvar group = result[2]||result[13];\nvar part1 = result[3]||result[9]||result[14]||result[20];\nvar part2 = result[4]||result[15];\nvar sender = result[5]||result[10]||result[16]||result[21];\nvar cleared = result[6]||result[11]||result[17]||result[22];\nvar FP = result[7]||result[18];\n\n//Calculate Pager number and SysID\nvar pagerStr = capcode.substring(capcode.length - 5, capcode.Length);\nvar pagercalc = parseInt(pagerStr);\nvar pagerNumber = pagercalc/8;\nvar sysID = ((capcode - pagercalc)-700000)/100000;\n\n//Convert Cleared to Boolean\nif (typeof cleared === \"undefined\") {\n msg.cleared = 0;\n msg.status = \"n/a\"\n} else { \n msg.cleared = 1;\n msg.status = \"Clearing Message\"\n}\n\n//Convert Late to Boolean\nvar late=global.get('late') || \"Late\";\nif (part1 === late) {\n msg.late = 1;\n} else { \n msg.late = 0;\n}\n\n\n\n//Set Up Outputs\nmsg.result = result;\nmsg.capcode = capcode;\nmsg.pagerNumber = pagerNumber;\nmsg.sysID = sysID;\nmsg.group = group;\nmsg.part1 = part1;\nmsg.part2 = part2;\n msg.FP = FP;\nmsg.sender = sender;\nmsg.timestamp = Date.now(); //Current Timestamp\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":240,"wires":[["cd63b42b.c622b8"]]},{"id":"349d8d25.ff88c2","type":"function","z":"8f4a2a74.1d74a8","name":"LRS Process Page","func":"//Input\nvar payload = msg.payload;\nvar shortened = payload.slice(6,payload.length -2) //Remove Serial Data from front of Message\nvar duplicate = msg.duplicate;\n//Get Capcode and Message\nvar capcode = shortened.substring(1,8);\nvar message = shortened.substring(9,payload.length);\n\n//Calculate Pager number and SysID\nvar cc = capcode.toString();\nvar pagerStr = cc.substring(cc.length - 5, cc.Length);\nvar pagercalc = parseInt(pagerStr);\nvar pagerNumber = pagercalc/8;\nvar sysID = ((capcode - pagercalc)-700000)/100000;\n\n//Check If Group Message\nif (message.includes(\"[\")) {\n var group = message.substring(1,3);\n var msgStart = message.indexOf(\"]\") + 1;\n} else { \n var group = \"n/a\";\n var msgStart = 0;\n}\n\n//Check If Contains Flash Pattern and Get Sender ID\nif (message.includes(\"%\")) {\n var percentIndex = message.indexOf(\"%\"); //Find Index of %\n var FP = message.substring(percentIndex + 3,message.length);\n var senderMessy = message.substring(percentIndex - 2, percentIndex);\n var sender = senderMessy.trim();\n var msgEnd = percentIndex -3;\n} else { \n var FP = \"n/a\";\n var senderMessy = message.substring(message.length - 2, message.length);\n var sender = senderMessy.trim();\n var msgEnd = message.length - 2;\n}\n\n//Get Total Message\nvar content = message.substring(msgStart,msgEnd);\n\n//Split Message into Part 1 and Part 2\nvar Part = content.split(\"-\");\n\nvar msgPart1 = Part[0];\nvar msgPart2 = Part[1];\n\n//Set Status Message\n\nif (message.includes(\"Handled\")) {\n var status = \"Attended\";\n} else if (message.includes(\"Late\")) {\n var status = \"Late\";\n} else if (duplicate === true) {\n var status = \"Duplicate\";\n}else {\n var status = \"Active\";\n}\n\n//Outputs\nmsg.capcode = capcode; //Capcode\nmsg.pagerNumber = pagerNumber; //Pager Number\nmsg.sysID = sysID; //System ID\nmsg.group = group; //Group Number\nmsg.content = content; //Whole Message\nmsg.msgPart1 = msgPart1 //Part One of Message\nmsg.msgPart2 = msgPart2 //Part Two of Message\nmsg.sender = sender; //Originating Button or Table\nmsg.timestamp = Date.now(); //Current Timestamp\nmsg.Status = status; //Status\nmsg.FP = FP; //Flash Pattern\nmsg.payload = payload;\nreturn msg;","outputs":1,"noerr":0,"x":1010,"y":100,"wires":[[]]},{"id":"7ad51ff1.1d5bc","type":"comment","z":"8f4a2a74.1d74a8","name":"Receive Page LRS","info":"","x":130,"y":80,"wires":[]},{"id":"305e69b.97a0f96","type":"switch","z":"8f4a2a74.1d74a8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"prev"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":120,"wires":[["81e7848a.e7a048"],["44d52fc.36e19d"]]},{"id":"44d52fc.36e19d","type":"switch","z":"8f4a2a74.1d74a8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Reset","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":140,"wires":[["349d8d25.ff88c2"],[]]},{"id":"5189e8ae.3134e8","type":"delay","z":"8f4a2a74.1d74a8","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":160,"wires":[["955acd81.a75f7"]]},{"id":"955acd81.a75f7","type":"change","z":"8f4a2a74.1d74a8","name":"Reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"Reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":160,"wires":[["305e69b.97a0f96"]]},{"id":"81e7848a.e7a048","type":"change","z":"8f4a2a74.1d74a8","name":"","rules":[{"t":"set","p":"duplicate","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":100,"wires":[["349d8d25.ff88c2"]]},{"id":"32b7704c.e1af","type":"delay","z":"8f4a2a74.1d74a8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":280,"y":160,"wires":[["5189e8ae.3134e8"]]},{"id":"4b3910f5.5d0a","type":"http response","z":"4ff720ae.e74bd","name":"","statusCode":"201","headers":{},"x":820,"y":220,"wires":[]},{"id":"86a76044.4a4b6","type":"comment","z":"4ff720ae.e74bd","name":"Build Webpage","info":"","x":200,"y":100,"wires":[]},{"id":"aaa334ce.cfa1e8","type":"template","z":"4ff720ae.e74bd","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n\n \n\n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":690,"y":220,"wires":[["4b3910f5.5d0a"]]},{"id":"6cf49682.74b3a8","type":"template","z":"4ff720ae.e74bd","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/bar/receive');\nvar send = new WebSocket('ws://' + location.host + '/bar/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":570,"y":220,"wires":[["aaa334ce.cfa1e8"]]},{"id":"a0957acd.e4e1e8","type":"http in","z":"4ff720ae.e74bd","name":"","url":"/big","method":"get","upload":false,"swaggerDoc":"","x":160,"y":240,"wires":[["68bab3b3.1a61bc"]]},{"id":"116e1fbb.0dbdb","type":"change","z":"4ff720ae.e74bd","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Big Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":220,"wires":[["6cf49682.74b3a8"]]},{"id":"68bab3b3.1a61bc","type":"switch","z":"4ff720ae.e74bd","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":240,"wires":[["116e1fbb.0dbdb"],["c8fee362.8be85"]]},{"id":"c8fee362.8be85","type":"link out","z":"4ff720ae.e74bd","name":"","links":["f13a1f16.82872"],"x":415,"y":260,"wires":[]},{"id":"38281131.9ffbce","type":"comment","z":"4ff720ae.e74bd","name":"Put All On the Webpage","info":"","x":200,"y":300,"wires":[]},{"id":"350ea78c.7b4cc8","type":"template","z":"4ff720ae.e74bd","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM data\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0' AND `sender` != 'system'\nORDER BY `index` ASC\nLIMIT 5;","output":"str","x":390,"y":400,"wires":[["e4c07e7d.8209e"]]},{"id":"ef7dd1c4.c745f","type":"websocket out","z":"4ff720ae.e74bd","name":"","server":"15d62cbe.d62773","client":"","x":1560,"y":400,"wires":[]},{"id":"e4c07e7d.8209e","type":"sqlite","z":"4ff720ae.e74bd","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":400,"wires":[["3767ddf3.b3c8b2","cb367c00.a2955"]]},{"id":"6d2db6cd.b30b68","type":"function","z":"4ff720ae.e74bd","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":900,"y":400,"wires":[["fe84d37b.4370c"]]},{"id":"a33f9456.00f078","type":"link in","z":"4ff720ae.e74bd","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","aa72ab3f.277cf8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4","ce5be23d.4618f","64848176.9353c","2c9c0640.62baca","165a0427.c0341c","b7cb91ea.e008a"],"x":235,"y":460,"wires":[["350ea78c.7b4cc8"]]},{"id":"3767ddf3.b3c8b2","type":"function","z":"4ff720ae.e74bd","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":400,"wires":[["6d2db6cd.b30b68"]]},{"id":"7b2d59df.6f8758","type":"template","z":"4ff720ae.e74bd","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n
Time
\n
Location
\n
Wait Time
\n
\n{{#payload}}\n
\n
{{{displayTime}}}
\n
{{{alias}}}{{^alias}}{{sender}}{{/alias}}
\n
{{elapsed}}
\n
\n{{/payload}}","output":"str","x":1350,"y":400,"wires":[["ef7dd1c4.c745f"]]},{"id":"20ed0eda.2e6c82","type":"switch","z":"4ff720ae.e74bd","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":340,"wires":[[],["350ea78c.7b4cc8"]]},{"id":"2703b996.e60596","type":"websocket in","z":"4ff720ae.e74bd","name":"","server":"7b602086.fa4f5","client":"","x":90,"y":340,"wires":[["20ed0eda.2e6c82"]]},{"id":"fe84d37b.4370c","type":"function","z":"4ff720ae.e74bd","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(14, 5); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1120,"y":400,"wires":[["7b2d59df.6f8758","bcb9a64e.219718"]]},{"id":"db764110.ca549","type":"inject","z":"4ff720ae.e74bd","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":400,"wires":[["350ea78c.7b4cc8"]]},{"id":"1c947022.1bfe3","type":"websocket in","z":"4ff720ae.e74bd","name":"","server":"7b602086.fa4f5","client":"","x":130,"y":560,"wires":[["ffb306af.a621c8"]]},{"id":"87e4c6ed.e84968","type":"comment","z":"4ff720ae.e74bd","name":"Hide Message on Click","info":"","x":160,"y":520,"wires":[]},{"id":"c125e8b4.e901d8","type":"template","z":"4ff720ae.e74bd","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', cleared = 1 WHERE `index` = {{payload}};","output":"str","x":610,"y":560,"wires":[["148076a5.6e76d9"]]},{"id":"148076a5.6e76d9","type":"sqlite","z":"4ff720ae.e74bd","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":810,"y":560,"wires":[["439e3a4.33f4dc4"]]},{"id":"439e3a4.33f4dc4","type":"link out","z":"4ff720ae.e74bd","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec"],"x":915,"y":560,"wires":[]},{"id":"ac585b7a.1733e8","type":"change","z":"4ff720ae.e74bd","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":560,"wires":[["c125e8b4.e901d8"]]},{"id":"ffb306af.a621c8","type":"switch","z":"4ff720ae.e74bd","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":560,"wires":[["ac585b7a.1733e8"]]},{"id":"bcb9a64e.219718","type":"debug","z":"4ff720ae.e74bd","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1280,"y":360,"wires":[]},{"id":"96f0724f.dc67","type":"change","z":"e3cbac21.52804","name":"","rules":[{"t":"set","p":"duplicate","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":260,"wires":[["c94a9d48.9c2c"]]},{"id":"9301bc45.dca2a","type":"change","z":"e3cbac21.52804","name":"","rules":[{"t":"set","p":"duplicate","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":220,"wires":[["c94a9d48.9c2c"]]},{"id":"6579a230.6630bc","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"late","pt":"global","to":"Repage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":720,"wires":[[]]},{"id":"d3cc339c.3f9a3","type":"debug","z":"e3cbac21.52804","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1390,"y":300,"wires":[]},{"id":"b374a788.183148","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":940,"wires":[]},{"id":"78ace38b.18330c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":900,"wires":[["556b0e9f.f6536"]]},{"id":"62623f54.11db1","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE \"data\" ( `index` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `capcode` INTEGER, `pagerNumber` INTEGER, `sysID` INTEGER, `group` INTEGER, `part1` TEXT, `part2` TEXT, `sender` INTEGER, `FP` TEXT, `rxTime` INTEGER, `status` INTEGER, `statusTime` INTEGER, `exported` INTEGER, `cleared` INTEGER, `late` INTEGER, `duplicate` INTEGER, `T/R` INTEGER, `payload` TEXT )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":900,"wires":[["78ace38b.18330c"]]},{"id":"556b0e9f.f6536","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":900,"wires":[]},{"id":"84ad9d67.c4c0d","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":1060,"wires":[["ffe0a0cc.394ae"]]},{"id":"d1ee2e00.7fbc4","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":1060,"wires":[["84ad9d67.c4c0d"]]},{"id":"19b9c29a.dafd0d","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":940,"wires":[["b374a788.183148"]]},{"id":"1286d3b6.902f2c","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":940,"wires":[["19b9c29a.dafd0d"]]},{"id":"b11d6374.93d22","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":980,"wires":[]},{"id":"6f8f2998.ba0248","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":980,"wires":[["b11d6374.93d22"]]},{"id":"f6735051.cc788","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":980,"wires":[["6f8f2998.ba0248"]]},{"id":"ffe0a0cc.394ae","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":1060,"wires":[]},{"id":"5b125aa5.a84b34","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":1020,"wires":[]},{"id":"5cfcd9f0.bfe708","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":1020,"wires":[["5b125aa5.a84b34"]]},{"id":"f26329eb.28ef88","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1020,"wires":[["5cfcd9f0.bfe708"]]},{"id":"d9f740ee.f7d7c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":490,"y":1100,"wires":[["cd846e21.6a43c"]]},{"id":"4e8a45f.f4c89bc","type":"inject","z":"ba76d305.cf8ad","name":"Clear Old Records","topic":"DELETE FROM `data` WHERE `index` IN (SELECT `index` FROM `log` ORDER BY `index` DESC LIMIT -1 OFFSET 2000) AND `exported` IS NOT NULL;","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":1100,"wires":[["d9f740ee.f7d7c"]]},{"id":"cd846e21.6a43c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":650,"y":1100,"wires":[]},{"id":"55482138.f3d76","type":"comment","z":"ba76d305.cf8ad","name":"Data","info":"","x":490,"y":860,"wires":[]},{"id":"5d19cfa1.ed974","type":"debug","z":"b8bd1cc3.4827","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":360,"wires":[]},{"id":"6fb08921.c8e198","type":"switch","z":"e3cbac21.52804","name":"","property":"cleared","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1390,"y":260,"wires":[["67027f52.0807"],[]]},{"id":"67027f52.0807","type":"template","z":"e3cbac21.52804","name":"Update Cleared","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Cleared Remotely', statusTime = '{{timestamp}}', cleared = 1 WHERE `sender` = {{sender}} AND `cleared` = 0;","output":"str","x":1540,"y":260,"wires":[["76901721.920c58"]]},{"id":"7793973e.ce5438","type":"debug","z":"9939c833.99b318","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":400,"y":620,"wires":[]},{"id":"e1963d60.f46e6","type":"debug","z":"53e35596.381c0c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":420,"wires":[]},{"id":"cb367c00.a2955","type":"debug","z":"4ff720ae.e74bd","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":340,"wires":[]},{"id":"62743a5f.4888e4","type":"http response","z":"c8c5b763.cd1498","name":"","statusCode":"201","headers":{},"x":820,"y":220,"wires":[]},{"id":"4a9dfb5a.d03194","type":"comment","z":"c8c5b763.cd1498","name":"Build Webpage","info":"","x":200,"y":100,"wires":[]},{"id":"dfcaabee.673268","type":"template","z":"c8c5b763.cd1498","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n\n \n {{title}}\n \n \n \n\n \n \n \n\n\n\n\n \n \n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n\n
\n\n\n\n","output":"str","x":690,"y":220,"wires":[["62743a5f.4888e4"]]},{"id":"9bb11c1e.305b4","type":"template","z":"c8c5b763.cd1498","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/location/receive');\nvar send = new WebSocket('ws://' + location.host + '/location/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}","output":"str","x":570,"y":220,"wires":[["dfcaabee.673268"]]},{"id":"38d374fa.18eeac","type":"http in","z":"c8c5b763.cd1498","name":"","url":"/location","method":"get","upload":false,"swaggerDoc":"","x":110,"y":240,"wires":[["5b86d98e.320508"]]},{"id":"a593260e.3cab78","type":"change","z":"c8c5b763.cd1498","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Wait Time Display","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":220,"wires":[["9bb11c1e.305b4"]]},{"id":"5b86d98e.320508","type":"switch","z":"c8c5b763.cd1498","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":240,"wires":[["a593260e.3cab78"],["a593260e.3cab78"]]},{"id":"f2226618.7daa98","type":"link out","z":"c8c5b763.cd1498","name":"","links":["f13a1f16.82872"],"x":455,"y":260,"wires":[]},{"id":"ac7b5a0c.12e788","type":"comment","z":"c8c5b763.cd1498","name":"Put All On the Webpage","info":"","x":200,"y":300,"wires":[]},{"id":"67faab1.46f3954","type":"template","z":"c8c5b763.cd1498","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM data\nLEFT JOIN callpoint_Alias ON data.sender = callpoint_Alias.callpoint\nWHERE `cleared` = '0'\nORDER BY `index` ASC\nLIMIT 6;","output":"str","x":390,"y":400,"wires":[["1fd99352.f04f8d"]]},{"id":"b0ae7635.a4f898","type":"websocket out","z":"c8c5b763.cd1498","name":"","server":"39f67bec.0b2fe4","client":"","x":1580,"y":400,"wires":[]},{"id":"1fd99352.f04f8d","type":"sqlite","z":"c8c5b763.cd1498","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":400,"wires":[["8065fc77.21f1f"]]},{"id":"15f63175.ed111f","type":"function","z":"c8c5b763.cd1498","name":"Convert Time to local","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.payload[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n var statusTime = new Date(msg.payload[i].statusTime);\n var displayStatusDate = statusTime.toLocaleDateString();\n var displayStatusTime = statusTime.toLocaleTimeString();\n \n \n \n if (msg.payload[i].exported === null) {\n msg.payload[i].displayExportedTime = \"n/a\"\n msg.payload[i].displayExportedDate = \"n/a\"\n} else {\nvar exportedTime = new Date(msg.payload[i].exported);\n var displayExportedDate = exportedTime.toLocaleDateString();\n var displayExportedTime = exportedTime.toLocaleTimeString();\n \n msg.payload[i].displayExportedTime = displayExportedTime\n msg.payload[i].displayExportedDate = displayExportedDate\n} \n \n \n msg.payload[i].displayStatusTime = displayStatusTime\n msg.payload[i].displayStatusDate = displayStatusDate\n \n msg.payload[i].displayDate = displayDate\n msg.payload[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":900,"y":400,"wires":[["c8b58dea.f7d9c"]]},{"id":"aec2bb4a.2b7638","type":"link in","z":"c8c5b763.cd1498","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","aa72ab3f.277cf8","5ce459da.1e66f8","dde42ec0.d2e1f","50e59502.8aad2c","38eb5a75.961926","bd619cd9.3f938","d667da62.00c798","65178d5f.6c89f4"],"x":235,"y":460,"wires":[["67faab1.46f3954"]]},{"id":"8065fc77.21f1f","type":"function","z":"c8c5b763.cd1498","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP !== \"\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":400,"wires":[["15f63175.ed111f"]]},{"id":"956c8b78.0249e8","type":"template","z":"c8c5b763.cd1498","name":"Build Data (div Backup)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n \n
\n
\n
{{{payload.0.alias}}}{{^payload.0.alias}}{{payload.0.sender}}{{/payload.0.alias}}
\n
{{payload.0.displayTime}}
\n
{{payload.0.elapsed}}
\n
\n \n
\n
{{{payload.1.alias}}}{{^payload.1.alias}}{{payload.1.sender}}{{/payload.1.alias}}
\n
{{payload.1.displayTime}}
\n
{{payload.1.elapsed}}
\n
\n\n
\n
{{{payload.2.alias}}}{{^payload.2.alias}}{{payload.2.sender}}{{/payload.2.alias}}
\n
{{payload.2.displayTime}}
\n
{{payload.2.elapsed}}
\n
\n\n
\n
{{{payload.3.alias}}}{{^payload.3.alias}}{{payload.3.sender}}{{/payload.3.alias}}
\n
{{payload.3.displayTime}}
\n
{{payload.3.elapsed}}
\n
\n\n
\n
{{{payload.4.alias}}}{{^payload.4.alias}}{{payload.4.sender}}{{/payload.4.alias}}
\n
{{payload.4.displayTime}}
\n
{{payload.4.elapsed}}
\n
\n\n
\n
{{{payload.5.alias}}}{{^payload.5.alias}}{{payload.5.sender}}{{/payload.5.alias}}
\n
{{payload.5.displayTime}}
\n
{{payload.5.elapsed}}
\n
\n
","output":"str","x":1350,"y":400,"wires":[["b0ae7635.a4f898"]]},{"id":"865343b.d02dfc","type":"switch","z":"c8c5b763.cd1498","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":340,"wires":[[],["67faab1.46f3954"]]},{"id":"1e09b706.e283d9","type":"websocket in","z":"c8c5b763.cd1498","name":"","server":"a6feaa7b.4b5558","client":"","x":150,"y":340,"wires":[["4b263e29.54c52"]]},{"id":"c8b58dea.f7d9c","type":"function","z":"c8c5b763.cd1498","name":"Time elapsed","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = msg.payload[i].rxTime;\n var now = Date.now();\n \nvar elapsedTS = now -rxtime;\nvar elapsedS = parseInt(elapsedTS / 1000);\n\nvar date = new Date(null); \ndate.setSeconds(elapsedS); // specify value for SECONDS here\nvar elapsed = date.toISOString().substr(14, 5); \n\nmsg.payload[i].elapsed = elapsed\n\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1120,"y":400,"wires":[["956c8b78.0249e8","38937a17.5d71f6"]]},{"id":"5ecb9387.0d222c","type":"inject","z":"c8c5b763.cd1498","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":400,"wires":[[]]},{"id":"2ef6c771.e22d98","type":"websocket in","z":"c8c5b763.cd1498","name":"","server":"a6feaa7b.4b5558","client":"","x":150,"y":560,"wires":[["e3eddf7e.b19ea"]]},{"id":"51a2e843.ed6658","type":"comment","z":"c8c5b763.cd1498","name":"Hide Message on Click","info":"","x":160,"y":520,"wires":[]},{"id":"7eacb804.72a458","type":"template","z":"c8c5b763.cd1498","name":"Update Active to Handled","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `data` SET status = 'Manually Removed', statusTime = '{{timestamp}}', cleared = 1 WHERE `index` = {{payload}};","output":"str","x":630,"y":560,"wires":[["5cb98ae8.12e0e4"]]},{"id":"5cb98ae8.12e0e4","type":"sqlite","z":"c8c5b763.cd1498","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":830,"y":560,"wires":[["8c92895d.82c2b8"]]},{"id":"8c92895d.82c2b8","type":"link out","z":"c8c5b763.cd1498","name":"","links":["13c2aaaa.74d295","f8b2c7bc.b77368","ed29f70d.9b66f8","f72ff61b.e8d618","9f5ece3e.bbcec"],"x":935,"y":560,"wires":[]},{"id":"d035be00.6d755","type":"change","z":"c8c5b763.cd1498","name":"Time Now","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":560,"wires":[["7eacb804.72a458"]]},{"id":"e3eddf7e.b19ea","type":"switch","z":"c8c5b763.cd1498","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"num","v2":"9999","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":560,"wires":[["d035be00.6d755"]]},{"id":"38937a17.5d71f6","type":"debug","z":"c8c5b763.cd1498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1280,"y":360,"wires":[]},{"id":"d6ecfc58.84801","type":"switch","z":"5f1f2b21.5baa74","name":"Licenced?","property":"modules","propertyType":"global","rules":[{"t":"cont","v":"req.url","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":120,"wires":[["33c85dd8.3ce032"],["7ac9201a.5756a"]]},{"id":"7ac9201a.5756a","type":"link out","z":"5f1f2b21.5baa74","name":"","links":["f13a1f16.82872"],"x":455,"y":140,"wires":[]},{"id":"575733eb.f4b5cc","type":"http response","z":"5f1f2b21.5baa74","name":"","statusCode":"201","headers":{},"x":860,"y":100,"wires":[]},{"id":"a2f82770.62bfc8","type":"template","z":"5f1f2b21.5baa74","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n \n\n\n\n \n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n
\n
\n\n\n\n\n","output":"str","x":730,"y":100,"wires":[["575733eb.f4b5cc"]]},{"id":"86bceee6.a0441","type":"template","z":"5f1f2b21.5baa74","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/browserpage/receive');\nvar one = new WebSocket('ws://' + location.host + '/browserpage/receive/one');\nvar send = new WebSocket('ws://' + location.host + '/browserpage/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":610,"y":100,"wires":[["a2f82770.62bfc8"]]},{"id":"266384d.436177c","type":"comment","z":"5f1f2b21.5baa74","name":"Headder and Body HTML","info":"","x":770,"y":60,"wires":[]},{"id":"5ae3627c.893d6c","type":"template","z":"5f1f2b21.5baa74","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT *\nFROM `data`\nLEFT JOIN pagerAlias ON data.pagerNumber = pagerAlias.pagerNumber\nWHERE date(datetime(rxtime / 1000 , 'unixepoch')) = date('now') AND `T/R` = '1'\nORDER BY `rxTime` DESC;","output":"str","x":390,"y":300,"wires":[["d5a615cf.443d38"]]},{"id":"68c99f17.874bc","type":"websocket out","z":"5f1f2b21.5baa74","name":"","server":"846cfc61.5ccfe","client":"","x":1490,"y":300,"wires":[]},{"id":"d5a615cf.443d38","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":570,"y":300,"wires":[["db0135c3.449e28"]]},{"id":"2fb13b26.8e2db4","type":"template","z":"5f1f2b21.5baa74","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n\n \n \n  Quick Message:\n  Recipient:\n \n
\n
\n\n
","output":"str","x":890,"y":240,"wires":[["16ff5c7a.8b3b84"]]},{"id":"88c190e6.24c48","type":"function","z":"5f1f2b21.5baa74","name":"Set Style","func":"var array = msg.payload\nvar i;\nfor (i = 0; i < array.length; i++) { \n \n if (msg.payload[i].FP != \"n/a\") {\n msg.payload[i].style = msg.payload[i].FP\n} else {\n msg.payload[i].style = \"default\"\n}\n}\nreturn msg;","outputs":1,"noerr":0,"x":880,"y":300,"wires":[["2f034fdc.75d47"]]},{"id":"a62b911a.4bb8b","type":"link in","z":"5f1f2b21.5baa74","name":"log","links":["363f5c70.e7e144","320906f1.fd1fba","ecbc4376.b117e","d2d8b8d2.67e9a8","8469e8af.2a6df8","2c38eaf2.df6f76","bc4b27b0.6d1478","5652483b.e30f08","e14222d1.c9cb7","f40e69c9.7d2798","18e72d9f.360682","80365a9f.6e5ef8","baaeb70f.7624e8","5ce459da.1e66f8","dde42ec0.d2e1f","ce5be23d.4618f","38eb5a75.961926","64848176.9353c","d667da62.00c798","65178d5f.6c89f4","2c9c0640.62baca","b7cb91ea.e008a"],"x":215,"y":300,"wires":[["63b4994a.1e5468","5ae3627c.893d6c"]]},{"id":"26fa2cb5.b2b114","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `pagerAlias`;","name":"CaptureCall","x":730,"y":240,"wires":[["2fb13b26.8e2db4"]]},{"id":"db0135c3.449e28","type":"change","z":"5f1f2b21.5baa74","name":"","rules":[{"t":"set","p":"data","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":300,"wires":[["88c190e6.24c48"]]},{"id":"63b4994a.1e5468","type":"sqlite","z":"5f1f2b21.5baa74","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT * FROM `quick_page`;","name":"CaptureCall","x":370,"y":240,"wires":[["c1e99af2.f6ead8"]]},{"id":"c1e99af2.f6ead8","type":"change","z":"5f1f2b21.5baa74","name":"","rules":[{"t":"set","p":"quickpage","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":240,"wires":[["26fa2cb5.b2b114"]]},{"id":"d42e192a.8b7738","type":"template","z":"5f1f2b21.5baa74","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"
\n\n
\n
Message
\n
Recipient
\n
Sent Time
\n
\n{{#data}}\n
\n
{{{part1}}}{{{part2}}}
\n
{{{alias}}}
\n
{{displayTime}}
\n
\n{{/data}}\n \n
","output":"str","x":1270,"y":300,"wires":[["68c99f17.874bc"]]},{"id":"16ff5c7a.8b3b84","type":"websocket out","z":"5f1f2b21.5baa74","name":"","server":"654f3d23.7221e4","client":"","x":1110,"y":240,"wires":[]},{"id":"2f034fdc.75d47","type":"function","z":"5f1f2b21.5baa74","name":"Convert Time to local","func":"var array = msg.data\nvar i;\nfor (i = 0; i < array.length; i++) { \n var rxtime = new Date(msg.data[i].rxTime);\n var displayDate = rxtime.toLocaleDateString();\n var displayTime = rxtime.toLocaleTimeString();\n \n msg.data[i].displayDate = displayDate\n msg.data[i].displayTime = displayTime\n}\n \n \n\nreturn msg;","outputs":1,"noerr":0,"x":1080,"y":300,"wires":[["d42e192a.8b7738"]]},{"id":"ad661a57.c24e38","type":"websocket in","z":"5f1f2b21.5baa74","name":"","server":"922ce017.72c01","client":"","x":140,"y":180,"wires":[["5ca656a6.a9fe88"]]},{"id":"b19f9c2a.0005a","type":"switch","z":"23c43518.b3ff0a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"Open","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":480,"wires":[["625b3340.e4df8c"],["ebcd4c65.6046a"]]},{"id":"625b3340.e4df8c","type":"change","z":"23c43518.b3ff0a","name":"","rules":[{"t":"set","p":"sort-by","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":480,"wires":[["2deb0bfd.31afc4"]]},{"id":"2deb0bfd.31afc4","type":"switch","z":"23c43518.b3ff0a","name":"","property":"direction","propertyType":"global","rules":[{"t":"eq","v":"ASC","vt":"str"},{"t":"eq","v":"DESC","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":500,"wires":[["ad0635c5.bf4f18"],["95dd862a.cc1308"]]},{"id":"ad0635c5.bf4f18","type":"change","z":"23c43518.b3ff0a","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"DESC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":480,"wires":[["e5f646d.fb382b8"]]},{"id":"95dd862a.cc1308","type":"change","z":"23c43518.b3ff0a","name":"","rules":[{"t":"set","p":"direction","pt":"global","to":"ASC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":520,"wires":[["e5f646d.fb382b8"]]},{"id":"e5f646d.fb382b8","type":"link out","z":"23c43518.b3ff0a","name":"","links":["4a4f10a5.b3051"],"x":1075,"y":500,"wires":[]},{"id":"10de6977.bb8d37","type":"function","z":"e61361fa.da19a","name":"Set Text Mode","func":"msg.payload=\"AT+CMGF=1\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":80,"wires":[["79aacbf4.636dd4"]]},{"id":"69592b7b.5ce814","type":"function","z":"e61361fa.da19a","name":"Set Text Parameters","func":"msg.payload = \"AT+CSMP=17,167,0,0\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":240,"wires":[["2d248d6.9f74172"]]},{"id":"a0e3fbb3.2826c8","type":"function","z":"e61361fa.da19a","name":"Set Telephone Number","func":"msg.payload=\"AT+CMGS=\\\"\" + msg.number +\"\\\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":320,"wires":[["ea951096.62246"]]},{"id":"220aa1d8.3e212e","type":"function","z":"e61361fa.da19a","name":"Set Message Content","func":"msg.payload= msg.message +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":400,"wires":[["82964f51.db897"]]},{"id":"611f59c8.8b6658","type":"function","z":"e61361fa.da19a","name":"Send Message","func":"msg.payload=\"\\x1A\";\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":480,"wires":[[]]},{"id":"c0ac4507.b28cb8","type":"function","z":"e61361fa.da19a","name":"Set Message Format","func":"msg.payload=\"AT+CSCS=\\\"GSM\\\"\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":160,"wires":[["bc3ea98e.cfef68"]]},{"id":"ea951096.62246","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":360,"wires":[["220aa1d8.3e212e"]]},{"id":"82964f51.db897","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":440,"wires":[["611f59c8.8b6658"]]},{"id":"2d248d6.9f74172","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":280,"wires":[["a0e3fbb3.2826c8"]]},{"id":"79aacbf4.636dd4","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":120,"wires":[["c0ac4507.b28cb8"]]},{"id":"bc3ea98e.cfef68","type":"delay","z":"e61361fa.da19a","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":200,"wires":[["69592b7b.5ce814"]]},{"id":"f49fd797.dcd168","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":580,"y":80,"wires":[]},{"id":"e5250da9.c3a64","type":"subflow:e61361fa.da19a","z":"fa19d7ed.b2f408","name":"","x":390,"y":80,"wires":[["f49fd797.dcd168"]]},{"id":"6d4f4c3c.35d1e4","type":"function","z":"fa19d7ed.b2f408","name":"Get All Messages","func":"msg.payload=\"AT+CMGL=\\\"ALL\\\"\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":640,"wires":[["af57df0f.33c1b"]]},{"id":"af57df0f.33c1b","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":1100,"y":640,"wires":[]},{"id":"b9db0b9e.0c0638","type":"serial in","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":120,"y":300,"wires":[["863ff069.69f21","2aa5af02.4ddce"]]},{"id":"df18c571.fc2e38","type":"function","z":"fa19d7ed.b2f408","name":"Delete All Messages","func":"msg.payload=\"at+cmgd=1,4\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":180,"wires":[["8f67c491.b4caa8"]]},{"id":"8f67c491.b4caa8","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":1230,"y":180,"wires":[]},{"id":"801dbbc7.6e5578","type":"function","z":"fa19d7ed.b2f408","name":"Split Received SMS Data","func":"var result = msg.payload.match(/\\s(\\d+),\"\\D+\"(\\+\\d+)\",,\"(\\d+\\/\\d+\\/\\d+),(\\d+\\:\\d+:\\d+)\\+00\"\\r\\n(.*?)\\r\\n/);\n\n//Group Regex Results\nvar index = result[1];\nvar number = result[2];\nvar date = result[3];\nvar time = result[4];\nvar message = result[5];\n\n//Set Up Outputs\n//msg.index = index;\nmsg.number = number;\n//msg.date = date;\n//msg.time = time;\nmsg.message = message;\nmsg.timestamp = Date.now(); //Current Timestamp\n\nmsg.payload = result;\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":260,"wires":[["2604c8cb.6b0ac8","a8ec5f4b.7c145"]]},{"id":"7170ca5b.1b9664","type":"http in","z":"643aaaf4.e44594","name":"","url":"/logistics","method":"get","upload":false,"swaggerDoc":"","x":350,"y":160,"wires":[["7fc92cff.a62214"]]},{"id":"712b1333.c2d99c","type":"comment","z":"643aaaf4.e44594","name":"Build Webpage","info":"","x":190,"y":120,"wires":[]},{"id":"7fc92cff.a62214","type":"change","z":"643aaaf4.e44594","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall Logistics Paging","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":160,"wires":[["69b5c477.4529ec"]]},{"id":"ecefd8da.15b818","type":"http response","z":"643aaaf4.e44594","name":"","statusCode":"201","headers":{},"x":900,"y":160,"wires":[]},{"id":"be0d5a2f.ffee18","type":"template","z":"643aaaf4.e44594","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n \n\n\n\n \n\n\n\n\n\n \n\n\n\n
\n \n
{{{global.left}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n
\n
\n\n \n \n  Quick Instruction:\n  Vehicle:\n \n
\n
\n\n
\n
\n \n
\n\n
\n
Instruction
\n
Vehicle
\n
Sent Time
\n
Complete Time
\n
\n\n
\n
Please Go To Bay 1
\n
GM65ATK
\n
14:21
\n
-
\n
\n \n
\n
Please Go To Bay 3
\n
FP05NWB
\n
11:21
\n
12:59
\n
\n \n
\n
Please Go To Bay 7
\n
WJ08XXW
\n
11:25
\n
12:30
\n
\n \n
\n
Please Go To Bay 2
\n
P977XLM
\n
09:21
\n
09:48
\n
\n\n \n
\n\n
\n\n\n\n\n","output":"str","x":770,"y":160,"wires":[["ecefd8da.15b818"]]},{"id":"69b5c477.4529ec","type":"template","z":"643aaaf4.e44594","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var receive = new WebSocket('ws://' + location.host + '/browserpage/receive');\nvar one = new WebSocket('ws://' + location.host + '/browserpage/receive/one');\nvar send = new WebSocket('ws://' + location.host + '/browserpage/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change Main Data\nreceive.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"data\").innerHTML = msg.payload;\n \n};\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n}\n","output":"str","x":650,"y":160,"wires":[["be0d5a2f.ffee18"]]},{"id":"8eca38b3.56d018","type":"comment","z":"643aaaf4.e44594","name":"Headder and Body HTML","info":"","x":810,"y":120,"wires":[]},{"id":"eaedcda1.c38f2","type":"serial in","z":"c9436af2.6cae48","name":"","serial":"5d6eb2f4.fc698c","x":190,"y":180,"wires":[["e680aa9c.793ad8"]]},{"id":"e5b11a3e.8893c8","type":"function","z":"c9436af2.6cae48","name":"Reformat the Message For Send","func":"//Regex to match both RX1 and LRS TX7470 See Explanation File\nvar result = msg.payload.match(/RECV,4,(\\d*),(.*-\\S+\\s\\d+?\\:?\\w*)?\\s?\\d?\\%?0?C?(.*)?/);\n\n//Group Regex Results\nvar capcode = result[1]||\" \";\nvar message = result[2]||\" \";\nvar FP = result[3]||null;\n\nvar page = \"CCPAGE,\"+ capcode + \",\"+ message + \"\\f\" + FP + \"\\n\";\nmsg.payload = page\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":180,"wires":[["e3771aa.2d96ee8","9ae1dc7d.ed96d"]]},{"id":"e3771aa.2d96ee8","type":"serial out","z":"c9436af2.6cae48","name":"","serial":"5d6eb2f4.fc698c","x":1150,"y":180,"wires":[]},{"id":"9ae1dc7d.ed96d","type":"debug","z":"c9436af2.6cae48","name":"Out","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1070,"y":140,"wires":[]},{"id":"999ffa6d.4f1ba8","type":"inject","z":"c9436af2.6cae48","name":"Turn Off Repeat Mode","topic":"","payload":"RPTRX,0","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":280,"y":120,"wires":[["19af0c78.f520d4"]]},{"id":"19af0c78.f520d4","type":"serial out","z":"c9436af2.6cae48","name":"","serial":"5d6eb2f4.fc698c","x":550,"y":120,"wires":[]},{"id":"2720c1b6.fda16e","type":"debug","z":"c9436af2.6cae48","name":"Message","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":640,"y":140,"wires":[]},{"id":"e680aa9c.793ad8","type":"switch","z":"c9436af2.6cae48","name":"Only Pass Reveived Pages","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"RECV,4,","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":180,"wires":[["f83b7ae6.28ad58","2720c1b6.fda16e"],["d248cd20.c7ef9"]]},{"id":"d248cd20.c7ef9","type":"debug","z":"c9436af2.6cae48","name":"System Message","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":670,"y":220,"wires":[]},{"id":"6b0c8c4d.03ffd4","type":"serial in","z":"e3cbac21.52804","name":"","serial":"5d6eb2f4.fc698c","x":130,"y":200,"wires":[["4b826fa.9bf219","184ea2f9.fe199d"]]},{"id":"4b826fa.9bf219","type":"debug","z":"e3cbac21.52804","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":180,"wires":[]},{"id":"4ec6aeb2.e5b95","type":"serial in","z":"e3cbac21.52804","name":"","serial":"4c9759dc.0c6338","x":110,"y":280,"wires":[["6c73344c.aebf1c","184ea2f9.fe199d"]]},{"id":"6c73344c.aebf1c","type":"debug","z":"e3cbac21.52804","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":300,"wires":[]},{"id":"863ff069.69f21","type":"switch","z":"fa19d7ed.b2f408","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"+CMGL","vt":"str"},{"t":"cont","v":"OK","vt":"str"},{"t":"cont","v":"ERROR","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":290,"y":300,"wires":[["2c3a9cd.4420364"],["feca0699.da1068"],["8ef23e43.7d7d4"]]},{"id":"a8ec5f4b.7c145","type":"delay","z":"fa19d7ed.b2f408","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":820,"y":180,"wires":[["df18c571.fc2e38"]]},{"id":"25dcf46b.a7a2bc","type":"comment","z":"fa19d7ed.b2f408","name":"Get all SMS from SIM","info":"","x":140,"y":480,"wires":[]},{"id":"15999f6d.d87a21","type":"comment","z":"fa19d7ed.b2f408","name":"Responce from SIM","info":"","x":130,"y":180,"wires":[]},{"id":"2c3a9cd.4420364","type":"split","z":"fa19d7ed.b2f408","name":"","splt":"+CMGL:","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":430,"y":260,"wires":[["801dbbc7.6e5578"]]},{"id":"f3fdb755.d4aa08","type":"comment","z":"fa19d7ed.b2f408","name":"Send SMS","info":"","x":100,"y":20,"wires":[]},{"id":"3d87828f.8c3d7e","type":"debug","z":"fa19d7ed.b2f408","name":"Success","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":620,"y":300,"wires":[]},{"id":"feca0699.da1068","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Success","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":300,"wires":[["3d87828f.8c3d7e"]]},{"id":"fd6df88a.627808","type":"debug","z":"fa19d7ed.b2f408","name":"Error","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":610,"y":340,"wires":[]},{"id":"8ef23e43.7d7d4","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Fail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":340,"wires":[["fd6df88a.627808"]]},{"id":"934ea042.fe8bd","type":"change","z":"fa19d7ed.b2f408","name":"Set Payload and Interval Time","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"resend_interval","pt":"msg","to":"sms_lookup_time","tot":"global"},{"t":"set","p":"SMS_Connected","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":600,"wires":[["f84ea7f9.581c78","899e52ee.9e8e9"]]},{"id":"99a20488.fc4998","type":"status","z":"fa19d7ed.b2f408","name":"SMS Connected?","scope":["af57df0f.33c1b"],"x":140,"y":620,"wires":[["7604ee2d.bd7ec"]]},{"id":"7604ee2d.bd7ec","type":"switch","z":"fa19d7ed.b2f408","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"node-red:common.status.connected","vt":"str"},{"t":"eq","v":"node-red:common.status.not-connected","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":620,"wires":[["934ea042.fe8bd"],["b257d0ca.51da3"]]},{"id":"b257d0ca.51da3","type":"change","z":"fa19d7ed.b2f408","name":"Ignore","rules":[{"t":"set","p":"resend_ignore","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"SMS_Connected","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":640,"wires":[["f84ea7f9.581c78"]]},{"id":"2aa5af02.4ddce","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":310,"y":380,"wires":[]},{"id":"45c49526.7d0adc","type":"change","z":"e3cbac21.52804","name":"True","rules":[{"t":"set","p":"TX7470_Connected","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":500,"wires":[[]]},{"id":"2e5d3911.600256","type":"status","z":"e3cbac21.52804","name":"TX7470 Connected?","scope":["6b0c8c4d.03ffd4"],"x":110,"y":520,"wires":[["7b148a21.9f1314"]]},{"id":"7b148a21.9f1314","type":"switch","z":"e3cbac21.52804","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"node-red:common.status.connected","vt":"str"},{"t":"eq","v":"node-red:common.status.not-connected","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":520,"wires":[["45c49526.7d0adc"],["4c495632.b55618"]]},{"id":"4c495632.b55618","type":"change","z":"e3cbac21.52804","name":"False","rules":[{"t":"set","p":"TX7470_Connected","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":540,"wires":[[]]},{"id":"b680f60b.313cd8","type":"change","z":"e3cbac21.52804","name":"True","rules":[{"t":"set","p":"TRX1_Connected","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":580,"wires":[[]]},{"id":"a1824dff.84417","type":"status","z":"e3cbac21.52804","name":"TRX1 Connected?","scope":["4ec6aeb2.e5b95"],"x":110,"y":600,"wires":[["ff66d1d0.c95c4"]]},{"id":"ff66d1d0.c95c4","type":"switch","z":"e3cbac21.52804","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"node-red:common.status.connected","vt":"str"},{"t":"eq","v":"node-red:common.status.not-connected","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":600,"wires":[["b680f60b.313cd8"],["8ae471a8.76a12"]]},{"id":"8ae471a8.76a12","type":"change","z":"e3cbac21.52804","name":"False","rules":[{"t":"set","p":"TRX1_Connected","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":620,"wires":[[]]},{"id":"a004c184.b0aea","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":940,"wires":[]},{"id":"adaf9b5a.787898","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":900,"wires":[["2b63c06f.f2c39"]]},{"id":"6876aacc.537724","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `SMS_Data` ( \t`index`\tINTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, \t`Phone_Number`\tTEXT, \t`Message`\tTEXT, \t`Timestamp`\tINTEGER, \t`T/R`\tINTEGER );","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":900,"wires":[["adaf9b5a.787898"]]},{"id":"2b63c06f.f2c39","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":900,"wires":[]},{"id":"7fbff3a0.1eea4c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1060,"wires":[["c4f902a6.e9b84"]]},{"id":"c7eb0126.a6464","type":"inject","z":"ba76d305.cf8ad","name":"Clear Table","topic":"DELETE FROM 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":1060,"wires":[["7fbff3a0.1eea4c"]]},{"id":"70c36b91.bec6f4","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":940,"wires":[["a004c184.b0aea"]]},{"id":"b68e4e03.96702","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":940,"wires":[["70c36b91.bec6f4"]]},{"id":"4116d30f.76144c","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":980,"wires":[]},{"id":"c3cce268.e43c9","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":980,"wires":[["4116d30f.76144c"]]},{"id":"5462f3ae.1ca42c","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":980,"wires":[["c3cce268.e43c9"]]},{"id":"c4f902a6.e9b84","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1060,"wires":[]},{"id":"7d35dfdb.df977","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1020,"wires":[]},{"id":"1f6e654e.265b2b","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1020,"wires":[["7d35dfdb.df977"]]},{"id":"5a89ea72.4a39a4","type":"inject","z":"ba76d305.cf8ad","name":"Reset Auto Increment (Clear Table First)","topic":"DELETE FROM sqlite_sequence WHERE name = 'SMS_Data';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":980,"y":1020,"wires":[["1f6e654e.265b2b"]]},{"id":"11066a1c.567f96","type":"comment","z":"ba76d305.cf8ad","name":"SMS_Data","info":"","x":1240,"y":860,"wires":[]},{"id":"ca3a05ef.30d808","type":"template","z":"fa19d7ed.b2f408","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `SMS_Data` ('Phone_Number', 'Message', 'Timestamp','T/R') \nVALUES ('{{number}}', '{{message}}', '{{timestamp}}','0');","output":"str","x":1060,"y":260,"wires":[["33af4711.c68a78"]]},{"id":"33af4711.c68a78","type":"sqlite","z":"fa19d7ed.b2f408","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":260,"wires":[[]]},{"id":"ca1175d4.6ab1a8","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"timestamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["9664022a.04865","6e1139d9.34bc58"]]},{"id":"9664022a.04865","type":"template","z":"fa19d7ed.b2f408","name":"Add Msg to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `SMS_Data` ('Phone_Number', 'Message', 'Timestamp','T/R') \nVALUES ('{{number}}', '{{message}}', '{{timestamp}}','1');","output":"str","x":600,"y":120,"wires":[["1a308fc7.211f"]]},{"id":"1a308fc7.211f","type":"sqlite","z":"fa19d7ed.b2f408","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":770,"y":120,"wires":[[]]},{"id":"6e1139d9.34bc58","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":570,"y":160,"wires":[]},{"id":"ceaee21f.07fc6","type":"trigger","z":"fa19d7ed.b2f408","op1":"node-red:common.status.not-connected","op2":"node-red:common.status.connected","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"Turn off checking when sending","x":210,"y":580,"wires":[["7604ee2d.bd7ec"]]},{"id":"255c230c.2e7dac","type":"delay","z":"fa19d7ed.b2f408","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":200,"y":80,"wires":[["e5250da9.c3a64","5bf9882c.71b798","ca1175d4.6ab1a8","732d2686.571308"]]},{"id":"2604c8cb.6b0ac8","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":260,"wires":[["ca3a05ef.30d808","aca8dcf3.8cf6","7198dc76.3853d4","7509fa52.c5c934"]]},{"id":"499edad1.a36d34","type":"link in","z":"fa19d7ed.b2f408","name":"","links":["5bf9882c.71b798"],"x":55,"y":580,"wires":[["ceaee21f.07fc6"]]},{"id":"5bf9882c.71b798","type":"link out","z":"fa19d7ed.b2f408","name":"","links":["499edad1.a36d34"],"x":335,"y":40,"wires":[]},{"id":"32964d32.499912","type":"link in","z":"fa19d7ed.b2f408","name":"Send SMS","links":["6d4a28f4.10c778","33dac2b0.5dab4e","923b563a.662528"],"x":75,"y":80,"wires":[["255c230c.2e7dac"]]},{"id":"fdf7239e.58395","type":"websocket out","z":"fa19d7ed.b2f408","name":"","server":"4f629706.3fbcb8","client":"","x":1170,"y":220,"wires":[]},{"id":"aca8dcf3.8cf6","type":"switch","z":"fa19d7ed.b2f408","name":"","property":"beep","propertyType":"global","rules":[{"t":"neq","v":"null","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1030,"y":220,"wires":[["fdf7239e.58395"]]},{"id":"aa2010b0.68176","type":"exec","z":"b7fc24bc.f191b8","command":"cat /etc/dhcpcd.conf","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"","x":476,"y":179,"wires":[["ea575dda.0bc82"],[],[]]},{"id":"ea575dda.0bc82","type":"function","z":"b7fc24bc.f191b8","name":"parse response","func":"var lines = msg.payload.split(\"\\n\");\nvar data = [];\n\nfor(var i=0; i< lines.length; i++){\n if(lines[i].indexOf(\"interface eth0\") != -1)\n break;\n}\n\n//check if interface eth0 is disabled\nif(i < lines.length && lines[i].indexOf(\"#\") >= 0) flow.set('disabled', true);\nelse flow.set('disabled', false);\n\nnode.send({topic:'interface eth0', payload:flow.get('disabled')})\n\ni++;\n\nfor(i; i< lines.length; i++){\n \n //new interface, not eth0\n if(lines[i].indexOf(\"static\") == -1)\n break;\n \n var tmp = lines[i].split(\"=\");\n if(tmp.length==2){\n var prop = tmp[0].split(' ')[1].trim();\n var value = tmp[1].trim();\n \n flow.set(prop, value);\n node.send({topic:prop, payload:value})\n }\n} ","outputs":1,"noerr":0,"x":716,"y":166,"wires":[["e8b089e.ea40d78"]]},{"id":"e8b089e.ea40d78","type":"switch","z":"b7fc24bc.f191b8","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"ip_address","vt":"str"},{"t":"eq","v":"routers","vt":"str"},{"t":"eq","v":"domain_name_servers","vt":"str"},{"t":"eq","v":"interface eth0","vt":"str"}],"checkall":"false","repair":false,"outputs":4,"x":888,"y":166,"wires":[["d7f06666.809228"],["a03176f2.f4b788"],["db26e759.f47118","9ac4a2fd.1d59a"],["ac474f12.f6559"]]},{"id":"d7f06666.809228","type":"ui_text_input","z":"b7fc24bc.f191b8","name":"ip_address","label":"Indirizzo IP","group":"5ea533e5.c35b8c","order":2,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"ip_address","x":1130,"y":120,"wires":[["9a91c24e.5286"]]},{"id":"a03176f2.f4b788","type":"ui_text_input","z":"b7fc24bc.f191b8","name":"router","label":"Router","group":"5ea533e5.c35b8c","order":3,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"routers","x":1109,"y":163,"wires":[["9a91c24e.5286"]]},{"id":"db26e759.f47118","type":"ui_text_input","z":"b7fc24bc.f191b8","name":"dns","label":"DNS","group":"5ea533e5.c35b8c","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"domain_name_servers","x":1109,"y":206,"wires":[["9a91c24e.5286"]]},{"id":"8f588de9.0eeb6","type":"exec","z":"b7fc24bc.f191b8","command":"sudo sed -i ","addpay":true,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"","x":510,"y":320,"wires":[[],[],[]]},{"id":"9571d782.89bc78","type":"ui_button","z":"b7fc24bc.f191b8","name":"reboot","group":"5ea533e5.c35b8c","order":5,"width":"3","height":"1","passthru":false,"label":"Reboot","color":"","bgcolor":"","icon":"","payload":"By pressing OK the device will be rebooted. If settings are wrong this may cause the device to be unreachable","payloadType":"str","topic":"","x":170,"y":480,"wires":[["b2e0ad3.39d6a5"]]},{"id":"c9d44da8.3061a","type":"exec","z":"b7fc24bc.f191b8","command":"sudo reboot","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":650,"y":480,"wires":[[],[],[]]},{"id":"e4a06170.270a","type":"ui_button","z":"b7fc24bc.f191b8","name":"refresh","group":"5ea533e5.c35b8c","order":6,"width":"3","height":"1","passthru":false,"label":"Update","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":111.44442749023438,"y":247.33291149139404,"wires":[["6c65ec82.b747b4","e69550e.4acfab"]]},{"id":"6c65ec82.b747b4","type":"delay","z":"b7fc24bc.f191b8","name":"","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":278.8888740539551,"y":247.44451141357422,"wires":[["aa2010b0.68176"]]},{"id":"e69550e.4acfab","type":"function","z":"b7fc24bc.f191b8","name":"send commands","func":"var properties = flow.get(\"properties\");\n\nvar disabled = flow.get(\"disabled\") ? '#' : '';\n\nif(disabled == '#'){\n //enable interface (replace only first occurance)\n var command = `'0,/#interface eth0/s//interface eth0/g;' /etc/dhcpcd.conf`;\n node.send({payload: command})\n}\n\nfor(var i=0;i\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n IP: {{global.ip}}
\n Serial: {{global.serial}}
\n Software Version: {{global.sw}}
\n Hardware Version: {{global.hw}}
\n Firmware Version: {{global.fw}}\n
\n \n
\n\n\n\n\n\n","output":"str","x":830,"y":140,"wires":[["e4466f0c.3d898"]]},{"id":"7f164aa2.d87fc4","type":"debug","z":"ce69645.1231098","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"req.cookies.god","x":860,"y":60,"wires":[]},{"id":"11b95135.e0704f","type":"debug","z":"ce69645.1231098","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"req.cookies.god","x":860,"y":180,"wires":[]},{"id":"72e29c18.6e9a54","type":"http response","z":"60528a1b.f32364","name":"","statusCode":"","headers":{},"x":790,"y":1220,"wires":[]},{"id":"f34c1b96.9c29d8","type":"change","z":"60528a1b.f32364","name":"Redirect to home page","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"home","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":1220,"wires":[["72e29c18.6e9a54","c2dc79e8.268df8"]]},{"id":"3bd78579.1468da","type":"http in","z":"60528a1b.f32364","name":"","url":"/home","method":"get","upload":false,"swaggerDoc":"","x":420,"y":1240,"wires":[["f34c1b96.9c29d8"]]},{"id":"fe0baef7.4d2b3","type":"http in","z":"60528a1b.f32364","name":"","url":"/","method":"get","upload":false,"swaggerDoc":"","x":430,"y":1200,"wires":[["f34c1b96.9c29d8"]]},{"id":"62ba8a0a.97b414","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"bd6c3af.5c6d0c8","x":880,"y":560,"wires":[]},{"id":"ada0b574.ec19e8","type":"inject","z":"dad6f0f1.28177","name":"Send Page","topic":"","payload":"PAGE,911,0,Test Page","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":560,"y":460,"wires":[["734abd62.6c0054"]]},{"id":"640af3ab.6b161c","type":"serial in","z":"dad6f0f1.28177","name":"","serial":"5d6eb2f4.fc698c","x":790,"y":320,"wires":[["7388cd86.eb4434"]]},{"id":"7388cd86.eb4434","type":"debug","z":"dad6f0f1.28177","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":970,"y":320,"wires":[]},{"id":"acdf8298.10574","type":"debug","z":"9939c833.99b318","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1310,"y":420,"wires":[]},{"id":"7198dc76.3853d4","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":340,"wires":[]},{"id":"4325240c.074bfc","type":"function","z":"6824b2bf.b1e0fc","name":"Set Text Mode","func":"msg.payload=\"AT+CMGF=1\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":120,"wires":[["a78f118b.a95b6"]]},{"id":"b1c6a3b8.dcb17","type":"function","z":"6824b2bf.b1e0fc","name":"Set Text Parameters","func":"msg.payload = \"AT+CSMP=17,167,0,0\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":280,"wires":[["ea809a63.fb9388"]]},{"id":"390e5598.a2489a","type":"function","z":"6824b2bf.b1e0fc","name":"Set Telephone Number","func":"msg.payload=\"AT+CMGS=\\\"\" + msg.number +\"\\\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":360,"wires":[["53d43211.3b0b9c"]]},{"id":"e1763ed3.9ba2e","type":"function","z":"6824b2bf.b1e0fc","name":"Set Message Content","func":"msg.payload= msg.message +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":440,"wires":[["88a7cffa.94d8e"]]},{"id":"7dee774b.aef198","type":"function","z":"6824b2bf.b1e0fc","name":"Send Message","func":"msg.payload=\"\\x1A\";\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":520,"wires":[[]]},{"id":"267d0776.a38468","type":"function","z":"6824b2bf.b1e0fc","name":"Set Message Format","func":"msg.payload=\"AT+CSCS=\\\"GSM\\\"\" +\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":200,"wires":[["b21ea1fe.6ffad"]]},{"id":"53d43211.3b0b9c","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":400,"wires":[["e1763ed3.9ba2e"]]},{"id":"88a7cffa.94d8e","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":480,"wires":[["7dee774b.aef198"]]},{"id":"ea809a63.fb9388","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":320,"wires":[["390e5598.a2489a"]]},{"id":"a78f118b.a95b6","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":160,"wires":[["267d0776.a38468"]]},{"id":"b21ea1fe.6ffad","type":"delay","z":"6824b2bf.b1e0fc","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":240,"wires":[["b1c6a3b8.dcb17"]]},{"id":"899e52ee.9e8e9","type":"subflow:6824b2bf.b1e0fc","z":"fa19d7ed.b2f408","name":"","x":700,"y":560,"wires":[["62ba8a0a.97b414"]]},{"id":"7509fa52.c5c934","type":"function","z":"fa19d7ed.b2f408","name":"Split Message into pager id","func":"var result = /(\\d*),(.*)/;\nvar i = result.exec(msg.message || \"\");\n\nif (i !== null) {\n \nvar pager_number = i[1];\nvar message = i[2];\nvar sysID = global.get(\"sysID\");\nvar content = message;\nvar sendmessage = content.replace(/\\n/g, \" \");\nvar page = \"PAGE,\"+ pager_number + \",\"+ sysID + \",\" + sendmessage + \"\\n\";\nmsg.payload = page\nreturn msg;\n\n} else if (i === null) {\n \nvar sysID = global.get(\"sysID\");\nvar pager_number = global.get(\"default_number\");\nvar content = msg.message;\nvar sendmessage = content.replace(/\\n/g, \" \");\nvar page = \"PAGE,\"+ pager_number + \",\"+ sysID + \",\" + sendmessage + \"\\n\";\nmsg.payload = page\nreturn msg;\n\n} else {\n\t// Do nothing\n\treturn\n}","outputs":1,"noerr":0,"x":1100,"y":300,"wires":[["2d371436.d022bc","a868d008.fa7e2"]]},{"id":"2d371436.d022bc","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1290,"y":340,"wires":[]},{"id":"a868d008.fa7e2","type":"serial out","z":"fa19d7ed.b2f408","name":"","serial":"5d6eb2f4.fc698c","x":1350,"y":300,"wires":[]},{"id":"61153a35.ede424","type":"comment","z":"7c3dbf78.7885c","name":"Build Webpage","info":"","x":100,"y":60,"wires":[]},{"id":"85e26070.df94c","type":"http response","z":"7c3dbf78.7885c","name":"","statusCode":"","headers":{},"x":690,"y":80,"wires":[]},{"id":"8433a4c2.04e608","type":"template","z":"7c3dbf78.7885c","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"\n\n\n\n \n {{title}}\n\n \n \n\n\n\n\n\n \n\n
\n \n
{{{global.settings_list}}}
\n \n
\n

{{title}}

\n
\n \n
\n
\n
\n \n
\n\n
\n
\n\n\n\n\n\n\n","output":"str","x":570,"y":80,"wires":[["85e26070.df94c"]]},{"id":"d7a059ad.0b9b48","type":"change","z":"7c3dbf78.7885c","name":"Title","rules":[{"t":"set","p":"title","pt":"msg","to":"CaptureCall SMS Settings","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":80,"wires":[["29b1aaf5.1b4b16"]]},{"id":"29b1aaf5.1b4b16","type":"template","z":"7c3dbf78.7885c","name":"Script","field":"script","fieldType":"msg","format":"javascript","syntax":"plain","template":"var one = new WebSocket('ws://' + location.host + '/sms/receive/one');\nvar two = new WebSocket('ws://' + location.host + '/sms/receive/two');\nvar send = new WebSocket('ws://' + location.host + '/sms/send');\n\n\nvar msg = 0; // Make Incoming WS Global\n\n// Change One\none.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"one\").innerHTML = msg.payload;\n};\n\n// Change Two\ntwo.onmessage = function(d) {\n var txt = d.data;\n msg = JSON.parse(txt);\n console.log(msg);\n document.getElementById(\"two\").innerHTML = msg.payload;\n};\n\n\n \n// When the connection is open, send some data to the server\nsend.onopen = function() {\n console.log('WebSocket Open');\n send.send('Open');\n};\n function load(){\n startTime();\n\n\n }\n\nfunction startTime() { //Clock\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n} \n\nfunction checkTime(i) {\n if (i < 10) {i = \"0\" + i} // add zero in front of numbers < 10\n return i;\n\n}\n","output":"str","x":450,"y":80,"wires":[["8433a4c2.04e608"]]},{"id":"e5058c36.42fb4","type":"comment","z":"7c3dbf78.7885c","name":"Handle Input from Webpage","info":"","x":140,"y":320,"wires":[]},{"id":"7a6d676e.37e228","type":"switch","z":"7c3dbf78.7885c","name":"","property":"req.cookies.admin","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":100,"wires":[["d7a059ad.0b9b48"],["6b3ad3e9.39b35c"]]},{"id":"6b3ad3e9.39b35c","type":"link out","z":"7c3dbf78.7885c","name":"back to settings","links":["4212ad6a.fb9f04"],"x":295,"y":120,"wires":[]},{"id":"1d28a554.3505fb","type":"http in","z":"7c3dbf78.7885c","name":"","url":"/sms","method":"post","upload":false,"swaggerDoc":"","x":100,"y":380,"wires":[["16af324f.f2797e","4ce292ed.5069bc","18cea72.5a5c159"]]},{"id":"2c031bdd.f5c594","type":"http response","z":"7c3dbf78.7885c","name":"","statusCode":"","headers":{},"x":450,"y":460,"wires":[]},{"id":"16af324f.f2797e","type":"change","z":"7c3dbf78.7885c","name":"Redirect","rules":[{"t":"set","p":"statusCode","pt":"msg","to":"302","tot":"num"},{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.location","pt":"msg","to":"/sms","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":460,"wires":[["2c031bdd.f5c594"]]},{"id":"4ce292ed.5069bc","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.default_number","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":420,"wires":[["4ba68824.8a64d8"]]},{"id":"4ba68824.8a64d8","type":"change","z":"7c3dbf78.7885c","name":"","rules":[{"t":"set","p":"default_number","pt":"global","to":"payload.default_number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":420,"wires":[["a4395bb2.c65928"]]},{"id":"a4395bb2.c65928","type":"template","z":"7c3dbf78.7885c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET default_pager_number = '{{{payload.default_number}}}'\nWHERE ID = 1;","output":"str","x":700,"y":420,"wires":[["ce517527.bac3d8"]]},{"id":"ce517527.bac3d8","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":850,"y":420,"wires":[[]]},{"id":"653e063a.3aec78","type":"comment","z":"7c3dbf78.7885c","name":"Default Pager number","info":"","x":1040,"y":420,"wires":[]},{"id":"18cea72.5a5c159","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.sms_lookup_time","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":380,"wires":[["31f2d325.050f6c"]]},{"id":"4ba109b0.fd2d88","type":"template","z":"7c3dbf78.7885c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"UPDATE `settings`\nSET sms_lookup_time = '{{payload.sms_lookup_time}}'\nWHERE ID = 1;","output":"str","x":700,"y":380,"wires":[["ea1a7c67.7b8e7"]]},{"id":"ea1a7c67.7b8e7","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":850,"y":380,"wires":[[]]},{"id":"63a65584.d73b0c","type":"comment","z":"7c3dbf78.7885c","name":"SMS Lookup Time","info":"","x":1030,"y":380,"wires":[]},{"id":"31f2d325.050f6c","type":"change","z":"7c3dbf78.7885c","name":"","rules":[{"t":"set","p":"sms_lookup_time","pt":"global","to":"payload.sms_lookup_time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":380,"wires":[["4ba109b0.fd2d88","5e7e5469.97945c"]]},{"id":"76ba6a52.373a64","type":"http in","z":"7c3dbf78.7885c","name":"","url":"/sms","method":"get","upload":false,"swaggerDoc":"","x":80,"y":100,"wires":[["7a6d676e.37e228"]]},{"id":"b1067c5c.09a0c","type":"comment","z":"7c3dbf78.7885c","name":"Put Data On the Webpage","info":"","x":130,"y":200,"wires":[]},{"id":"a0bd7cdf.afd92","type":"template","z":"7c3dbf78.7885c","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

Pager to SMS Forwarding

\n \n
\n\n\n\n
\n\n
\n\n

\n \n\n \n

\n\n\n
\n\n

\n\n
\n\n
\n
Pager Number
\n
Phone Number
\n
\n{{#payload}}\n
\n
{{{pager}}}
\n
{{phone}}
\n
\n{{/payload}}\n","output":"str","x":830,"y":200,"wires":[["465a969d.0dd9c8"]]},{"id":"ae7ac240.608dd","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Open","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":430,"y":240,"wires":[["5d1c0e52.6b587","570f7ba7.4b96d4"]]},{"id":"5d1c0e52.6b587","type":"template","z":"7c3dbf78.7885c","name":"Build Data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"

SMS Receive Settings

\n\n
\nDefault Pager Number:
\n
\n
\n\n
\nSMS Poll Time (s):
\n
\n
","output":"str","x":830,"y":240,"wires":[["62d955f6.7b5f0c"]]},{"id":"eaa3275.c3cf8d8","type":"websocket in","z":"7c3dbf78.7885c","name":"","server":"dc2bb776.c508d8","client":"","x":100,"y":240,"wires":[["886ea709.849a68"]]},{"id":"465a969d.0dd9c8","type":"websocket out","z":"7c3dbf78.7885c","name":"","server":"97aed89c.6c8d08","client":"","x":1040,"y":200,"wires":[]},{"id":"62d955f6.7b5f0c","type":"websocket out","z":"7c3dbf78.7885c","name":"","server":"2ca8999c.456256","client":"","x":1040,"y":240,"wires":[]},{"id":"3b096d12.16f5d2","type":"change","z":"fa19d7ed.b2f408","name":"Set Payload and Interval Time","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"resend_interval","pt":"msg","to":"sms_lookup_time","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":680,"wires":[["f84ea7f9.581c78"]]},{"id":"b2829d55.caa52","type":"http in","z":"7c3dbf78.7885c","name":"","url":"/sms/forwarding","method":"post","upload":false,"swaggerDoc":"","x":120,"y":500,"wires":[["1253669b.8fe3e9","16af324f.f2797e","ec773d8b.beb5c"]]},{"id":"2adb401.a7bcfc","type":"link in","z":"fa19d7ed.b2f408","name":"poll time","links":["5e7e5469.97945c"],"x":315,"y":680,"wires":[["3b096d12.16f5d2"]]},{"id":"5e7e5469.97945c","type":"link out","z":"7c3dbf78.7885c","name":"","links":["2adb401.a7bcfc"],"x":655,"y":340,"wires":[]},{"id":"b448c422.472058","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1220,"wires":[]},{"id":"7f122458.818f2c","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1180,"wires":[["a6003182.d8e39"]]},{"id":"182d57a7.d77778","type":"inject","z":"ba76d305.cf8ad","name":"Make Table","topic":"CREATE TABLE `pager_sms_forwarding` ( `index` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `pager` TEXT, `phone` TEXT )","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1070,"y":1180,"wires":[["7f122458.818f2c"]]},{"id":"a6003182.d8e39","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1390,"y":1180,"wires":[]},{"id":"9e209a40.7d2618","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1220,"wires":[["b448c422.472058"]]},{"id":"8f630b6e.f81628","type":"inject","z":"ba76d305.cf8ad","name":"Select All","topic":"Select * FROM 'pager_sms_forwarding';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":1220,"wires":[["9e209a40.7d2618"]]},{"id":"b94c24.f4f1c3e","type":"debug","z":"ba76d305.cf8ad","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1390,"y":1260,"wires":[]},{"id":"9c776827.be5998","type":"sqlite","z":"ba76d305.cf8ad","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":1230,"y":1260,"wires":[["b94c24.f4f1c3e"]]},{"id":"2835ab6a.cf4ca4","type":"inject","z":"ba76d305.cf8ad","name":"Drop Table","topic":"DROP TABLE 'pager_sms_forwarding';","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1080,"y":1260,"wires":[["9c776827.be5998"]]},{"id":"d881dcd9.ae099","type":"comment","z":"ba76d305.cf8ad","name":"pager_sms_forwarding","info":"","x":1280,"y":1140,"wires":[]},{"id":"570f7ba7.4b96d4","type":"template","z":"7c3dbf78.7885c","name":"Select Callpoint Alias Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT * FROM `pager_sms_forwarding`\nORDER BY `pager` ASC;\n","output":"str","x":460,"y":200,"wires":[["ac2b59b0.529ad8"]]},{"id":"ac2b59b0.529ad8","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":670,"y":200,"wires":[["a0bd7cdf.afd92"]]},{"id":"ec773d8b.beb5c","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.remove","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":540,"wires":[["c88c406a.ce661"]]},{"id":"c88c406a.ce661","type":"template","z":"7c3dbf78.7885c","name":"Remove from DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"DELETE FROM `pager_sms_forwarding`\nWHERE `pager`=\"{{{payload.remove}}}\";","output":"str","x":470,"y":540,"wires":[["5a354afc.5cf994"]]},{"id":"5a354afc.5cf994","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":650,"y":540,"wires":[[]]},{"id":"d6fedd86.cb761","type":"template","z":"7c3dbf78.7885c","name":"Add to DB","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO `pager_sms_forwarding` ('pager', 'phone') VALUES ('{{{payload.pager}}}', '{{payload.phone}}');","output":"str","x":570,"y":500,"wires":[["89fc8f18.2c7cb"]]},{"id":"89fc8f18.2c7cb","type":"sqlite","z":"7c3dbf78.7885c","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":730,"y":500,"wires":[[]]},{"id":"1253669b.8fe3e9","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.pager","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":500,"wires":[["78ace295.3d663c"]]},{"id":"78ace295.3d663c","type":"switch","z":"7c3dbf78.7885c","name":"","property":"payload.phone","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":500,"wires":[["d6fedd86.cb761"],[]]},{"id":"923b563a.662528","type":"link out","z":"fa19d7ed.b2f408","name":"","links":["32964d32.499912"],"x":1075,"y":880,"wires":[]},{"id":"b5632527.ba5468","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"message","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":880,"wires":[["923b563a.662528"]]},{"id":"694e32c7.35392c","type":"comment","z":"fa19d7ed.b2f408","name":"Forward Page to SMS","info":"","x":160,"y":820,"wires":[]},{"id":"65839b56.756164","type":"link in","z":"fa19d7ed.b2f408","name":"","links":["c94a9d48.9c2c"],"x":120,"y":880,"wires":[["d0bf954e.3c7a78"]]},{"id":"7977ea89.64b574","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":630,"y":780,"wires":[]},{"id":"d0bf954e.3c7a78","type":"template","z":"fa19d7ed.b2f408","name":"Select Active Data","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT `phone`\nFROM `pager_sms_forwarding`\nWHERE `pager` = '{{pagerNumber}}'\n","output":"str","x":270,"y":880,"wires":[["c8362e7f.26036"]]},{"id":"c8362e7f.26036","type":"sqlite","z":"fa19d7ed.b2f408","mydb":"fd38eee5.8bd8a","sqlquery":"msg.topic","sql":"","name":"CaptureCall","x":450,"y":880,"wires":[["7977ea89.64b574","e65768a.55d9298"]]},{"id":"e6ee05cd.0b1b08","type":"template","z":"fa19d7ed.b2f408","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{part1}} {{part2}} {{sender}}","output":"str","x":780,"y":880,"wires":[["b5632527.ba5468"]]},{"id":"732d2686.571308","type":"debug","z":"fa19d7ed.b2f408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":330,"y":180,"wires":[]},{"id":"e65768a.55d9298","type":"change","z":"fa19d7ed.b2f408","name":"","rules":[{"t":"set","p":"number","pt":"msg","to":"payload[0].phone","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":880,"wires":[["e6ee05cd.0b1b08"]]},{"id":"f2b86262.fdc9c","type":"deduplicate","z":"e3cbac21.52804","name":"","keyproperty":"","expiry":"20","x":850,"y":240,"wires":[["e8a93519.478388","9301bc45.dca2a"],["96f0724f.dc67"]]},{"id":"f83b7ae6.28ad58","type":"deduplicate","z":"c9436af2.6cae48","name":"","keyproperty":"","expiry":"30","x":650,"y":180,"wires":[["e5b11a3e.8893c8"],[]]},{"id":"f84ea7f9.581c78","type":"msg-resend","z":"fa19d7ed.b2f408","interval":"30","intervalUnit":"secs","maximum":"0","bytopic":false,"clone":false,"firstDelayed":true,"addCounters":false,"highRate":false,"outputCountField":"","outputMaxField":"","name":"","x":710,"y":640,"wires":[["6d4f4c3c.35d1e4"]]},{"id":"311030ac.d9f2b","type":"debug","z":"b8bd1cc3.4827","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":260,"wires":[]},{"id":"1bba0705.d72259","type":"change","z":"60528a1b.f32364","name":"","rules":[{"t":"set","p":"home","pt":"global","to":"payload[0].home","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":680,"wires":[[]]},{"id":"fcaddc98.cb117","type":"comment","z":"60528a1b.f32364","name":"Set home","info":"","x":760,"y":680,"wires":[]},{"id":"ee5d6812.a72308","type":"sqlite","z":"60528a1b.f32364","mydb":"fd38eee5.8bd8a","sqlquery":"fixed","sql":"SELECT `home` FROM `settings`;","name":"CaptureCall","x":430,"y":680,"wires":[["1bba0705.d72259"]]},{"id":"c2dc79e8.268df8","type":"debug","z":"60528a1b.f32364","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":790,"y":1180,"wires":[]},{"id":"7abdfa8f.f06af4","type":"debug","z":"9939c833.99b318","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1260,"y":180,"wires":[]},{"id":"19c484cf.6fd71b","type":"inject","z":"9939c833.99b318","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1060,"y":160,"wires":[["a69165f3.061688"]]},{"id":"a7538406.5b50f8","type":"delay","z":"9939c833.99b318","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1250,"y":220,"wires":[["12ad5379.1db21d"]]},{"id":"5d6cae62.a1bb1","type":"function","z":"9939c833.99b318","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":110,"y":320,"wires":[["4cfa91f3.ed729","64ebaca6.468d04","a69165f3.061688"]]},{"id":"1bead904.d1d877","type":"function","z":"4ff720ae.e74bd","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":250,"y":340,"wires":[[]]},{"id":"4b263e29.54c52","type":"function","z":"c8c5b763.cd1498","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":340,"wires":[["865343b.d02dfc"]]},{"id":"5ca656a6.a9fe88","type":"function","z":"5f1f2b21.5baa74","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":240,"wires":[["63b4994a.1e5468","5ae3627c.893d6c"]]},{"id":"6c8e43b1.7985ec","type":"function","z":"b209c94d.26d798","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":280,"wires":[["8aed6be1.ef9ee8"]]},{"id":"dc337a0b.1d8a28","type":"function","z":"1c96dbb1.1bc354","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":380,"wires":[["9e864380.21a48"]]},{"id":"c9e38e8e.3efc5","type":"function","z":"53e35596.381c0c","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":480,"wires":[["a548061f.54f0e8"]]},{"id":"b1ffa92d.ad84e8","type":"function","z":"b00e2d77.a9931","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":320,"wires":[["e979859b.b1bd58"]]},{"id":"5de04be1.0479d4","type":"function","z":"aefd70ef.7eada","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":200,"wires":[["4f3bb7d.e64b048"]]},{"id":"ed2981b.7cb698","type":"function","z":"53762a60.6160b4","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":180,"wires":[["92aec48c.fadac8"]]},{"id":"be2427dd.44de28","type":"function","z":"d0562e73.de681","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":180,"wires":[["f19f0b88.1da698"]]},{"id":"886ea709.849a68","type":"function","z":"7c3dbf78.7885c","name":"Kill Session","func":"msg._session=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":240,"wires":[["ae7ac240.608dd"]]}] \ No newline at end of file