I want to send any new photos captured from motion capture by the IP camera (which gets stored in a Pictures folder) to the telegram bot. Tried to fiddle around with various nodes but couldn't figure it out. I cant seem to understand how to get it to work.
My main idea is to watch the folder for any new files and on detection of any file, the same to be sent to a Telegram bot.
Sorry i forgot to mention. I'm on windows for now. Just trying out the flow then i will migrate the same flow to Raspberry pi on which the camera is attached.
Currently on windows the folder im working with is on the desktop which i have access to. Later i will just change it to the HDD connected to the Pi.
If you haven't tried that yet, In Node-RED you have "storage" nodes you can start with. Like the example below. Check what you get when the camera adds a new image to the folder. If you get the image data, next step can be to view it and then after that, send it to telegram
I was able to get a file name in the debug by running the below flow. Flow1
Adding the read file node gives an error
msg : string[21]
"No filename specified"
I read in some other post that the value of "filename" is to be kept blank as it takes it automatically from the change node. If it is to be added, i cant figure out a dynamic string to be used as the filename will keep on changing. Maybe i need to put in some code in the change node?
Yes correct. I am using the "node-red-contrib-telegrambot" nodes so you should install them first, use the pallet manager
When you read the file, you shall configure it to provide "a single Buffer output". If you want to check that the image is correctly read, you can use "node-red-contrib-image-tools"
The function node in my example is setting up the message that is sent to the Telegram node. Here you have to configure your chat Id
Thank you i got it working on windows. Next step is to transfer it to the Pi.
Btw using this post i got it to send a specific photo on demand. hope to play around with it and get screenshots on demand