-
Notifications
You must be signed in to change notification settings - Fork 7
/
TerrariumController-Flow-v1.json
1 lines (1 loc) · 3.31 KB
/
TerrariumController-Flow-v1.json
1
[{"id":"e794b48c.3de63","type":"tab","label":"Terrarium Controller v1","disabled":true,"info":""},{"id":"ebcbe07f.db82a","type":"ui_switch","z":"e794b48c.3de63","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":[["73a6fff9.14818"]]},{"id":"17828ad3.04888d","type":"mqtt out","z":"e794b48c.3de63","name":"Publish pump state","topic":"techexplorations/terrarium/pump-control","qos":"0","retain":"","broker":"ac3817ea.826db8","x":1250,"y":380,"wires":[]},{"id":"6e8eaf1d.b6d9f","type":"ui_text","z":"e794b48c.3de63","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":"6d47ed50.e6c2dc","type":"debug","z":"e794b48c.3de63","name":"Pump state","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1230,"y":280,"wires":[]},{"id":"158d7413.313084","type":"mqtt in","z":"e794b48c.3de63","name":"Get soil humidity","topic":"techexplorations/terrarium/soil-humidity","qos":"0","datatype":"auto","broker":"ac3817ea.826db8","x":260,"y":220,"wires":[["9b56a09b.122248","b499576d.6744d8"]]},{"id":"9b56a09b.122248","type":"ui_gauge","z":"e794b48c.3de63","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":"b499576d.6744d8","type":"function","z":"e794b48c.3de63","name":"Pump operation","func":"\nvar pump_state = '0';\n\nif (msg.payload > 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":[["73a6fff9.14818"]]},{"id":"73a6fff9.14818","type":"rbe","z":"e794b48c.3de63","name":"Update if pump state changed","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":900,"y":320,"wires":[["17828ad3.04888d","6d47ed50.e6c2dc","6e8eaf1d.b6d9f"]]},{"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":"7d9d0a00.14e178","type":"ui_tab","z":"","name":"Terrarium","icon":"dashboard","disabled":false,"hidden":false}]