Camera Alert with tinyCam and SIGNL4

This flow sends an alert with an image of a surveillance camera if a motion has been detected.

Camera

As camera we just use an Android phone and the tinyCam Pro app. This one can detect motion and also provides an API for accessing the video stream or current image.

Alerting App

For alerting we use the app-based alerting service SIGNL4. The app receives the alert along with the image and a link to the video stream.

Node-RED Flow

The Node-RED flow waits for the webhook request indicating that the camera has detected some motion. Then the HTTP request downloads the current image. The JavaScript function assembles the alert data and also converts the binary image data into a base64 string.

Flow

The flow can be adapted easily to support other cameras as well.

[{"id":"ddecbc9e.f31ab","type":"tab","label":"SIGNL4 Camera Alert","disabled":false,"info":"This flow sends an alert with an image of a surveillance camera if a motion has been detected.\r\n\r\n## Camera\r\nAs camera we just use an Android phone and the [tinyCam Pro](https://play.google.com/store/apps/details?id=com.alexvas.dvr.pro) app. This one can detect motion and also provides an API for accessing the video stream or current image.\r\n\r\n## Alerting App\r\nFor alerting we use the app-based alerting service [SIGNL4](https://www.signl4.com). The app receives the alert along with the image and a link to the video stream.\r\n\r\n## Node-RED Flow\r\nThe Node-RED flow waits for the webhook request indicating that the camera has detected some motion. Then the HTTP request downloads the current image. The JavaScript function assembles the alert data and also converts the binary image data into a base64 string.\r\n\r\nThe flow can be adapted easily to support other cameras as well.\r\n"},{"id":"64c6ac2d.225464","type":"function","z":"ddecbc9e.f31ab","name":"","func":"\nlet base64Data = msg.payload.toString('base64');\n\nvar data = {\n    \"attachmentBase64Content1\": base64Data,\n    \"attachmentMimeType1\": \"image/jpeg\",\n    \"X-S4-Location\": \"52.399442,13.0583737\",\n    \"Subject\": \"Camera Alert\",\n    \"Body\": \"Intruder detected.\",\n    \"LiveStream\": \"http://192.168.2.103:8083/live\"\n};\n\nmsg.payload = data;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":180,"wires":[["29e0cf02.12d9c"]]},{"id":"60ef8e95.a1b29","type":"http in","z":"ddecbc9e.f31ab","name":"Webhook","url":"/webhook","method":"get","upload":false,"swaggerDoc":"","x":140,"y":280,"wires":[["ae7fe2fb.52c0f","8798e579.638418"]]},{"id":"ae7fe2fb.52c0f","type":"http response","z":"ddecbc9e.f31ab","name":"","statusCode":"200","headers":{},"x":280,"y":340,"wires":[]},{"id":"7e2719e5.19a388","type":"inject","z":"ddecbc9e.f31ab","name":"Manual Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":180,"wires":[["8798e579.638418"]]},{"id":"29e0cf02.12d9c","type":"SIGNL4","z":"ddecbc9e.f31ab","name":"SIGNL4 Alerting","teamSecret":"********","alertSubject":"","alertBody":"","alertS4Service":"","alertS4Location":"","alertS4AlertingScenario":"single_ack","alertS4Filtering":"false","alertS4ExternalID":"","x":740,"y":240,"wires":[[]]},{"id":"8798e579.638418","type":"http request","z":"ddecbc9e.f31ab","name":"Get Image","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://192.168.2.103:8083/axis-cgi/jpg/image.cgi","tls":"","persist":false,"proxy":"","authType":"basic","x":410,"y":240,"wires":[["64c6ac2d.225464"]]}]

Flow Info

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

Owner

Actions

Rate:

Node Types

Core
  • function (x1)
  • http in (x1)
  • http request (x1)
  • http response (x1)
  • inject (x1)
Other

Tags

  • alert
  • camera
  • surveillance
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option