[{"id":"ec14b414.04cf88","type":"ui_template","z":"8a2d0d88.b6502","group":"a47969bb.d61188","name":"WEBCAM","order":5,"width":"7","height":"7","format":"
\n\n
\n
\nSTREAMING","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":384,"y":539,"wires":[[]],"icon":"font-awesome/fa-video-camera"},{"id":"eb90b834.846208","type":"inject","z":"8a2d0d88.b6502","name":"Only Start","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":80,"wires":[["11fb454b.a6a40b"]]},{"id":"b6d76fd.088759","type":"http request","z":"8a2d0d88.b6502","name":"Capture immagine ","method":"GET","ret":"bin","paytoqs":false,"url":"http://192.168.1.61/capture","tls":"","proxy":"","authType":"basic","x":298,"y":205,"wires":[["686db6bc.1c8b18"]],"icon":"font-awesome/fa-video-camera"},{"id":"1bbc7106.d6d1cf","type":"file","z":"8a2d0d88.b6502","name":"Salva immagine catturata","filename":"","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":943,"y":232,"wires":[["a7b4cf0c.603b3"]]},{"id":"27afd99a.2e4486","type":"comment","z":"8a2d0d88.b6502","name":"Visualizza lo Streming della Webcam","info":"","x":155,"y":539,"wires":[]},{"id":"b1913afa.f19658","type":"comment","z":"8a2d0d88.b6502","name":"Cattura un immagine e la salva sul computer","info":"","x":221,"y":168,"wires":[]},{"id":"8665e2d5.facf8","type":"function","z":"8a2d0d88.b6502","name":"Impostazione dir + nome immagine","func":"// Prepara il MSG per creare il nome del file dell'immagine da salvare\n// impostando la dir e un nome univoco usando il 'timestamp'\n// passato con msg.stamp\nmsg={payload:msg.payload,filename:\"C:\\\\Users\\\\Batigolle\\\\.node-red\\\\pubblic\\\\webcam\\\\\"+ msg.stamp+\".jpg\",stamp:msg.stamp};\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":252,"wires":[["1bbc7106.d6d1cf","507f36cc.0eb8a8"]]},{"id":"a7b4cf0c.603b3","type":"debug","z":"8a2d0d88.b6502","name":"nome file","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":900,"y":304,"wires":[]},{"id":"686db6bc.1c8b18","type":"change","z":"8a2d0d88.b6502","name":"SET Timestamp","rules":[{"t":"set","p":"stamp","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":496,"y":205,"wires":[["8665e2d5.facf8"]]},{"id":"1fe860a9.9501df","type":"ui_button","z":"8a2d0d88.b6502","name":"","group":"bac2119e.01282","order":5,"width":"3","height":"1","passthru":false,"label":"Take Picture","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":89,"y":207,"wires":[["b6d76fd.088759"]]},{"id":"d84461ce.8537b","type":"comment","z":"8a2d0d88.b6502","name":"Latest image","info":"This template node has the HTML code to display\nthe latest image from the motion program.\n","x":841,"y":141,"wires":[]},{"id":"1d3991dd.c34a3e","type":"ui_template","z":"8a2d0d88.b6502","group":"a47969bb.d61188","name":"Last Image","order":2,"width":"7","height":"7","format":"\n\n
\nLAST IMAGE ","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":853,"y":180,"wires":[["aa37e23e.0ee01"]]},{"id":"507f36cc.0eb8a8","type":"delay","z":"8a2d0d88.b6502","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":704,"y":181,"wires":[["1d3991dd.c34a3e"]]},{"id":"aa37e23e.0ee01","type":"debug","z":"8a2d0d88.b6502","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":997,"y":179,"wires":[]},{"id":"703eb11b.7a5c7","type":"ui_button","z":"8a2d0d88.b6502","name":"","group":"bac2119e.01282","order":3,"width":"4","height":"1","passthru":false,"label":"Make GIF now","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":356,"y":615,"wires":[["974c82e0.66409"]]},{"id":"3b845890.907438","type":"configurable interval","z":"8a2d0d88.b6502","name":"configurable interval","interval":"3","onstart":false,"do_enable":false,"msg":"capture photo","showstatus":true,"unit":"seconds","statusformat":"YYYY-MM-D HH:mm:ss","x":596,"y":357,"wires":[["b3d6149a.130798","b6d76fd.088759"]]},{"id":"b3d6149a.130798","type":"debug","z":"8a2d0d88.b6502","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":911,"y":352,"wires":[]},{"id":"dc73b12.4a1ed5","type":"change","z":"8a2d0d88.b6502","name":"SetFlowInitial","rules":[{"t":"set","p":"dbgtimer","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"enabled","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":319,"y":870,"wires":[[]]},{"id":"d538426a.2cd21","type":"change","z":"8a2d0d88.b6502","name":"_18s","rules":[{"t":"set","p":"payload","pt":"msg","to":"interval","tot":"str"},{"t":"set","p":"interval_value","pt":"msg","to":"18","tot":"str"},{"t":"set","p":"interval_unit","pt":"msg","to":"seconds","tot":"str"},{"t":"set","p":"interval_activeInstantly","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"interval_fireInstantly","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":646,"y":875,"wires":[[]]},{"id":"2b0b1eaa.e337f2","type":"change","z":"8a2d0d88.b6502","name":"override_1.2s_insta","rules":[{"t":"set","p":"payload","pt":"msg","to":"interval","tot":"str"},{"t":"set","p":"interval_value","pt":"msg","to":"1150","tot":"str"},{"t":"set","p":"interval_unit","pt":"msg","to":"ms","tot":"str"},{"t":"set","p":"interval_activeInstantly","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"interval_fireInstantly","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":123,"y":873,"wires":[[]]},{"id":"9f82f083.255bd","type":"change","z":"8a2d0d88.b6502","name":"FIRE_set_3s","rules":[{"t":"set","p":"payload","pt":"msg","to":"interval","tot":"str"},{"t":"set","p":"interval_value","pt":"msg","to":"3","tot":"str"},{"t":"set","p":"interval_unit","pt":"msg","to":"s","tot":"str"},{"t":"set","p":"interval_activeInstantly","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"interval_fireInstantly","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":493,"y":868,"wires":[[]]},{"id":"de496221.372ed","type":"comment","z":"8a2d0d88.b6502","name":"esempi settaggio nodo \"configurable interval\"","info":"","x":190,"y":832,"wires":[]},{"id":"b965bbbe.7c7b18","type":"ui_template","z":"8a2d0d88.b6502","group":"40cf43ba.94a47c","name":"START / STOP TL","order":1,"width":"2","height":"1","format":" \n {{msg.payload == 'disabled' ? 'TL STOP' : 'RUNNING'}}\n ","storeOutMessages":true,"fwdInMessages":false,"templateScope":"local","x":142,"y":357,"wires":[["88b110dc.d1d35"]]},{"id":"177c29cb.db6526","type":"debug","z":"8a2d0d88.b6502","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":561,"y":428,"wires":[]},{"id":"88b110dc.d1d35","type":"function","z":"8a2d0d88.b6502","name":"Config Interval","func":"if ( msg.payload==\"enabled\" )\n{ // prima attivo il nodo \n node.send({payload:\"enabled\"}); \n // e poi gli passo i valori in modalità interval\n node.send({payload:\"interval\",interval_value:context.global.get('TL_Int'),\n interval_unit:context.global.get('TL_Unit'),\n interval_activeInstantly:\"true\" }); \n }\nelse\n{\n node.send({payload:\"disabled\"});\n \n}\nreturn null;","outputs":1,"noerr":0,"x":366,"y":357,"wires":[["3b845890.907438","177c29cb.db6526"]]},{"id":"24fe91b6.386d2e","type":"ui_text_input","z":"8a2d0d88.b6502","name":"Intervallo","label":"Intervallo","tooltip":"","group":"40cf43ba.94a47c","order":2,"width":"2","height":"1","passthru":true,"mode":"text","delay":300,"topic":"","x":523,"y":58,"wires":[["8345aa0b.aede38"]]},{"id":"2854f265.d0010e","type":"ui_dropdown","z":"8a2d0d88.b6502","name":"","label":"","tooltip":"","place":"Select option","group":"40cf43ba.94a47c","order":2,"width":"2","height":"1","passthru":true,"options":[{"label":"secondi","value":"s","type":"str"},{"label":"minuti","value":"m","type":"str"}],"payload":"","topic":"","x":523,"y":96,"wires":[["efa7dcd4.5696"]]},{"id":"b386bf6a.7ed98","type":"comment","z":"8a2d0d88.b6502","name":"Setup variabili globali all'avvio","info":"","x":155,"y":34,"wires":[]},{"id":"11fb454b.a6a40b","type":"function","z":"8a2d0d88.b6502","name":"Setup variabili G.","func":"// intervallo capture default 60\ncontext.global.set('TL_Int',\"60\");\nvar msg1={payload:\"60\"};\n\n// Tempo intervallo secondi / minuti\ncontext.global.set('TL_Unit',\"s\");\nvar msg2={payload:\"s\"};\n\nreturn [msg1,msg2];","outputs":2,"noerr":0,"x":319,"y":80,"wires":[["24fe91b6.386d2e"],["2854f265.d0010e"]]},{"id":"8345aa0b.aede38","type":"function","z":"8a2d0d88.b6502","name":"Salva valore interval","func":"context.global.set('TL_Int',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":717,"y":58,"wires":[[]]},{"id":"efa7dcd4.5696","type":"function","z":"8a2d0d88.b6502","name":"Salva valore Unit Interval","func":"context.global.set('TL_Unit',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":727,"y":96,"wires":[[]]},{"id":"79c86e78.cc8b4","type":"inject","z":"8a2d0d88.b6502","name":"","topic":"","payload":"disabled","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":127,"y":407,"wires":[["b965bbbe.7c7b18"]]},{"id":"d085a78c.e58838","type":"comment","z":"8a2d0d88.b6502","name":"Salva variabili modificate","info":"","x":728,"y":24,"wires":[]},{"id":"7b79424f.c3f25c","type":"comment","z":"8a2d0d88.b6502","name":"Creare video da TimeLaps","info":"","x":123,"y":617,"wires":[]},{"id":"974c82e0.66409","type":"exec","z":"8a2d0d88.b6502","command":"/home/pi/.node-red/make-gif.bat","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Make gif","x":570,"y":616,"wires":[[],[],[]]},{"id":"a47969bb.d61188","type":"ui_group","z":"","name":"Group 1","tab":"8dce25e7.1af198","order":1,"disp":false,"width":"15","collapse":false},{"id":"bac2119e.01282","type":"ui_group","name":"Group 2","tab":"8dce25e7.1af198","order":2,"disp":true,"width":6},{"id":"40cf43ba.94a47c","type":"ui_group","z":"","name":"TimeLaps","tab":"8dce25e7.1af198","order":3,"disp":true,"width":"2","collapse":false},{"id":"8dce25e7.1af198","type":"ui_tab","z":"","name":"Webcam","icon":"dashboard","order":1,"disabled":false,"hidden":false}]