As I am more and more comfortable with this wonderful integration, I have tuned a Node-Red Flow to triggering video capture and sending it through Telegram (I have been seduced by Node-Red and I am reluctant to the HA automations way everytime I try).
Video is downloaded with a filename including date and hour then sent through Telegram with the excellent node-red-contrib-chatbot nodes.
The good news is that the lookback option in the video recording is able to catch the first 1 to 3 sec (or more ? I put 15 sec lookback in case!) that miss if you don’t activate it. As such, the start of recording is less than 1 sec after of the trigerring motion.
It may be simplified ; I cannot tell as I just finished the tuning yesterday night.
Tested with yesterday v5.0.1, with a battery camera without Ring Protect Plan, and with the corresponding door sensor for triggering.
[
{
"id": "30c33f8ce5a0630a",
"type": "tab",
"label": "Ring",
"disabled": false,
"info": "",
"env": []
},
{
"id": "93abe672cd8a3d7b",
"type": "moment",
"z": "30c33f8ce5a0630a",
"name": "",
"topic": "",
"input": "",
"inputType": "date",
"inTz": "Europe/Paris",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "[/media/Ring/node-red-shot_(]YYYY-MM-DD_kk.mm.ss[)]",
"locale": "fr_fr",
"output": "filebase",
"outputType": "msg",
"outTz": "Europe/Paris",
"x": 140,
"y": 300,
"wires": [
[
"07033e958eac3740"
]
]
},
{
"id": "07033e958eac3740",
"type": "api-call-service",
"z": "30c33f8ce5a0630a",
"name": "",
"server": "eb612605.cd9cc8",
"version": 5,
"debugenabled": false,
"domain": "camera",
"service": "record",
"areaId": [],
"deviceId": [],
"entityId": [
"camera.portier_live"
],
"data": "{\t \"filename\": msg.filebase & \".mp4\",\t \"duration\": 25,\t \"lookback\" : 15\t}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "data"
}
],
"queue": "all",
"x": 400,
"y": 300,
"wires": [
[
"75af2bad98f0227b"
]
]
},
{
"id": "723b2be5d9208670",
"type": "server-state-changed",
"z": "30c33f8ce5a0630a",
"name": "Motion",
"server": "eb612605.cd9cc8",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "binary_sensor.porte_principale",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 90,
"y": 220,
"wires": [
[
"be980d7baa0052e7"
],
[]
]
},
{
"id": "be980d7baa0052e7",
"type": "api-call-service",
"z": "30c33f8ce5a0630a",
"name": "",
"server": "eb612605.cd9cc8",
"version": 5,
"debugenabled": false,
"domain": "switch",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"switch.portier_stream"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "all",
"x": 300,
"y": 220,
"wires": [
[
"b0bf5a56a730161c"
]
]
},
{
"id": "b0bf5a56a730161c",
"type": "delay",
"z": "30c33f8ce5a0630a",
"name": "Tempo 1 s",
"pauseType": "delay",
"timeout": "1000",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 530,
"y": 220,
"wires": [
[
"93abe672cd8a3d7b"
]
]
},
{
"id": "75af2bad98f0227b",
"type": "delay",
"z": "30c33f8ce5a0630a",
"name": "Tempo 30 s",
"pauseType": "delay",
"timeout": "30000",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 630,
"y": 300,
"wires": [
[
"ab4d4e980d7621d1"
]
]
},
{
"id": "316466db9c1a1581",
"type": "chatbot-video",
"z": "30c33f8ce5a0630a",
"name": "",
"filename": "",
"video": "/media/Ring/node-red-shot_xxxx.mp4",
"caption": "",
"x": 510,
"y": 380,
"wires": [
[
"2336dbdc20213a20"
]
]
},
{
"id": "0704bcf1c39805be",
"type": "chatbot-conversation",
"z": "30c33f8ce5a0630a",
"name": "Chez nous",
"botDevelopment": "xxxx",
"botProduction": "",
"chatId": "xxxx",
"userId": "",
"transport": "telegram",
"store": "",
"x": 310,
"y": 380,
"wires": [
[
"316466db9c1a1581"
]
]
},
{
"id": "ab4d4e980d7621d1",
"type": "function",
"z": "30c33f8ce5a0630a",
"name": "",
"func": "msg.video = msg.filebase + '.mp4';\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 100,
"y": 380,
"wires": [
[
"0704bcf1c39805be"
]
]
},
{
"id": "2336dbdc20213a20",
"type": "chatbot-telegram-send",
"z": "30c33f8ce5a0630a",
"bot": "12565dff063d0a75",
"botProduction": "",
"track": false,
"passThrough": false,
"errorOutput": true,
"outputs": 1,
"x": 730,
"y": 380,
"wires": [
[]
]
},
{
"id": "eb612605.cd9cc8",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30
},
{
"id": "12565dff063d0a75",
"type": "chatbot-telegram-node",
"botname": "xxxx",
"usernames": "xxxx",
"polling": "1000",
"store": "",
"log": "/config/www/logs/xxxx_logs",
"debug": true,
"skipMediaFiles": false,
"webHook": "",
"connectMode": "polling"
}
]