Hi. The original discussion started here.
As the conversation went on, we decided that the package was not usable, and decided to count pulses from the sensor with this timed-counter node.
Now, I am trying to count the pulses, and update a text on the UI according to that. If timed counter counts no pulses, it will say "Bozuk" (it means faulty), when there are more than x amount of pulses, it will say "Normal", before the button press, and after 2nd press, it must show "-", since the button will also start the pump. How can I do this? I tried something like this:
[{"id":"14dab897.d647d7","type":"ui_switch","z":"4cdd06f6.faf528","name":"","label":"Başlat/Durdur","tooltip":"","group":"843bc78a.c5b078","order":7,"width":5,"height":1,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-power_settings_new ","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"mi-power_settings_new ","offcolor":"black","x":560,"y":520,"wires":[["e116c5af.573e28","7791562c.bacb98","29119598.39809a","6e4f0412.b1ff3c","5880552a.38fb4c"]]},{"id":"6e4f0412.b1ff3c","type":"function","z":"4cdd06f6.faf528","name":"","func":"var b0 = msg.payload;\n\nif(b0 === false)\n{\n msg.payload = \"-\";\n}\nelse if(b0 === true)\n{\n msg.payload = null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":560,"wires":[["e1cb428a.02369"]]},{"id":"e1cb428a.02369","type":"ui_text","z":"4cdd06f6.faf528","group":"843bc78a.c5b078","order":12,"width":3,"height":1,"name":"","label":"Motor:","format":"{{msg.payload}}","layout":"row-center","x":850,"y":680,"wires":[]},{"id":"1f23bddb.087d42","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":760,"wires":[]},{"id":"8dd3e3e9.58d9a","type":"function","z":"4cdd06f6.faf528","name":"","func":"var m0 = msg.count;\n\nif(m0 > 1)\n{\n msg.payload = \"Normal\"\n}\nelse if(m0 <= 1)\n{\n msg.payload = \"Bozuk\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":680,"wires":[["e1cb428a.02369","1f23bddb.087d42"]]},{"id":"d5ebaf98.67cc4","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":760,"wires":[]},{"id":"5880552a.38fb4c","type":"timed-counter","z":"4cdd06f6.faf528","name":"","timelimit":"10","timeunit":"1000","withhold":true,"fixedtimeout":false,"pertopic":false,"x":300,"y":680,"wires":[["8dd3e3e9.58d9a","d5ebaf98.67cc4"]]},{"id":"d057eca6.64926","type":"rpi-gpio in","z":"4cdd06f6.faf528","name":"","pin":"37","intype":"tri","debounce":"25","read":false,"x":70,"y":680,"wires":[["5880552a.38fb4c"]]},{"id":"843bc78a.c5b078","type":"ui_group","z":"","name":"logo","tab":"43cae785.290cd8","order":3,"disp":false,"width":8,"collapse":false},{"id":"43cae785.290cd8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]