send Telegram notifications with pictures

DEADBEEF

n3wb
Joined
Apr 4, 2016
Messages
11
Reaction score
3
Are you definitely setting the parse_mode parameter?
I intended no criticism; was just genuinely curious if the macro might be expanding differently on your system.


I understand.
OTOH why settle for only one… when we can do both :p, just in case the cell signal is good.

Example…
Code:
https://api.telegram.org/bot{KEY}/sendphoto -F chat_id={ID} -F photo=@"D:\Blue Iris\Alerts\&ALERT_PATH" -F caption="[*&CAM*](&WAN/alerts/&ALERT_DB?fulljpeg)  [UI3](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) \- &MEMO" -F parse_mode=MarkdownV2
Indeed the possibilities are near endless. One thing I've been intending to add are a couple of 'snooze button' links that will tell BI to supress notifications for 15M, 1H, 3H etc. So eg. if I'm out in the workshop out of hours I can quickly tell BI to stop pinging me every few mins without having to log in and change anything manually. Will get around to it eventually.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,222
Reaction score
1,285
Location
SF Bay Area
One thing I've been intending to add are a couple of 'snooze button' links
You'll like it. I do something similar on my Android device where I use Tasker to intercept Blue Iris notifications. Note the "Hush" button.
1630021533343.png


You could prototype it pretty quickly by adding a 2nd caption to your Telegram alert that uses BI's HTTP interface command
&WAN/admin?camera=x&pause=n
 

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
Nice inspiration guys. I have a powershell script sending me a 10 second video of every clip to Telegram. Just sad that it is not viewable in a good way on my watch.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,222
Reaction score
1,285
Location
SF Bay Area
Just sad that it is not viewable in a good way on my watch.
The UI3 link would work if Telegram didn’t disable the hyperlinks in its Apple Watch app notifications. Check out this post…

If you tap the the Telegram notification on the Apple Watch you are given the option of opening it on your iPhone (where you can execute the link), but annoyingly the iPhone Telegram app must already be open and in the foreground.
 

VLITKOWSKI

Young grasshopper
Joined
May 9, 2019
Messages
75
Reaction score
7
Location
France
Nice..... I did this method and way easier. Just had to change the ALERT_PATH and what not since mines a little different, then removed the live.html link which is cool that you do that. I like this better than the script method because first and foremost this gives me the actual DeepStack alert image, the script method won't unless you modify it, that script method is setup to basically create another folder of alerts (again why duplicate when DeepStack already generating it) and then the script fires the image off that which doesn't have the DeepStack highlight. Definitely like this.

Now may play with it more, would love if it sent the higher res one, but then gotta completely change how DeepStack is working cause its working off the sub stream for me, so thats the image it gets.
I tried, but i've a http 400 error

-F photo=@F:\&ALERT_PATH
 

VLITKOWSKI

Young grasshopper
Joined
May 9, 2019
Messages
75
Reaction score
7
Location
France
Works for me and others. Make sure your botID has the entire thing with the API key separated by a :
Then make sure your chat ID starts with a -
my alerts are located on f:\
should i use photo=@F:\&ALERT_PATH or photo=&ALERT_PATH
what's difference with &ALERT_JPEG ?
 

Dixit

Getting the hang of it
Joined
Dec 14, 2015
Messages
75
Reaction score
36
This is how mine is and works fine. I suspect yours is getting the error cause you have "sendPhoto" vs "sendphoto". Some of these sites are case sensitive. Also you have to have the parse_mode to make that work properly as mentioned in this thread earlier.

Code:
https://api.telegram.org/bot123456789:APIKeywithrandomcharacters/sendphoto -F chat_id=-987654321 -F photo=@D:\BlueIris\Alerts\&ALERT_PATH -F caption="[*&NAME*](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) \- &MEMO" -F parse_mode=MarkdownV2
 

VLITKOWSKI

Young grasshopper
Joined
May 9, 2019
Messages
75
Reaction score
7
Location
France
This is how mine is and works fine. I suspect yours is getting the error cause you have "sendPhoto" vs "sendphoto". Some of these sites are case sensitive. Also you have to have the parse_mode to make that work properly as mentioned in this thread earlier.

Code:
https://api.telegram.org/bot123456789:APIKeywithrandomcharacters/sendphoto -F chat_id=-987654321 -F photo=@D:\BlueIris\Alerts\&ALERT_PATH -F caption="[*&NAME*](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) \- &MEMO" -F parse_mode=MarkdownV2
working well thanks
 

blazin912

Getting the hang of it
Joined
Sep 15, 2019
Messages
168
Reaction score
41
Location
MA
Guys I'm trying to get this kind of thing working but with sendVideo my thumbnails are totally corrupt. I had been using a different means with NodeRed and HomeAssistant previously but I was having issues with the video files still recording when trying to send the message, this leads to broken files in telegram so I'm hopeful to switch to CURL on the Blue iris machine directly.

Any ideas? I've tried adding a -F thumb=@/path/to/BI_Trigger.jpg to my command but that doesn't seem to show up in the message reply. Not sure what's going on..
 

blazin912

Getting the hang of it
Joined
Sep 15, 2019
Messages
168
Reaction score
41
Location
MA
@blazin912, did you Solveig it with thumbnail?
I did you and up checking the box to resize the jpgs that are exported and then realized the drop down is also a text field that can be edited to suit your aspect ratio and chosen size. I think this fixed the issue as telegram API says the thumb can't exceed a certain size.

Beyond that alert actions are still wildly inconsistent. I'll have alerts that don't trigger my batch..
 

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
@blazin912, Can you please share a printscreen? I guess you set it up on Record view? What resolution did you use? And was "-F thumb=@/path/to/BI_Trigger.jpg " what you used in your script?
 

Psylent126

n3wb
Joined
Aug 5, 2014
Messages
20
Reaction score
10
Location
California
I am wondering if anyone would have any ideas as to why the default Blue Iris macros would not work when running a program/script action. I am trying to set up telegram to send a picture using curl. If I remove the macros and hard code the picture location, the alert action will fire off to telegram and I receive the message. If I put the macros in (e.g., &ALERT_PATH, @Memo, etc.), the alert action fails. I have searched through the forum and search online, but I can't seem to find a reason why the macros would be failing to execute or be recognized.

Any insight that can be provided would be greatly appreciated.

Thanks.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,222
Reaction score
1,285
Location
SF Bay Area
I am wondering if anyone would have any ideas as to why the default Blue Iris macros would not work when running a program/script action. I am trying to set up telegram to send a picture using curl. If I remove the macros and hard code the picture location, the alert action will fire off to telegram and I receive the message. If I put the macros in (e.g., &ALERT_PATH, @Memo, etc.), the alert action fails. I have searched through the forum and search online, but I can't seem to find a reason why the macros would be failing to execute or be recognized.

Any insight that can be provided would be greatly appreciated.

Thanks.
If you mean the macros do not expand when running the script action from the Action Set dialog (via the lightning bolt icon), this is normal. See this post.

if you mean the macros are not expanding when the Blue Iris service executes the script, then maybe you are experienceing an issue similar to this one reported by another user (with Pushover).
 

mvernx

n3wb
Joined
Aug 1, 2018
Messages
4
Reaction score
0
Location
uk
I have this working well and it is quick, I setup a bot using botfather and curl directly from the alerts tab. I've used Telegram for a while just to view channels but new to all the groups and bot stuff. I'm definitely going to look at hosting my own bot soon as detailed. I have one thing I cant figure out though and that is when I add my wife's phone to the bot I created no messages are received on her telegram, have tried adding the bot to a group that she could then also join but non of the messages in the bot group appear in the group it is added to?

Is this even possible? I'm looking to move from pushover (via node red) as this is faster (although miss the custom sounds you can do per camera). I did look to make a bot for each camera so I can have a sound for each but then found botfather limits the bots you can create! basically looking for as similar functionality to pushover as possible but If my wife cant see the alerts then it is probably pointless to spend much more time on this. Any pointers appreciated
 
Top