[{"id":"d622ee9e.cc1f68","type":"tab","label":"Wiznet Sensor","disabled":false,"info":""},{"id":"dbf27d8f.ad3cf","type":"http in","z":"d622ee9e.cc1f68","name":"wiznet sensor http in","url":"/wiznetsensor","method":"get","upload":false,"swaggerDoc":"","x":130,"y":140,"wires":[["7449093f.696bf","9787c073.4ff238"]]},{"id":"7449093f.696bf","type":"debug","z":"d622ee9e.cc1f68","d":true,"name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":350,"y":140,"wires":[]},{"id":"35833799.3dc18","type":"http response","z":"d622ee9e.cc1f68","name":"Reply to http request","statusCode":"200","headers":{},"x":780,"y":400,"wires":[]},{"id":"f2597f5c.49fea","type":"json","z":"d622ee9e.cc1f68","name":"Interpret JSON","property":"payload","action":"","pretty":false,"x":580,"y":240,"wires":[["51527220.d4d56c","ea2b8073.2f1528"]]},{"id":"9787c073.4ff238","type":"switch","z":"d622ee9e.cc1f68","name":"Check for JSON key","property":"payload","propertyType":"msg","rules":[{"t":"hask","v":"json","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":140,"y":240,"wires":[["510cb996.0de238","4e8237da.b17dc8"],["aa02e6f6.41736"]]},{"id":"51527220.d4d56c","type":"function","z":"d622ee9e.cc1f68","name":"Add Timestamp","func":"\nfunction addZero(i) {\n  if (i < 10) {\n    i = \"0\" + i;\n  }\n  return i;\n}\n\nvar d = new Date();\nvar ampm = \"am\"\nvar h = d.getHours()\nif (h > 12) {\n    h = h - 12\n    ampm = \"pm\"\n}\nvar m = addZero(d.getMinutes());\nvar timestamp = h + \":\" + m + ampm;\n\nmsg.payload.timestamp = timestamp;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":320,"wires":[["81321061.9be","60dc4c5a.8676cc","c4e6a9f.e14ced8","4f614a6e.49ba3c","781db34e.2cc2e4"]]},{"id":"81321061.9be","type":"ui_gauge","z":"d622ee9e.cc1f68","name":"Temp Gauge for HB Feeder","group":"5735cec3.3ab7c8","order":1,"width":0,"height":0,"gtype":"gage","title":"Feeder Temperature","label":"Last updated {{msg.payload.timestamp}}","format":"{{msg.payload.probeTempc | number:1}} ºC","min":"-10","max":"30","colors":["#8ccbf2","#04cd0b","#ca3838"],"seg1":"7","seg2":"18","x":1060,"y":320,"wires":[]},{"id":"ea2b8073.2f1528","type":"debug","z":"d622ee9e.cc1f68","d":true,"name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":160,"wires":[]},{"id":"60dc4c5a.8676cc","type":"debug","z":"d622ee9e.cc1f68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":240,"wires":[]},{"id":"510cb996.0de238","type":"change","z":"d622ee9e.cc1f68","name":"use only json","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.json","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":240,"wires":[["f2597f5c.49fea"]]},{"id":"4e8237da.b17dc8","type":"template","z":"d622ee9e.cc1f68","name":"Valid JSON","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{ \"success\": \"true\" }","output":"str","x":390,"y":400,"wires":[["65401623.9abfe8"]]},{"id":"65401623.9abfe8","type":"change","z":"d622ee9e.cc1f68","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":400,"wires":[["35833799.3dc18"]]},{"id":"471b6298.d3e9cc","type":"http response","z":"d622ee9e.cc1f68","name":"Reply to http request","statusCode":"400","headers":{},"x":780,"y":460,"wires":[]},{"id":"aa02e6f6.41736","type":"template","z":"d622ee9e.cc1f68","name":"Invalid Request","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{ \"success\": \"false\" }","output":"str","x":380,"y":460,"wires":[["506f93f9.f47764"]]},{"id":"506f93f9.f47764","type":"change","z":"d622ee9e.cc1f68","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":460,"wires":[["471b6298.d3e9cc"]]},{"id":"c4e6a9f.e14ced8","type":"ui_gauge","z":"d622ee9e.cc1f68","name":"Outdoor Temp Gauge","group":"5735cec3.3ab7c8","order":1,"width":0,"height":0,"gtype":"gage","title":"Outdoor Temperature","label":"","format":"{{msg.payload.tempc | number:1}} ºC","min":"-10","max":"30","colors":["#8ccbf2","#04cd0b","#ca3838"],"seg1":"10","seg2":"23","x":1040,"y":360,"wires":[]},{"id":"4f614a6e.49ba3c","type":"ui_gauge","z":"d622ee9e.cc1f68","name":"Pressure","group":"5735cec3.3ab7c8","order":1,"width":0,"height":0,"gtype":"gage","title":"Pressure","label":"","format":"{{msg.payload.pressure | number:1}} hPa","min":"850","max":"1100","colors":["#c2d0d6","#c2e0d1","#e1e0d1"],"seg1":"950","seg2":"1050","x":1000,"y":400,"wires":[]},{"id":"781db34e.2cc2e4","type":"ui_gauge","z":"d622ee9e.cc1f68","name":"Humidity","group":"5735cec3.3ab7c8","order":1,"width":0,"height":0,"gtype":"gage","title":"Humidity","label":"","format":"{{msg.payload.humidity | number:1}} %","min":"0","max":"100","colors":["#e32400","#26bfbc","#0042aa"],"seg1":"30","seg2":"50","x":1000,"y":440,"wires":[]},{"id":"5735cec3.3ab7c8","type":"ui_group","name":"WizFi Hummingbird Feeder Sensor","tab":"6ee5e13f.f02bd8","order":1,"disp":true,"width":"6","collapse":false},{"id":"6ee5e13f.f02bd8","type":"ui_tab","name":"WizFi Sensor","icon":"wi-wu-sunny","order":3,"disabled":false,"hidden":false}]