[{"id":"8f911976.b53d28","type":"inject","z":"eb899e15.c06928","name":"","topic":"","payload":"","payloadType":"num","repeat":"5","crontab":"","once":true,"x":202.66661834716797,"y":645.9999491146632,"wires":[["31f0b639.870ca2"]]},{"id":"31f0b639.870ca2","type":"exec","z":"eb899e15.c06928","command":"vcgencmd","addpay":false,"append":"measure_temp","useSpawn":"","name":"getCPUtemp","x":371.26973724365234,"y":646.4602437019348,"wires":[["80585cd2.b74c"],[],[]]},{"id":"80585cd2.b74c","type":"function","z":"eb899e15.c06928","name":"CPU Temp Function","func":"//msg.payload = {'d':{'temp': parseFloat(msg.payload.replace(\"temp=\",\"\").replace(\"'C\\n\",\"\"))}};\nmsg.payload = parseFloat(msg.payload.replace(\"temp=\",\"\").replace(\"'C\\n\",\"\"));\nreturn msg;","outputs":1,"noerr":0,"x":578.8570404052734,"y":633.7142720222473,"wires":[["317b0f1f.5d7fd8"]]},{"id":"317b0f1f.5d7fd8","type":"mqtt out","z":"eb899e15.c06928","name":"MQTT-CpuTemp","topic":"cpuTemp","qos":"2","retain":"","broker":"9fbaab4c.84b59","x":794.8094940185547,"y":633.6191792488098,"wires":[]},{"id":"c9c00cb6.37e07","type":"comment","z":"eb899e15.c06928","name":"Check CPU's Temperature","info":"","x":239.6666488647461,"y":599.6192030906677,"wires":[]},{"id":"2d8196e1.fcf0ca","type":"comment","z":"eb899e15.c06928","name":"PID Control For CPU Temperature of Raspberry PI","info":"","x":315.880859375,"y":107.15489196777344,"wires":[]},{"id":"7be08aea.f34e4c","type":"PID control","z":"eb899e15.c06928","name":"PID Controller","target":"40","kp":"85","ki":"1","kd":"5","x":394.9285011291504,"y":158.48825454711914,"wires":[["e045cb5f.8fbf4","2fbb2a1d.d36976","c1d0113f.649f18","943125f0.2f2fd"]]},{"id":"e045cb5f.8fbf4","type":"debug","z":"eb899e15.c06928","name":"","active":false,"console":"false","complete":"payload","x":638.4642105102539,"y":291.23824582781117,"wires":[]},{"id":"2fbb2a1d.d36976","type":"ui_chart","z":"eb899e15.c06928","name":"Chart: PID Output Data","group":"fd926966.da3398","order":3,"width":0,"height":0,"label":"PID Output","chartType":"line","legend":"false","xformat":"%H:%M:%S","interpolate":"linear","nodata":"PID Output","ymin":"","ymax":"","removeOlder":"1","removeOlderUnit":"3600","x":668.6547088623047,"y":212.57159233093262,"wires":[[],[]]},{"id":"c1d0113f.649f18","type":"ui_gauge","z":"eb899e15.c06928","name":"Gauge: PID Output","group":"fd926966.da3398","order":4,"width":0,"height":0,"gtype":"wave","title":"Gauge","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#08f508","#e6e600","#ca3838"],"x":660.4642105102539,"y":252.23824582781117,"wires":[]},{"id":"8055fb2a.f92dc8","type":"debug","z":"eb899e15.c06928","name":"","active":false,"console":"false","complete":"false","x":426.2142028808594,"y":540.4882377215795,"wires":[]},{"id":"1be8dfc9.ded1","type":"ui_chart","z":"eb899e15.c06928","name":"Chart: CPU Temperature","group":"fd926966.da3398","order":2,"width":0,"height":0,"label":"CPU Temperature [°C]","chartType":"line","legend":"false","xformat":"%H:%M:%S","interpolate":"linear","nodata":"CPU Temperature","ymin":"28","ymax":"50","removeOlder":"2","removeOlderUnit":"3600","x":467.2142028808594,"y":462.4882377215795,"wires":[[],[]]},{"id":"c143c28a.8c55f8","type":"ui_gauge","z":"eb899e15.c06928","name":"Guage: CPU Temperature","group":"fd926966.da3398","order":1,"width":0,"height":0,"gtype":"gage","title":"CPU Temperature [°C]","label":"°C","format":"{{value}}","min":"0","max":"100","colors":["#00b500","#e6e600","#f90404"],"x":470.2142028808594,"y":503.4882377215795,"wires":[]},{"id":"ace8d25a.df9b5","type":"mqtt in","z":"eb899e15.c06928","name":"MQTT-cpuTemp","topic":"cpuTemp","qos":"2","broker":"9fbaab4c.84b59","x":193.16661834716797,"y":460.9165859222412,"wires":[["1be8dfc9.ded1","c143c28a.8c55f8","8055fb2a.f92dc8"]]},{"id":"41e856c3.76a04","type":"mqtt in","z":"eb899e15.c06928","name":"MQTT-cpuTemp","topic":"cpuTemp","qos":"2","broker":"9fbaab4c.84b59","x":195.4999542236328,"y":159.5832691192627,"wires":[["7be08aea.f34e4c"]]},{"id":"631c4226.beff6c","type":"function","z":"eb899e15.c06928","name":"PLANT","func":"var PID = msg.payload; // PID Value\nvar cycle; // PWM duty cycle\nvar adjustment = 0; // duty cycle adjustment\n\nvar cycle = parseFloat(adjustment) + parseFloat(PID);\n\nif(cycle<0){\n msg.payload=0;\n return msg;\n}\n\nelse if(cycle>100){\n msg.payload=100;\n return msg;\n}\n\nelse\n{\n msg.payload = parseFloat(cycle); \n // 0 - 100\n return msg;\n}\n\nreturn null;","outputs":1,"noerr":0,"x":410.9404411315918,"y":346.71424865722656,"wires":[["2a78b69.fdb4c4a","af935e7f.5ea728"]]},{"id":"2a78b69.fdb4c4a","type":"debug","z":"eb899e15.c06928","name":"","active":false,"console":"false","complete":"false","x":634.3095016479492,"y":401.6785593032837,"wires":[]},{"id":"943125f0.2f2fd","type":"mqtt out","z":"eb899e15.c06928","name":"MQTT-pidController","topic":"pidController","qos":"2","retain":"","broker":"9fbaab4c.84b59","x":657.7380469185964,"y":159.1070904050555,"wires":[]},{"id":"c3a0b666.3e069","type":"mqtt in","z":"eb899e15.c06928","name":"MQTT-pidController","topic":"pidController","qos":"2","broker":"9fbaab4c.84b59","x":214.88090406145375,"y":346.5356618336268,"wires":[["631c4226.beff6c"]]},{"id":"35f6364c.ecd532","type":"comment","z":"eb899e15.c06928","name":"PID - PLANT","info":"","x":186.30947549002508,"y":302.96423326219826,"wires":[]},{"id":"add0eb8a.285b38","type":"comment","z":"eb899e15.c06928","name":"Chart & Gauge : CPU temperature","info":"","x":263.02376556396484,"y":417.67852306365967,"wires":[]},{"id":"af935e7f.5ea728","type":"rpi-gpio out","z":"eb899e15.c06928","name":"","pin":"7","set":false,"level":"0","out":"pwm","x":620.166618347168,"y":347.96424198150635,"wires":[]},{"id":"7e881442.9dd66c","type":"ping","z":"eb899e15.c06928","name":"Ping","host":"169.254.170.40","timer":"5","x":184,"y":778,"wires":[["14982858.677f98"]]},{"id":"14982858.677f98","type":"function","z":"eb899e15.c06928","name":"Internet Speed","func":"var i = msg.payload;\nmsg.payload = i;\n\nreturn msg;","outputs":1,"noerr":0,"x":353.8412322998047,"y":777.2380992344447,"wires":[["334743d.7faa8bc","b4451c1c.b0ca5"]]},{"id":"3b78a954.5f2e06","type":"comment","z":"eb899e15.c06928","name":"Check Your Internet","info":"","x":222.80963134765625,"y":735.2383433750697,"wires":[]},{"id":"334743d.7faa8bc","type":"mqtt out","z":"eb899e15.c06928","name":"MQTT-ping","topic":"ping","qos":"","retain":"","broker":"867260d8.6e4528","x":557.9524383544922,"y":776.2383433750697,"wires":[]},{"id":"b4451c1c.b0ca5","type":"ui_gauge","z":"eb899e15.c06928","name":"","group":"c7236c58.0aaa88","order":0,"width":0,"height":0,"gtype":"gage","title":"Internet Speed (bps)","label":"Internet Speed","format":"{{value}}","min":0,"max":"1","colors":["#00b500","#e6e600","#ca3838"],"x":564.6666870117188,"y":823.6666870117188,"wires":[]},{"id":"9fbaab4c.84b59","type":"mqtt-broker","z":"eb899e15.c06928","broker":"iot.eclipse.org","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":null,"willPayload":"","birthTopic":"","birthQos":"0","birthRetain":null,"birthPayload":""},{"id":"fd926966.da3398","type":"ui_group","z":"eb899e15.c06928","name":"PID Controller For CPU Temperature of Raspberry Pi","tab":"c22f70f2.a2fb8","disp":true,"width":"9"},{"id":"867260d8.6e4528","type":"mqtt-broker","z":"","broker":"iot.eclipse.org","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"c7236c58.0aaa88","type":"ui_group","z":"","name":"Internet Speed (bps)","tab":"c04c3164.372f3","disp":true,"width":"6"},{"id":"c22f70f2.a2fb8","type":"ui_tab","z":"eb899e15.c06928","name":"Robot CPU ","icon":"dashboard"},{"id":"c04c3164.372f3","type":"ui_tab","z":"","name":"Internet Speed","icon":"dashboard"}]