Record a video with timestamp and send it via telegram after finished

Hi there,

I am trying to record a video with timestamp calling to Home Assistant service:

{"filename":"/config/www/cam1_records/{{entity_id.name}}_{{now().strftime('%Y%m%d-%H%M%S')}}.mp4"}

That's ok, no problem, video is created and stored. The problem comes when I want to send that video to Telegram. I couldn't manage to find a way to send the video because I fail to find a method to send the name of the video file accordingly because the name change with time. I have to wait 35s to finish the video recording.

I tried to send data field to the telegram node (output) but it sent in the same format as I put in the record call service so I suposse that when the telegram node generate the name of the file, as time as changed, it is not going to find the file.

I tried with fixed name and it works perfect so I suposse I need to find a way to send the final file name to the telegram node to work.

I want to keep the timestamp for data storage purposes.

Any idea? Not very skilled with node red.

Thank you!

Create the filename first in the flow before you send it to the HA node. Then you can send that same name to the Telegram node.

Ok Colin, done. Thank you for your advice!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.