5sec video from Camera to Telegram - Node Red

Hello smart guys,
on my previous system (competitor) I used to have a great automation:

When someone push the ring button, my ONVIF camera recorded 5s video and it was sent to me through Telegram.
I love to use the Node Red.

These are the steps:

  • Pressing the button (easy)
  • recording a 5sec video and probably saving it temporarily somewhere to disk
  • sending the video through Telegram (My telegram messages are already working)

What NR nodes should I use to:

  • recording and saving the video
  • Sending the video through Telegram

thank you,
Michal, Slovakia

Anyone who can do it without node red?

The problem here is that it’s hard to record that short of a period. For whatever reason even if you tell it to record a second it records 10 or 11 seconds. This may be my cameras idk. You will have to try and see what is the min time you can record.

[{"id":"81f1b61b3b71bd5a","type":"api-call-service","z":"0a325c35fc29f44e","name":"","server":"6b1110b5.183a4","version":7,"debugenabled":false,"action":"camera.record","floorId":[],"areaId":[],"deviceId":[],"entityId":["camera.xvr_mailbox_main"],"labelId":[],"data":"{\t    \"filename\":\"/media/snapshot_test.mp4\",\t    \"duration\": 2   \t    }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"camera","service":"record","x":620,"y":1720,"wires":[[]]},{"id":"3a2112e7ce4bd431","type":"inject","z":"0a325c35fc29f44e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":1720,"wires":[["81f1b61b3b71bd5a"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Thanks for reply,
I have this on my previous system - OpenHAB. I have done it with two rules:

rule "terasa.zvoncek-mp4-telegram.mp4"
when
    Channel "mihome:sensor_switch:286c0785f092:158d000129909b:button" triggered SHORT_PRESSED
then
    //Start creating the MP4
    getActions("ipcamera", "ipcamera:onvif:34aaa0d217").recordMP4("ipcamera",5)
end
rule "terasa.zvoncek-mp4-telegram.telegram"
when
    Item Doorbell_recordingMP4 changed to 0
then
    logInfo("terasa.zvoncek-mp4-telegram.telegram", "posielam 5s video")
    val telegramAction = getActions("telegram","telegram:telegramBot:e13f59dd1f")
    telegramAction.sendTelegramAnimation("file:///etc/openhab/html/camera1/ipcamera.mp4", "Niekto zvoní na terase")
end

It was very useful, so I am looking for something similar now in HA. I bet it can be done somehow. I will try to analyze your code, but I am lost in my work now. Is it possible to transform the command to Node Red?

Thank you,
Michal