Node Red basic flow setup #58
wist
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
I am not that good at Node red or coding in general, can you give me some pointers on what to do with this code? Do I paste it in on node red somewhere or use each line in its own node? Thanks |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
I really liked that project and it was exactly what I was looking for.
Currently, I have the device and set up the MQTT. As it was already mentioned that Node-Red is one of the potential ways to work with solution. Below example of basic flow setup - shows in dashboard current temperature, switches to turn on pump, heater, bubbles, set the target temperature.
[{"id":"78a72d6f.6b0dfc","type":"tab","label":"Beczka","disabled":false,"info":""},{"id":"ce3d9847.ce9e28","type":"mqtt in","z":"78a72d6f.6b0dfc","name":"Beczka","topic":"BW_2.0.0/message","qos":"2","datatype":"json","broker":"ae7212d8.bfefb","x":70,"y":180,"wires":[["cbe3da6d.dbaa08","26713e3c.9d9bea","a3f825a7.f4f1b"]]},{"id":"cbe3da6d.dbaa08","type":"debug","z":"78a72d6f.6b0dfc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":180,"wires":[]},{"id":"26713e3c.9d9bea","type":"function","z":"78a72d6f.6b0dfc","name":"","func":"p = msg.payload;\nmsg.payload=p.TMP\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":260,"wires":[["a85a7aa9.86aa28"]]},{"id":"a85a7aa9.86aa28","type":"ui_gauge","z":"78a72d6f.6b0dfc","name":"","group":"72594975.b3e02","order":1,"width":0,"height":0,"gtype":"gage","title":"Current Temperature","label":"°C","format":"{{value}}","min":0,"max":"50","colors":["#00a3d7","#ff6a00","#b51a00"],"seg1":"","seg2":"","x":980,"y":280,"wires":[]},{"id":"f2c2655d.2f6548","type":"ui_slider","z":"78a72d6f.6b0dfc","name":"","label":"Target Temperature","tooltip":"Target Temperature","group":"72594975.b3e02","order":2,"width":0,"height":0,"passthru":false,"outs":"end","topic":"topic","topicType":"msg","min":0,"max":"40","step":1,"x":530,"y":420,"wires":[["34ed60d1.fcb86"]]},{"id":"4077518.bacd3b","type":"mqtt out","z":"78a72d6f.6b0dfc","name":"","topic":"BW_2.0.0/command","qos":"","retain":"","broker":"ae7212d8.bfefb","x":1040,"y":500,"wires":[]},{"id":"a7bdc587.3f4ed","type":"ui_switch","z":"78a72d6f.6b0dfc","name":"","label":"Pump","tooltip":"","group":"72594975.b3e02","order":3,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"{\"CMD\":4,\"VALUE\":1,\"XTIME\":0,\"INTERVAL\":0}","onvalueType":"json","onicon":"","oncolor":"","offvalue":"{\"CMD\":4,\"VALUE\":0,\"XTIME\":0,\"INTERVAL\":0}","offvalueType":"json","officon":"","offcolor":"","animate":false,"x":510,"y":500,"wires":[["4077518.bacd3b"]]},{"id":"ca88e121.4fed1","type":"ui_switch","z":"78a72d6f.6b0dfc","name":"","label":"Heat","tooltip":"","group":"72594975.b3e02","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"{\"CMD\":3,\"VALUE\":1,\"XTIME\":0,\"INTERVAL\":0}","onvalueType":"json","onicon":"","oncolor":"","offvalue":"{\"CMD\":3,\"VALUE\":0,\"XTIME\":0,\"INTERVAL\":0}","offvalueType":"json","officon":"","offcolor":"","animate":false,"x":510,"y":560,"wires":[["4077518.bacd3b"]]},{"id":"682288d7.057a98","type":"ui_switch","z":"78a72d6f.6b0dfc","name":"","label":"Bubbles","tooltip":"","group":"72594975.b3e02","order":5,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"{\"CMD\":2,\"VALUE\":1,\"XTIME\":0,\"INTERVAL\":0}","onvalueType":"json","onicon":"","oncolor":"","offvalue":"{\"CMD\":2,\"VALUE\":0,\"XTIME\":0,\"INTERVAL\":0}","offvalueType":"json","officon":"","offcolor":"","animate":false,"x":520,"y":640,"wires":[["4077518.bacd3b"]]},{"id":"34ed60d1.fcb86","type":"function","z":"78a72d6f.6b0dfc","name":"","func":"var trg = msg.payload;\nvar newMsg = { payload: {CMD:0,VALUE:trg,XTIME:0,INTERVAL:0} };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":420,"wires":[["4077518.bacd3b"]]},{"id":"a3f825a7.f4f1b","type":"function","z":"78a72d6f.6b0dfc","name":"","func":"p = msg.payload;\nmsg.payload=p.TGT\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":360,"wires":[["f2c2655d.2f6548"]]},{"id":"ae7212d8.bfefb","type":"mqtt-broker","name":"","broker":"192.168.88.14","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"72594975.b3e02","type":"ui_group","name":"Beczka","tab":"2e73d1a7.8de786","order":3,"disp":true,"width":"6","collapse":false},{"id":"2e73d1a7.8de786","type":"ui_tab","name":"MountainHideaway","icon":"dashboard","disabled":false,"hidden":false}]
Beta Was this translation helpful? Give feedback.
All reactions