MQTT Camera for Node-RED

I wanted to added something - but I am unable to edit the post above.

This example used a webhook in Node-RED to trigger a flow that keeps the video recording running as long as there is movement detected in front of your camera.

You can of course replace the webhook with the MQTT alarm server topic status/alarm/triggered:

Untitled

The first flow starts a video recording and keeps it running for the time that your camera keeps triggering alert. And the second flow moves your camera into an alarm position and makes sure that it stays there until the alert is over.

[{"id":"97187d7.8e4048","type":"change","z":"f915c95a.f48d08","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"val\":\"off\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":382,"y":81,"wires":[["c75f7959.e8ed88"]]},{"id":"6152fa88.5894a4","type":"change","z":"f915c95a.f48d08","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"val\":\"60\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":209,"y":35,"wires":[["7d20b73f.057588"]]},{"id":"c75f7959.e8ed88","type":"mqtt out","z":"f915c95a.f48d08","name":"/features/manualrec/stop","topic":"instar/local/features/manualrec/stop","qos":"1","retain":"false","broker":"6f1cf632.979988","x":558,"y":81,"wires":[]},{"id":"7d20b73f.057588","type":"mqtt out","z":"f915c95a.f48d08","name":"features/manualrec/start","topic":"instar/local/features/manualrec/start","qos":"1","retain":"false","broker":"6f1cf632.979988","x":389,"y":35,"wires":[]},{"id":"3c45400c.9263","type":"stoptimer2","z":"f915c95a.f48d08","duration":"5","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":235,"y":87,"wires":[["97187d7.8e4048"],[]]},{"id":"36b16289.f7ecce","type":"mqtt in","z":"f915c95a.f48d08","name":"Alarm Server","topic":"instar/local/status/alarm/triggered","qos":"1","datatype":"auto","broker":"6f1cf632.979988","x":75,"y":57,"wires":[["6152fa88.5894a4","3c45400c.9263"]]},{"id":"ffc691d5.f9282","type":"change","z":"f915c95a.f48d08","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"val\":\"0\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":388,"y":213,"wires":[["7ed79cc0.a20144"]]},{"id":"a8077a3e.5ba3f8","type":"change","z":"f915c95a.f48d08","name":"On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"val\":\"1\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":217,"y":169,"wires":[["7ed79cc0.a20144"]]},{"id":"7ed79cc0.a20144","type":"mqtt out","z":"f915c95a.f48d08","name":"features/ptz/preset","topic":"instar/local/features/ptz/preset","qos":"1","retain":"false","broker":"6f1cf632.979988","x":393,"y":169,"wires":[]},{"id":"829ee295.90a02","type":"stoptimer2","z":"f915c95a.f48d08","duration":"5","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":241,"y":219,"wires":[["ffc691d5.f9282"],[]]},{"id":"27b53bb8.d0c284","type":"mqtt in","z":"f915c95a.f48d08","name":"Alarm Server","topic":"instar/local/status/alarm/triggered","qos":"1","datatype":"auto","broker":"6f1cf632.979988","x":80,"y":184,"wires":[["a8077a3e.5ba3f8","829ee295.90a02"]]},{"id":"6f1cf632.979988","type":"mqtt-broker","z":"","name":"IN-8015FHD White","broker":"192.168.2.117","port":"8883","tls":"56befee0.6df6c","clientid":"","usetls":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"56befee0.6df6c","type":"tls-config","z":"","name":"pcert.pem","cert":"","key":"","ca":"","certname":"pcert.pem","keyname":"","caname":"","servername":"","verifyservercert":true}]