forked from futureshocked/NodeRed-ESP32-TerrariumController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TerrariumController-Flow-v2.json
1 lines (1 loc) · 5.67 KB
/
TerrariumController-Flow-v2.json
1
[{"id":"95f61a9d.5f6458","type":"tab","label":"Terrarium Controller v2","disabled":true,"info":""},{"id":"47ea54d5.4c5f8c","type":"ui_switch","z":"95f61a9d.5f6458","name":"Manual pump control","label":"Manual pump control","tooltip":"","group":"4c9b7e83.a15c88","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":280,"y":380,"wires":[["e431ef11.3e887"]]},{"id":"acd7863.110a278","type":"mqtt out","z":"95f61a9d.5f6458","name":"Publish pump state","topic":"techexplorations/terrarium/pump-control","qos":"0","retain":"","broker":"ac3817ea.826db8","x":1250,"y":380,"wires":[]},{"id":"5821c3fe.18a6f4","type":"ui_text","z":"95f61a9d.5f6458","group":"582e5eea.e3645","order":3,"width":0,"height":0,"name":"Pump state","label":"Pump state is...","format":"{{msg.payload}}","layout":"row-spread","x":1230,"y":320,"wires":[]},{"id":"aa578c73.5c8618","type":"debug","z":"95f61a9d.5f6458","name":"Pump state","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1230,"y":280,"wires":[]},{"id":"d9509fa8.89396","type":"mqtt in","z":"95f61a9d.5f6458","name":"Get soil humidity","topic":"techexplorations/terrarium/soil-humidity","qos":"0","datatype":"auto","broker":"ac3817ea.826db8","x":260,"y":220,"wires":[["6ec1361a.9784c","6c1536db.d542a","80d00cb2.21b04"]]},{"id":"6ec1361a.9784c","type":"ui_gauge","z":"95f61a9d.5f6458","name":"Soil humidity raw","group":"c76544b.1f79338","order":1,"width":0,"height":0,"gtype":"gage","title":"Soil humidity raw","label":"units","format":"{{value}}","min":0,"max":"1023","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":590,"y":180,"wires":[]},{"id":"6c1536db.d542a","type":"function","z":"95f61a9d.5f6458","name":"Pump operation","func":"var pump_state = '0';\n\nvar device_string = msg.payload.split(\",\"); // The data is coming in like this: \"167,ESP32_client_2\"\n // The actual sensor value is in device_string[0]\nvar raw_humidity_value = device_string[0];\nvar device_name = device_string[1];\n\n\nif (raw_humidity_value > 500)\n{\n \n pump_state = '1';\n} else\n{\n pump_state = '0';\n}\n\n\nreturn {payload: pump_state};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":260,"wires":[["e431ef11.3e887"]]},{"id":"e431ef11.3e887","type":"rbe","z":"95f61a9d.5f6458","name":"Update if pump state changed","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":900,"y":320,"wires":[["acd7863.110a278","aa578c73.5c8618","5821c3fe.18a6f4"]]},{"id":"3bca9c9d.118474","type":"mqtt in","z":"95f61a9d.5f6458","name":"Get MCU voltage","topic":"techexplorations/terrarium/mcu_voltage","qos":"0","datatype":"auto","broker":"ac3817ea.826db8","x":280,"y":520,"wires":[["16b11325.5612d5","ec9df89c.addbc8"]]},{"id":"708a76ac.90eea","type":"mqtt in","z":"95f61a9d.5f6458","name":"Get motor voltage","topic":"techexplorations/terrarium/motor_voltage","qos":"2","datatype":"auto","broker":"ac3817ea.826db8","x":290,"y":640,"wires":[["605875b6.9afb9c","41e0d826.c352d"]]},{"id":"16b11325.5612d5","type":"debug","z":"95f61a9d.5f6458","name":"MCU Voltage","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":480,"wires":[]},{"id":"605875b6.9afb9c","type":"debug","z":"95f61a9d.5f6458","name":"Motor Voltage","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":620,"wires":[]},{"id":"ec9df89c.addbc8","type":"ui_gauge","z":"95f61a9d.5f6458","name":"MCU Voltage","group":"8a1febd1.228ed8","order":0,"width":"6","height":"6","gtype":"gage","title":"MCU Voltage","label":"V","format":"{{value | number:1}} V","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":660,"y":540,"wires":[]},{"id":"41e0d826.c352d","type":"ui_gauge","z":"95f61a9d.5f6458","name":"Motor Voltage","group":"8a1febd1.228ed8","order":0,"width":"6","height":"6","gtype":"gage","title":"Motor Voltage","label":"V","format":"{{value | number:1}} V","min":0,"max":"9","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":640,"y":700,"wires":[]},{"id":"80d00cb2.21b04","type":"debug","z":"95f61a9d.5f6458","name":"Soil humidity raw","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":600,"y":120,"wires":[]},{"id":"4c9b7e83.a15c88","type":"ui_group","z":"","name":"Manual Pump Control","tab":"7d9d0a00.14e178","order":1,"disp":true,"width":"4","collapse":false},{"id":"ac3817ea.826db8","type":"mqtt-broker","z":"","name":"MQTT client on NodeRed.local","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"582e5eea.e3645","type":"ui_group","z":"","name":"Pump","tab":"7d9d0a00.14e178","order":2,"disp":true,"width":"4","collapse":false},{"id":"c76544b.1f79338","type":"ui_group","z":"","name":"Soil humidity","tab":"7d9d0a00.14e178","order":5,"disp":true,"width":"6","collapse":false},{"id":"8a1febd1.228ed8","type":"ui_group","z":"","name":"Voltages","tab":"7d9d0a00.14e178","order":7,"disp":true,"width":"6","collapse":false},{"id":"7d9d0a00.14e178","type":"ui_tab","z":"","name":"Terrarium","icon":"dashboard","disabled":false,"hidden":false}]