Hello all after long time I need some help, I think it should be basic.
My flow is I share below. Im greatfull for your helps.
I take some digital input from outside device, just port is on/off information.
1st question is : pin36 connected one output with relay. There is 2 situation, one of them 1 other is 0.
is it possible to take only 1 situation ? Becasuse I also write this 1/0 situation to database and just I need only 1 situation. For 0 situation I dont need and dont want to write to DB, please how can I do this ?
2nd question is : I use and write pin36 and pin37 situation to sqlite db and as I wrote above only getting data from SQL to any counter for visualizing (like dashboard).
Basically how many times pin triggered I want to show it with dahboard. 10-11-12.... etc times.
3rd question is : if pin36 situation 1 (active) after 40 second , how can I show notification on the screen ? If pin36 situation long time up this notification will appear on the screen. Turn the pin36 situation off will disapperar this notification.
Icreated this topic because I dont know too many javascript and other language coding.
Thanks for your helps and feedbacks.
[{"id":"50876597.46d69c","type":"dsm","z":"26872415.20b90c","name":"acil_stop_durumu","sm_config":"{\n \"triggerInput\": \"payload\",\n \"currentState\": \"running\",\n \"states\": {\n \"stopped\": {\n \"0\": \"running\"\n },\n \"running\": {\n \"1\": \"stopped\"\n }\n },\n \"methods\": {\n \"onBeforeTransition\": \"msg.pyload = msg.payload.toString();\",\n \"0\": \"sta.fill='green';msg.background='green';msg.label='AS';\",\n \"1\": \"sta.fill='red';msg.background='red';msg.label='AS';\"\n }\n}","x":340,"y":620,"wires":[["3bcc1a82.0e2246","d0b6abfe.f9fa28"]]},{"id":"c2c6e692.cd8708","type":"dsm","z":"26872415.20b90c","name":"kapi_durumu","sm_config":"{\n \"triggerInput\": \"payload\",\n \"currentState\": \"running\",\n \"states\": {\n \"stopped\": {\n \"0\": \"running\"\n },\n \"running\": {\n \"1\": \"stopped\"\n }\n },\n \"methods\": {\n \"onBeforeTransition\": \"msg.pyload = msg.payload.toString();\",\n \"1\": \"sta.fill='green';msg.background='green';msg.label='K';\",\n \"0\": \"sta.fill='red';msg.background='red';msg.label='K';\"\n }\n}","x":340,"y":80,"wires":[["b3d5b671.8c12e8","aa69a903.0626a8"]]},{"id":"b3d5b671.8c12e8","type":"ui_button","z":"26872415.20b90c","name":"","group":"776ed49f.0fbf3c","order":2,"width":"2","height":"2","passthru":false,"label":"{{msg.label}}","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"date","topic":"","x":470,"y":140,"wires":[[]]},{"id":"bf251d9c.adc69","type":"rpi-gpio in","z":"26872415.20b90c","name":"","pin":"38","intype":"down","debounce":"25","read":false,"x":140,"y":80,"wires":[["c2c6e692.cd8708"]]},{"id":"aa69a903.0626a8","type":"template","z":"26872415.20b90c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO 'kapi_durumu' ('durum','epoc') VALUES ({{payload}},{{pyload}});","output":"str","x":640,"y":120,"wires":[["1f75811c.593ccf"]]},{"id":"1f75811c.593ccf","type":"sqlite","z":"26872415.20b90c","mydb":"c61768f.c3efe98","sqlquery":"msg.topic","sql":"","name":"ip_cekili","x":880,"y":280,"wires":[["ab7742c2.6738c"]]},{"id":"3aa0c82d.5ab9f8","type":"dsm","z":"26872415.20b90c","name":"sensör_durumu","sm_config":"{\n \"triggerInput\": \"payload\",\n \"currentState\": \"running\",\n \"states\": {\n \"stopped\": {\n \"0\": \"running\"\n },\n \"running\": {\n \"1\": \"stopped\"\n }\n },\n \"methods\": {\n \"onBeforeTransition\": \"msg.pyload = msg.payload.toString();\",\n \"1\": \"sta.fill='green';msg.background='red';msg.label='S';\",\n \"0\": \"sta.fill='red';msg.background='green';msg.label='S';\"\n }\n}","x":330,"y":240,"wires":[["94e1b73c.283198","ef1f0537.b14e88"]]},{"id":"94e1b73c.283198","type":"ui_button","z":"26872415.20b90c","name":"","group":"776ed49f.0fbf3c","order":3,"width":"2","height":"2","passthru":false,"label":"{{msg.label}}","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"date","topic":"","x":430,"y":320,"wires":[[]]},{"id":"ef1f0537.b14e88","type":"template","z":"26872415.20b90c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO 'kapi_durumu' ('durum','epoc') VALUES ({{payload}},{{pyload}});","output":"str","x":620,"y":280,"wires":[["1f75811c.593ccf"]]},{"id":"d69afc75.9a51e","type":"rpi-gpio in","z":"26872415.20b90c","name":"","pin":"40","intype":"down","debounce":"25","read":false,"x":150,"y":260,"wires":[["3aa0c82d.5ab9f8"]]},{"id":"5e0c4d70.ebda64","type":"dsm","z":"26872415.20b90c","name":"Ip_durumu","sm_config":"{\n \"triggerInput\": \"payload\",\n \"currentState\": \"running\",\n \"states\": {\n \"stopped\": {\n \"0\": \"running\"\n },\n \"running\": {\n \"1\": \"stopped\"\n }\n },\n \"methods\": {\n \"onBeforeTransition\": \"msg.pyload = msg.payload.toString();\",\n \"1\": \"sta.fill='green';msg.background='green';msg.label='I';\",\n \"0\": \"sta.fill='red';msg.background='red';msg.label='I';\"\n }\n}","x":310,"y":420,"wires":[["5f756410.98c65c","dd6901d7.7957e"]]},{"id":"5f756410.98c65c","type":"ui_button","z":"26872415.20b90c","name":"","group":"776ed49f.0fbf3c","order":4,"width":"2","height":"2","passthru":false,"label":"{{msg.label}}","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"date","topic":"","x":490,"y":480,"wires":[[]]},{"id":"69b71ed2.32b6e","type":"rpi-gpio in","z":"26872415.20b90c","name":"","pin":"36","intype":"down","debounce":"25","read":false,"x":140,"y":420,"wires":[["5e0c4d70.ebda64"]]},{"id":"dd6901d7.7957e","type":"template","z":"26872415.20b90c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO 'ip_durumu' ('ip_durumu') VALUES ({{payload}});\n","output":"str","x":660,"y":420,"wires":[["1f75811c.593ccf"]]},{"id":"ab7742c2.6738c","type":"debug","z":"26872415.20b90c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1120,"y":280,"wires":[]},{"id":"3bcc1a82.0e2246","type":"ui_button","z":"26872415.20b90c","name":"","group":"776ed49f.0fbf3c","order":4,"width":"2","height":"2","passthru":false,"label":"{{msg.label}}","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"date","topic":"","x":490,"y":680,"wires":[[]]},{"id":"d0b6abfe.f9fa28","type":"template","z":"26872415.20b90c","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO 'sensor_durumu' ('sensor_durumu','epoc') VALUES ({{payload}},{{pyload}});","output":"str","x":660,"y":620,"wires":[["1f75811c.593ccf"]]},{"id":"513b3477.df45cc","type":"rpi-gpio in","z":"26872415.20b90c","name":"","pin":"37","intype":"down","debounce":"25","read":false,"x":150,"y":640,"wires":[["50876597.46d69c"]]},{"id":"776ed49f.0fbf3c","type":"ui_group","z":"","name":"Hol 7","tab":"21c61860.cde7e8","disp":true,"width":"6","collapse":false},{"id":"c61768f.c3efe98","type":"sqlitedb","z":"","db":"/var/www/html/database/kapi","mode":"RWC"},{"id":"21c61860.cde7e8","type":"ui_tab","z":"","name":"Mercedes-Benz Türk AŞ Kamyon Fabrikası Hol Kapıları","icon":"dashboard"}]