[{"id":"941d2aca.67d888","type":"inject","z":"df9eae86.f479d","name":"","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":true,"onceDelay":"10","x":130,"y":140,"wires":[["6f8b2daa.da9c14","8f99ef4.48e691"]]},{"id":"16b5ee5b.127152","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"Model Family","format":"{{msg.payload.model_family}}","layout":"row-spread","x":800,"y":60,"wires":[]},{"id":"7c9ae1fc.e82d9","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"Model Name","format":"{{msg.payload.model_name}}","layout":"row-spread","x":790,"y":100,"wires":[]},{"id":"30d3bab6.c82c76","type":"ui_text","z":"df9eae86.f479d","group":"39e9bde4.2fb442","order":3,"width":0,"height":0,"name":"","label":"Total Erase Count","format":"{{msg.payload}}","layout":"row-spread","x":1510,"y":420,"wires":[]},{"id":"67c4b657.b3d1a8","type":"ui_text","z":"df9eae86.f479d","group":"39e9bde4.2fb442","order":1,"width":"0","height":"0","name":"","label":"Power Cycle","format":"{{msg.payload.power_cycle_count}}","layout":"row-spread","x":790,"y":400,"wires":[]},{"id":"ca766b8.53dc198","type":"ui_text","z":"df9eae86.f479d","group":"42cdcb5f.3dfd04","order":2,"width":"6","height":"1","name":"","label":"Last Update","format":"{{msg.payload}}","layout":"row-spread","x":150,"y":340,"wires":[]},{"id":"85bf17de.3425f8","type":"ui_text","z":"df9eae86.f479d","group":"42cdcb5f.3dfd04","order":1,"width":"6","height":"1","name":"","label":"Now","format":"{{msg.payload}}","layout":"row-spread","x":150,"y":580,"wires":[]},{"id":"46e115a0.ab5f9c","type":"inject","z":"df9eae86.f479d","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":400,"wires":[["2d8e0ff9.70ae"]]},{"id":"97206ca9.64fe3","type":"function","z":"df9eae86.f479d","name":"To Date String","func":"msg.payload = msg.year + \"/\" + ('00'+ msg.month).slice(-2) + \"/\" + ('00'+msg.day).slice(-2) + \" \" + ('00'+msg.hours).slice(-2) + \":\" + ('00'+msg.mins).slice(-2) + \":\" + ('00'+msg.secs).slice(-2);\nreturn msg;","outputs":1,"noerr":0,"x":140,"y":520,"wires":[["85bf17de.3425f8"]]},{"id":"2d8e0ff9.70ae","type":"function","z":"df9eae86.f479d","name":"timeConvert","func":"if ( !msg.timestamp ) msg.timestamp = Math.round(+new Date());\n\nvar dt = new Date(msg.timestamp);\nvar msg = {\n\t'month':\tdt.getMonth() + 1,\n\t'day':\t\tdt.getDate(),\n\t'year':\t\tdt.getFullYear(),\n\t'hours':\tdt.getHours(),\n\t'mins':\t\tdt.getMinutes(),\n\t'secs':\tdt.getSeconds()\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":130,"y":460,"wires":[["97206ca9.64fe3"]]},{"id":"6f8b2daa.da9c14","type":"function","z":"df9eae86.f479d","name":"timeConvert","func":"if ( !msg.timestamp ) msg.timestamp = Math.round(+new Date());\n\nvar dt = new Date(msg.timestamp);\nvar msg = {\n\t'month':\tdt.getMonth() + 1,\n\t'day':\t\tdt.getDate(),\n\t'year':\t\tdt.getFullYear(),\n\t'hours':\tdt.getHours(),\n\t'mins':\t\tdt.getMinutes(),\n\t'secs':\tdt.getSeconds()\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":150,"y":220,"wires":[["9dd6b9c0.099f28"]]},{"id":"9dd6b9c0.099f28","type":"function","z":"df9eae86.f479d","name":"To Date String","func":"msg.payload = msg.year + \"/\" + ('00'+ msg.month).slice(-2) + \"/\" + ('00'+msg.day).slice(-2) + \" \" + ('00'+msg.hours).slice(-2) + \":\" + ('00'+msg.mins).slice(-2) + \":\" + ('00'+msg.secs).slice(-2);\nreturn msg;","outputs":1,"noerr":0,"x":140,"y":280,"wires":[["ca766b8.53dc198"]]},{"id":"c37c9462.7f7658","type":"comment","z":"df9eae86.f479d","name":"Dashboard UI element","info":"","x":820,"y":20,"wires":[]},{"id":"86f27db1.2a0b9","type":"comment","z":"df9eae86.f479d","name":"Call \" smartctl \" app","info":"","x":350,"y":60,"wires":[]},{"id":"baa28ffe.9de7","type":"comment","z":"df9eae86.f479d","name":"Interval every 1 hour","info":"","x":130,"y":80,"wires":[]},{"id":"c5479.b9640b878","type":"ui_text","z":"df9eae86.f479d","group":"39e9bde4.2fb442","order":1,"width":"0","height":"0","name":"","label":"Power On Time","format":"{{msg.payload.power_on_time.hours}}","layout":"row-spread","x":800,"y":440,"wires":[]},{"id":"dcbb44cc.4ec8e8","type":"ui_gauge","z":"df9eae86.f479d","name":"","group":"880817e6.d0b198","order":0,"width":0,"height":0,"gtype":"gage","title":"Temperature","label":"°C","format":"{{msg.payload}}","min":0,"max":"100","colors":["#00ff00","#ffff00","#ff0000"],"seg1":"40","seg2":"70","x":950,"y":360,"wires":[]},{"id":"ea9f9a6c.6729c8","type":"function","z":"df9eae86.f479d","name":"Math.round","func":"msg.payload = Math.round(msg.payload.temperature.current)\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":360,"wires":[["dcbb44cc.4ec8e8"]]},{"id":"17bff244.1eaf9e","type":"json","z":"df9eae86.f479d","name":"","property":"payload","action":"obj","pretty":false,"x":410,"y":260,"wires":[["16b5ee5b.127152","7c9ae1fc.e82d9","6bdfd52e.93a74c","248b86b2.b2b45a","ec955747.95b198","5e81932d.dfcc3c","1ae7f752.cbec49","ea9f9a6c.6729c8","67c4b657.b3d1a8","c5479.b9640b878","f1553914.fd70e8","816d8bd7.f9d2d8","9cbcbc1d.c38f4","5b7bd39f.21fb0c","b47495db.fd6708"]]},{"id":"6bdfd52e.93a74c","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"Serial Number","format":"{{msg.payload.serial_number}}","layout":"row-spread","x":800,"y":140,"wires":[]},{"id":"248b86b2.b2b45a","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"Firmware Version","format":"{{msg.payload.firmware_version}}","layout":"row-spread","x":810,"y":180,"wires":[]},{"id":"ec955747.95b198","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"System Device Name","format":"{{msg.payload.device.name}}","layout":"row-spread","x":820,"y":220,"wires":[]},{"id":"5e81932d.dfcc3c","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"System Device Protocol","format":"{{msg.payload.device.protocol}}","layout":"row-spread","x":830,"y":260,"wires":[]},{"id":"1ae7f752.cbec49","type":"function","z":"df9eae86.f479d","name":"Math.round","func":"n = Math.round(msg.payload.user_capacity.bytes);\nif (n < 1000000000){\n size = Math.round(n/1000000) + \"MB\"\n}else{\n size = Math.round(n/1000000000) + \"GB\"\n}\nmsg.payload = size;\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":300,"wires":[["909ff2d1.a30f2"]]},{"id":"909ff2d1.a30f2","type":"ui_text","z":"df9eae86.f479d","group":"d464651c.a33c08","order":0,"width":0,"height":0,"name":"","label":"User Capacity","format":"{{msg.payload}}","layout":"row-spread","x":980,"y":300,"wires":[]},{"id":"fa4fec67.8a148","type":"ui_text","z":"df9eae86.f479d","group":"90787cb5.eb121","order":1,"width":"6","height":"2","name":"","label":"SMART Test Result","format":"","layout":"col-center","x":930,"y":560,"wires":[]},{"id":"816d8bd7.f9d2d8","type":"function","z":"df9eae86.f479d","name":"Test","func":"msg.color = (msg.payload.smart_status.passed)?\"lime\":\"red\";\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":560,"wires":[["fa4fec67.8a148"]]},{"id":"f1553914.fd70e8","type":"change","z":"df9eae86.f479d","name":"Move to msg.payload.Value","rules":[{"t":"move","p":"payload.ata_smart_attributes.table","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":500,"wires":[["71151602.ea24a8"]]},{"id":"71151602.ea24a8","type":"split","z":"df9eae86.f479d","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1030,"y":500,"wires":[["d60ba2e1.6db2b","5cb8e09.f85dc2","ac93d582.590c78","aa418f7a.718d8","eba41b8b.f35d98"]]},{"id":"d7bf38b0.26efc8","type":"ui_gauge","z":"df9eae86.f479d","name":"","group":"5f5ce28e.f9ae9c","order":0,"width":0,"height":0,"gtype":"gage","title":"Life","label":"%","format":"{{msg.payload}}","min":0,"max":"100","colors":["#ff0000","#ffff00","#00ff00"],"seg1":"40","seg2":"70","x":1370,"y":380,"wires":[]},{"id":"d60ba2e1.6db2b","type":"function","z":"df9eae86.f479d","name":"169 Life","func":"if (msg.payload.id == 169)\n{\n msg.payload = msg.payload.raw.value\n return msg\n}","outputs":1,"noerr":0,"x":1220,"y":380,"wires":[["d7bf38b0.26efc8"]]},{"id":"5cb8e09.f85dc2","type":"function","z":"df9eae86.f479d","name":"164 Total Erase Count","func":"if (msg.payload.id == 164)\n{\n msg.payload = msg.payload.raw.value\n return msg\n}","outputs":1,"noerr":0,"x":1260,"y":420,"wires":[["30d3bab6.c82c76"]]},{"id":"685abd77.cd9634","type":"ui_text","z":"df9eae86.f479d","group":"90787cb5.eb121","order":3,"width":0,"height":0,"name":"","label":"Unsafe Shutdown Count","format":"{{msg.payload}}","layout":"col-center","x":1530,"y":460,"wires":[]},{"id":"ac93d582.590c78","type":"function","z":"df9eae86.f479d","name":"192 Power-Off Retract Count","func":"if (msg.payload.id == 192)\n{\n msg.payload = msg.payload.raw.value\n return msg\n}","outputs":1,"noerr":0,"x":1280,"y":460,"wires":[["685abd77.cd9634"]]},{"id":"bbdfb6fe.7198c8","type":"ui_text","z":"df9eae86.f479d","group":"39e9bde4.2fb442","order":3,"width":0,"height":0,"name":"","label":"Valid Spare Block Count","format":"{{msg.payload}}","layout":"row-spread","x":1530,"y":500,"wires":[]},{"id":"aa418f7a.718d8","type":"function","z":"df9eae86.f479d","name":"161 Valid Spare Block Count","func":"if (msg.payload.id == 161)\n{\n msg.payload = msg.payload.raw.value\n return msg\n}","outputs":1,"noerr":0,"x":1280,"y":500,"wires":[["bbdfb6fe.7198c8"]]},{"id":"840a032b.a45a9","type":"ui_text","z":"df9eae86.f479d","group":"39e9bde4.2fb442","order":3,"width":0,"height":0,"name":"","label":"Initial Bad Block Count","format":"{{msg.payload}}","layout":"row-spread","x":1520,"y":540,"wires":[]},{"id":"eba41b8b.f35d98","type":"function","z":"df9eae86.f479d","name":"163 Initial Bad Block Count","func":"if (msg.payload.id == 163)\n{\n msg.payload = msg.payload.raw.value\n return msg\n}","outputs":1,"noerr":0,"x":1280,"y":540,"wires":[["840a032b.a45a9"]]},{"id":"9af54deb.1bcff","type":"comment","z":"df9eae86.f479d","name":"-a","info":"","x":310,"y":100,"wires":[]},{"id":"8f99ef4.48e691","type":"exec","z":"df9eae86.f479d","command":"E:\\smartmontools-7.2.win32\\bin\\smartctl.exe -a -j /dev/sdb","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Device SMART Information","x":380,"y":140,"wires":[["17bff244.1eaf9e"],[],[]]},{"id":"9cbcbc1d.c38f4","type":"file","z":"df9eae86.f479d","name":"","filename":"E:\\SMART\\smart.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","x":660,"y":640,"wires":[["b72d76e2.1dc7a8"]]},{"id":"5b7bd39f.21fb0c","type":"debug","z":"df9eae86.f479d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":580,"wires":[]},{"id":"b72d76e2.1dc7a8","type":"debug","z":"df9eae86.f479d","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":640,"wires":[]},{"id":"ee812205.c161d","type":"http in","z":"df9eae86.f479d","name":"","url":"/smart","method":"get","upload":false,"swaggerDoc":"","x":320,"y":20,"wires":[["8f99ef4.48e691"]]},{"id":"b47495db.fd6708","type":"http response","z":"df9eae86.f479d","name":"","x":370,"y":660,"wires":[]},{"id":"d464651c.a33c08","type":"ui_group","z":"","name":"Group 2","tab":"afbc4ac1.81aaa8","order":4,"disp":false,"width":"6","collapse":false},{"id":"39e9bde4.2fb442","type":"ui_group","z":"","name":"Group 3","tab":"afbc4ac1.81aaa8","order":5,"disp":false,"width":"6","collapse":false},{"id":"42cdcb5f.3dfd04","type":"ui_group","z":"","name":"Group 1","tab":"afbc4ac1.81aaa8","order":1,"disp":false,"width":"6","collapse":false},{"id":"880817e6.d0b198","type":"ui_group","z":"","name":"Group 5","tab":"afbc4ac1.81aaa8","order":3,"disp":false,"width":"6","collapse":false},{"id":"90787cb5.eb121","type":"ui_group","z":"","name":"Group 4","tab":"afbc4ac1.81aaa8","order":6,"disp":false,"width":"6","collapse":false},{"id":"5f5ce28e.f9ae9c","type":"ui_group","z":"","name":"Group 6","tab":"afbc4ac1.81aaa8","order":2,"disp":false,"width":"6","collapse":false},{"id":"afbc4ac1.81aaa8","type":"ui_tab","z":"","name":"Local SMART (127.0.0.1)","icon":"dashboard","order":1}]