Hi
I have this flow below and i want to put AND gate so when the output of the function (Calculate Percentage) decreased to 10 the AND gate gives output so I can run on of GPIOs of the raspberry pi.
I put the AND gate and set the topics for the (Calculate Percentage) with number less than 10 and Inject node (less) with number ==10.
but I think there is something wrong.
please advise where is the mistake in this setting
[{"id":"b35f6956.6db678","type":"rpi-srf","z":"dae97729.e9eed8","name":"Sensor","topic":"","pulse":"0.5","pins":"37,38","x":108,"y":155,"wires":[["616ac931.29b938"]]},{"id":"616ac931.29b938","type":"function","z":"dae97729.e9eed8","name":"Calculate Percentage","func":"var distance = parseInt(msg.payload);\nvar EmptyDist = 100 -distance;\nmsg.payload = parseInt((EmptyDist/100)*100);\n//msg.payload =(100- parseInt((temp/125)*100));\nreturn msg;\n","outputs":1,"noerr":0,"x":309,"y":155,"wires":[["cd2a360c.cbed68","f1ae908b.e85ce"]]},{"id":"39f04960.f55496","type":"debug","z":"dae97729.e9eed8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":628,"y":252,"wires":[]},{"id":"cd2a360c.cbed68","type":"ui_gauge","z":"dae97729.e9eed8","name":"","group":"2cad78f1.953508","order":0,"width":"6","height":"7","gtype":"gage","title":"Tank Filled","label":"Percentage","format":"{{value}}","min":0,"max":"100","colors":["#b52100","#e6e600","#42ca38"],"seg1":"","seg2":"","x":661,"y":120,"wires":[]},{"id":"f1ae908b.e85ce","type":"and-gate","z":"dae97729.e9eed8","name":"","rules":[{"t":"lt","v":"10","vt":"num","propertyType":"msg","property":"payload","topic":"Calculate Percentage"},{"t":"eq","v":"10","vt":"num","propertyType":"msg","property":"payload","topic":"less"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":false,"x":373,"y":267,"wires":[["39f04960.f55496"]]},{"id":"8c0273fa.30168","type":"inject","z":"dae97729.e9eed8","name":"","topic":"less","payload":"10","payloadType":"num","repeat":".2","crontab":"","once":false,"onceDelay":0.1,"x":121,"y":301,"wires":[["f1ae908b.e85ce"]]},{"id":"2cad78f1.953508","type":"ui_group","z":"","name":"Mustafa","tab":"9f2b0241.7a073","disp":true,"width":"6","collapse":false},{"id":"9f2b0241.7a073","type":"ui_tab","z":"","name":"Home","icon":"my dash","order":2}]