I'm attempting to follow this Water Level Monitoring recipe and it's my first experience with Node-Red:
I've put together everything with the raspberry pi and am stuck at the following code that if I understand correctly gets places within the node "calculate percentage"
How is this parsed? Do the id's refer to nodes?
Any links that would help me understand how to connect this last bit?
Thanks so much!
((h-d)/h)*100
[{“id”:”14bf53f7.3fe83c”,”type”:”rpi-srf”,”z”:”368819c8.13b4b6″,”name”:”Sensor”,”pins”:”13,11″,”x”:66,”y”:104,”wires”:[[“c25630c9.c2d08”]]},{“id”:”c25630c9.c2d08″,”type”:”function”,”z”:”368819c8.13b4b6″,”name”:”Calculate Percentage”,”func”:”var distance = parseInt(msg.payload);
var EmptyDist = 108 – distance;
msg.payload = parseInt((EmptyDist/108)*100);
//msg.payload =(100- parseInt((temp/125)*100));
return msg;”,”outputs”:1,”noerr”:0,”x”:267,”y”:104,”wires”:[[“cd8cf3db.151e4″,”c3900b65.a67de8”]]},{“id”:”cd8cf3db.151e4″,”type”:”debug”,”z”:”368819c8.13b4b6″,”name”:””,”active”:false,”console”:”false”,”complete”:”false”,”x”:621,”y”:145,”wires”:},{“id”:”c3900b65.a67de8″,”type”:”ui_gauge”,”z”:”368819c8.13b4b6″,”name”:””,”group”:”f8c28556.6c7c98″,”order”:0,”width”:0,”height”:0,”gtype”:”gage”,”title”:”Tank Filled”,”label”:”Percentage”,”format”:”{{value}}”,”min”:0,”max”:”100″,”colors”:[“#b52100″,”#e6e600″,”#42ca38″],”seg1″:””,”seg2″:””,”x”:606,”y”:55,”wires”:},{“id”:”f8c28556.6c7c98″,”type”:”ui_group”,”z”:””,”name”:”Default”,”tab”:”8caefc37.2e2b3″,”disp”:true,”width”:”6″},{“id”:”8caefc37.2e2b3″,”type”:”ui_tab”,”z”:””,”name”:”Home”,”icon”:”dashboard”}]