Hello everybody.
I have done my flow here with helps.
I need to take db actions, showing with date and time picker. Im storing data in to the db and just want to see this data (example : Pin high status) .
Thanks for your helps
How can I take data using data and time picker with daily ?
And here is my flow
[{"id":"5bbd4ef.26768b","type":"subflow","name":"Subflow 1 (2)","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"b68edc19.b03f5"}]}],"out":[{"x":920,"y":100,"wires":[{"id":"d55f04d4.71f788","port":0}]},{"x":540,"y":120,"wires":[{"id":"e7edf8b0.2f0a68","port":0}]}]},{"id":"b68edc19.b03f5","type":"function","z":"5bbd4ef.26768b","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":80,"wires":[["e7edf8b0.2f0a68","968076b.1b0e988"]]},{"id":"968076b.1b0e988","type":"switch","z":"5bbd4ef.26768b","name":"allow only 1 ","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":80,"wires":[["a4875894.611908"],["1bfba8b2.065667"]]},{"id":"e7edf8b0.2f0a68","type":"trigger","z":"5bbd4ef.26768b","op1":"","op2":"Kapı 30 saniyedir aƧık!!","op1type":"nul","op2type":"str","duration":"30","extend":false,"units":"s","reset":"1","bytopic":"all","name":"","x":390,"y":120,"wires":[[]]},{"id":"a4875894.611908","type":"change","z":"5bbd4ef.26768b","name":"High","rules":[{"t":"set","p":"bc","pt":"msg","to":"orange","tot":"str"},{"t":"set","p":"status","pt":"msg","to":"High","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":80,"wires":[["d55f04d4.71f788"]]},{"id":"1bfba8b2.065667","type":"change","z":"5bbd4ef.26768b","name":"Low","rules":[{"t":"set","p":"bc","pt":"msg","to":"purple","tot":"str"},{"t":"set","p":"status","pt":"msg","to":"Low","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":120,"wires":[["d55f04d4.71f788"]]},{"id":"d55f04d4.71f788","type":"function","z":"5bbd4ef.26768b","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":100,"wires":[[]]},{"id":"5d4c11c1.9af9a","type":"subflow:5bbd4ef.26768b","z":"af9b4ff8.78eea","name":"Pin Status Monitoring","x":190,"y":220,"wires":[["173f6245.20c12e","6cb5364e.200ca8"],["5c665a50.7c00d4"]]},{"id":"173f6245.20c12e","type":"ui_button","z":"af9b4ff8.78eea","name":"","group":"c55d32a2.85a79","order":9,"width":"6","height":"2","passthru":false,"label":"B5 Gate - 1 {{msg.status}}","color":"","bgcolor":"{{bc}}","icon":"","payload":"1","payloadType":"num","topic":"topic","x":280,"y":260,"wires":[[]]},{"id":"6cb5364e.200ca8","type":"switch","z":"af9b4ff8.78eea","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":310,"y":160,"wires":[["2b2539eb.875a76"],["11ed0772.92c5c9"]]},{"id":"5c665a50.7c00d4","type":"ui_toast","z":"af9b4ff8.78eea","position":"dialog","displayTime":"","highlight":"","outputs":1,"ok":"OK","cancel":"","topic":"Uyarı","name":"","x":240,"y":300,"wires":[[]]},{"id":"2b2539eb.875a76","type":"change","z":"af9b4ff8.78eea","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"ontime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":140,"wires":[["852ddb80.46c328"]]},{"id":"11ed0772.92c5c9","type":"change","z":"af9b4ff8.78eea","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"offtime","tot":"str"},{"t":"set","p":"complete","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":180,"wires":[["852ddb80.46c328"]]},{"id":"852ddb80.46c328","type":"join","z":"af9b4ff8.78eea","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":640,"y":160,"wires":[["1ec31f14.e84f91"]]},{"id":"1ec31f14.e84f91","type":"function","z":"af9b4ff8.78eea","name":"","func":"msg.times = msg.payload\nmsg.times.date = new Date().toISOString().split(\"T\")[0];\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":220,"wires":[["2fc07d69.2e2962"]]},{"id":"2fc07d69.2e2962","type":"template","z":"af9b4ff8.78eea","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT\n sum(duration) AS total\nFROM\n sensor_durumu\nWHERE\n date = '{{times.date}}'\nUNION\nSELECT\n sum(duration) AS full_total\nFROM\n sensor_durumu\n","output":"str","x":480,"y":260,"wires":[["3a0531de.5aa56e"]]},{"id":"3c081f34.24038","type":"function","z":"af9b4ff8.78eea","name":"","func":"//msg.total = msg.payload[0].total;\n//msg.full_total = msg.payload[0].full_total;\n//msg.payload = (msg.times.offtime - msg.times.ontime)/1000;\n//msg.total += msg.payload;\n//msg.full_total += msg.payload;\n//msg.title = \"Pin High Status \" + msg.times.date + \" Total : \" + msg.total +\n// \"<br> Full Total : \" + msg.full_total;\n//msg.topic = \"Pin high (sn)\";\n//return msg;\n\n\n\n\n\nmsg.total = msg.payload[0].total;\nmsg.full_total = msg.payload[1].total;\nmsg.payload = (msg.times.offtime - msg.times.ontime)/1000;\nmsg.total += msg.payload;\nmsg.full_total += msg.payload;\nmsg.title = \"Pin High Status \" + msg.times.date + \" Total : \" + msg.total +\n \"<br> Full Total : \" + msg.full_total;\nmsg.topic = \"Pin high (sn)\";\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":300,"wires":[["cdd056e3.559718","5317643d.ca492c","d994b88e.cdf588"]]},{"id":"8049a46c.f36088","type":"debug","z":"af9b4ff8.78eea","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":720,"y":260,"wires":[]},{"id":"cdd056e3.559718","type":"debug","z":"af9b4ff8.78eea","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":880,"y":180,"wires":[]},{"id":"5317643d.ca492c","type":"ui_text","z":"af9b4ff8.78eea","group":"c55d32a2.85a79","order":0,"width":"6","height":"2","name":"","label":"{{msg.title}}","format":"","layout":"row-spread","x":970,"y":260,"wires":[]},{"id":"d994b88e.cdf588","type":"template","z":"af9b4ff8.78eea","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO sensor_durumu (date, ontime, offtime , duration ) VALUES ('{{times.date}}', {{times.ontime}}, {{times.offtime}}, {{payload}});","output":"str","x":930,"y":360,"wires":[["139c1f1b.ca6d71","53d507d7.5bab88"]]},{"id":"139c1f1b.ca6d71","type":"debug","z":"af9b4ff8.78eea","name":"store in db","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1130,"y":440,"wires":[]},{"id":"3a0531de.5aa56e","type":"sqlite","z":"af9b4ff8.78eea","mydb":"e35ee04b.a8bff","sqlquery":"msg.topic","sql":"","name":"db","x":590,"y":300,"wires":[["3c081f34.24038","8049a46c.f36088"]]},{"id":"53d507d7.5bab88","type":"sqlite","z":"af9b4ff8.78eea","mydb":"e35ee04b.a8bff","sqlquery":"msg.topic","sql":"","name":"db","x":1200,"y":360,"wires":[["3c2eacd.b27fd54"]]},{"id":"e7660215.f0237","type":"rpi-gpio in","z":"af9b4ff8.78eea","name":"","pin":"40","intype":"down","debounce":"25","read":false,"x":90,"y":140,"wires":[["5d4c11c1.9af9a"]]},{"id":"3c2eacd.b27fd54","type":"debug","z":"af9b4ff8.78eea","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1260,"y":260,"wires":[]},{"id":"c55d32a2.85a79","type":"ui_group","z":"","name":"Orginal","tab":"4ad3d549.6d056c","order":9,"disp":true,"width":"6","collapse":false},{"id":"e35ee04b.a8bff","type":"sqlitedb","z":"","db":"/var/www/html/database/kapi","mode":"RWC"},{"id":"4ad3d549.6d056c","type":"ui_tab","z":"","name":"Deneme","icon":"dashboard"}]