Help creating a snapshot foscam to Telegram using function node

Since yesterday I’m able to send notifications to Telegram.
Now I do like to send a snapshot from my Foscam IP camera to Telegram.
What do I need to do?

Do I need to change something in “my /config/configuration.yaml”
How does the function tile looks like?
Please advice

I did try the next:

where url in htp request is: http://my ip:86/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=myusername &pwd=mypassword
(This url is working in an other application outsite HA)

and function tile i don’t know what to put in:

Knipsel2

In the mean time i figured out that telegram knows “send_photo” but not url.
see:

and:

So my next question will be:

How to capture a picture from a Foscam IP cam and send photo to telegram?

Nobody a hint?

Dear Canedje,
There are two important unwritten rules of community forums:

  • RTFM: Read The F… Manual : that is make use of all available documentation that exists (google is your friend)
  • Try to do things by yourself and then ask question(s).

It seems you are fairly news to both HA and Node-Red, I appreciate it is a rather steep learning curve. I was there a few months ago.
I have the feeling (I imagined shared by others, but I might be wrong) that you ask questions first without much DIY. Over the last few days you have opened maybe 10 new subjects…
People are more likely to answer if you show first that you have really tried to do things by yourself.
My 2 cents.
GV

Hello,
Thanks for your answer.

Yes I’m new on HA and node-RED
I’m busy for 2 weeks now migrating from a Homey to HA with a Raspberry Pi 4.
Yes the learning curve is steep.
I did read more the last two weeks then I did ever before.

I did found out about 95% myself.
Also after first did a question over here, with no answers, the most of the time I did find the answers

My experience here is that the forum is not that active. (or maybe thats just a feeling, because i’m angius to go on fast).

Until now I’m happy about HA.
The only trouble I experience is that in some cases the Zwave is not that trustfull not reacting (I’m using a zwave.me dongle) After a Heal network it will work for a while.

I only have two wishes left to learn in the short term:
How to play a MP3 on my mediaplayer (TTS is working)
and capture a foscam picture and send to telegram.

I tried every search term I could imagine for about 4 days now, here at the forum and outsite just using Google, not finding the answers.

So Sorry to be enthousiastic.

I still didn’t succeed until now.
Can somebody point me in a direction where to find the necessary information?

And yes I do realise I did ask to much in a short period.
Apologize for that

I found out myself, by searching and trial erro method for about 3 weeks.
I’m happy

Can you please post your solution, and mark that as the solution in the thread?
That way it will help out future users with the same problems :slight_smile:

Thats like:

Where the URL in “IP garage achter” is: http:/myIP:MYport/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=myadmin&pwd=mypwd (thats the foscam url for catching a snapshot)
And return is: a binary buffer

MakeMSG is:

var snapshot = msg.payload;

msg.payload = {};
msg.payload.chatId = 123456789;
msg.payload.type = "photo";
msg.payload.content = snapshot;
return msg;
1 Like

great solution.
I am not new to Node-Red, but your post is the only clear instruction to create a binary buffer from a foscam camera snapshot.
I used it to send an email with:

so my functions contains:

msg.attachments ={
    filename: "garage.jpg",
    content: msg.payload
};
1 Like