Instantanea de cámara ip, mostrarla en dashboard, almacenarla en archivo y subirla a Telegram.

El flujo permite obtener una instantanea de una cámara ip (Vstarcam c7837wip), almacenarla en un archivo, mostrarla en el dashboard y enviarla a un chatbot de Telegram. En el nodo "ip_camara" deberá ingresarse la dirección de la cámara, nombre de usuario y clave. El nodo "nombre archivo" define el nombre del archivo, según la fecha, hora (Greenwich) y la dirección donde se almacena. En el nodo "chatId" deberá ingresarse el chatId del chatbot de Telegram que usemos para almacenar la foto.

[{"id":"ba45a42d.77cb18","type":"tab","label":"camara_ip_snapshot  ","disabled":false,"info":""},{"id":"c53d71e3.4eb9f","type":"telegram sender","z":"ba45a42d.77cb18","name":"","bot":"su chatbot","x":810,"y":300,"wires":[[]]},{"id":"372d0aa3.bbed76","type":"function","z":"ba45a42d.77cb18","name":"chatId","func":"msg.payload = { chatId : id de su chatbot , type : 'photo' , content : msg.payload }\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":300,"wires":[["c53d71e3.4eb9f"]]},{"id":"84d644ee.07b708","type":"base64","z":"ba45a42d.77cb18","name":"","action":"","property":"payload","x":620,"y":380,"wires":[["b9023016.394cd","10b93043.b5cc3"]]},{"id":"b9023016.394cd","type":"image","z":"ba45a42d.77cb18","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":false,"active":true,"x":800,"y":460,"wires":[]},{"id":"342e0214.c0a24e","type":"http request","z":"ba45a42d.77cb18","name":"","method":"GET","ret":"bin","paytoqs":false,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":450,"y":380,"wires":[["84d644ee.07b708","33630930.6027d6","372d0aa3.bbed76"]]},{"id":"90849c3b.c14ca","type":"inject","z":"ba45a42d.77cb18","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":380,"wires":[["d3f4b2e0.52f76"]]},{"id":"33630930.6027d6","type":"function","z":"ba45a42d.77cb18","name":"nombre archivo","func":"var str = (new Date).toISOString().slice(0,19).replace(/:/g,\"_\");\nmsg.filename = \"/media/pi/KINGSTON/Camaras/Palier/\" + str;\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":220,"wires":[["bda6c2ba.a46b5","eaa7f70a.00b8a8"]]},{"id":"d3f4b2e0.52f76","type":"function","z":"ba45a42d.77cb18","name":"ip_camara","func":"msg.url = \"http://ip camara/snapshot.cgi?user=su usuario&pwd=su clave\";\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":380,"wires":[["342e0214.c0a24e"]]},{"id":"bda6c2ba.a46b5","type":"debug","z":"ba45a42d.77cb18","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"filename","targetType":"msg","x":830,"y":140,"wires":[]},{"id":"eaa7f70a.00b8a8","type":"file","z":"ba45a42d.77cb18","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":850,"y":220,"wires":[[]]},{"id":"33d2d755.108cf8","type":"comment","z":"ba45a42d.77cb18","name":"snapshot camara VstartCam c7837wip","info":"","x":390,"y":520,"wires":[]},{"id":"10b93043.b5cc3","type":"ui_template","z":"ba45a42d.77cb18","group":"6b53f498.f3febc","name":"Display image","order":1,"width":12,"height":7,"format":"<img src=\"data:image/jpg;base64,{{msg.payload}}\" />\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":800,"y":380,"wires":[[]]},{"id":"97ad9f34.1acc1","type":"telegram bot","z":"","botname":"su chatbot","usernames":"","chatids":"","baseapiurl":"","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"","socksusername":"","sockspassword":"","bothost":"","localbotport":"","publicbotport":"","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"6b53f498.f3febc","type":"ui_group","z":"","name":"Camera","tab":"f622b930.41dfc8","disp":true,"width":12,"collapse":false},{"id":"f622b930.41dfc8","type":"ui_tab","z":"","name":"Snapshot","icon":"security","order":2,"disabled":false,"hidden":false}]

Flow Info

Created 4 years, 10 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x1)
  • file (x1)
  • function (x3)
  • http request (x1)
  • inject (x1)
Other

Tags

  • camara_ip
  • telegram
  • http_request
  • base64
  • function
  • file
  • template
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option