Send Pushover notifications with pictures and hyperlinks

I setup this yesterday and thought I was done as it was working fine but, for some reason, I'm not getting Pushover alerts anymore even though they were working fine for a day.

Here is the command I'm using for the alert:
Code:
https://api.pushover.net/1/messages.json -s --form-string "token=secret" --form-string "user=secret" --form-string "message=<b>&CAM</b> &MEMO <a href='&LAN/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='&LAN/ui3.htm?rec=&ALERT_DB'>UI3</a>" --form-string "html=1" -F "attachment=@C:\BlueIris\Alerts\&ALERT_PATH"

I can manually run that curl command from the cmd line (inserting an actual file name for the attachment) and it works fine. I get the pushover to my phone. However, BI isn't sending me the pushoveron a trigger.

I'm a bit stumped on this one. I've even deleted the camera and added it back. Not exactly sure what is going on here. If I hit the test button from the alert area nothing comes from BI. If I manually trigger the alert from within BI, I still don't get any pushover notifications.
 

Attachments

  • bi4.png
    bi4.png
    19.9 KB · Views: 197
Last edited:
Ok as an update, I got pushover working via BI now with this command in the Trigger -> Immediate Actions -> Run a Program :
Code:
https://api.pushover.net/1/messages.json -s --form-string "token=secret" --form-string "user=secret" --form-string "message=<b>&CAM</b> &MEMO <a href='&LAN/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='&LAN/ui3.htm?rec=&ALERT_DB'>UI3</a>" --form-string "html=1"

However, if I add -F "attachment=@C:\BlueIris\Alerts\&ALERT_PATH" to the end of that command, I get nothing at all. I have Hi-Res Jpg files activated. I've also made sure that C:\BlueIris\Alerts\ is the proper path to the alert directory.

??

Edit: Well after about 3 hours of time I finally figured this bastard out. In the record tab of my camera I had changed the folder structure of how recordings are written with the various macros that are available in the BI manual. By design, that also changes the folder structure of how alerts are saved. So even though I thought I had the correct path to alerts listed in the curl command, it wasn't actually correct because of the changes I made in the record tab. I changed it back to default. Glad that nightmare is over.
 
Last edited:
I've added an EDIT to the end of post #1.

It's in the section "How to store and use your pushover credentials in Blue Iris numbered macros".

3. EDIT (9/29/22) Another reason you may want to change your credentials in the future is that Pushover lets you create multiple applications. For example, you could create applications like 'Blue Iris Tools', 'Blue Iris Actions', 'PowerShell', and 'OpenHAB' to separately track notifications from each source. A neat benefit of this is that you can view stats for each application; furthermore, each Application has its own 10,000 notifications quota! <link>
 
Last edited:
Edit: Well after about 3 hours of time I finally figured this bastard out. In the record tab of my camera I had changed the folder structure of how recordings are written with various macros. That also pertains to how alerts were stored so it didn't have the correct path to find the alert files. I changed it back to default. Glad that nightmare is over.
Good catch!

I've added an EDIT to the Attachment argument section in Syntax Guide in post #1.
Hopefully this might help future new users avoid rediscovering this issue.
 
Last edited:
Glad my stupidity could contribute!

Your post here: Need help setting up BI5 text alerts. is what saved me. Once I could actually see the full path/filename in a text file that BI was attempting to send to pushover, it made me remember I had modified the folder structure earlier for that camera.

One could still keep the modified folder structure so long as the appropriate macros were also input in the curl command. I'll probably tackle that next so I can go back to my modified folder structure. Anyway, thanks for this! Sure is great to get pushover notifications!
 
One could still keep the modified folder structure so long as the appropriate macros were also input in the curl command. I'll probably tackle that next so I can go back to my modified folder structure. Anyway, thanks for this! Sure is great to get pushover notifications!
As an alternative, BI Support might be willing to create a new macro, say &ALERT_PATH2, that reflects the mods on the record tab.
Perhaps used something like this? -F "attachment=@C:\BlueIris\Alerts\&ALERT_PATH2" .

I've found Ken to be receptive to creating useful macros.

Just curious... with your original setup are the alert images still stored in the Alerts folder, but now under camera subfolders?
 
Just curious... with your original setup are the alert images still stored in the Alerts folder, but now under camera subfolders?

Yes, alerts were kept on the drive/folder designated in the Cilps/Archiving section of the BI options but the folder lower level folder structure was modified to reflect the per camera recording macros.
 
To include a UI3 link to stream the alert:
--form-string "url_title=Stream Alert via UI3" --form-string "url=&WAN/ui3.htm?rec=@&ALERT_DB&maximize=1"
Notes:
- the @ before &ALERT_DB is recommended for Blue versions 5.5.7.4+. For the reason why, see this post.
- To restrict data usage on mobile devices, you can add a URL argument like &streamingprofile=Jpeg%20HD to the UI3 URL. For more options see UI3 help (URL parameters).
- UI3 now supports short form URL parameters, allowing users to shorten long URLs. For example
"url=&WAN/ui3.htm?r=@&ALERT_DB&m=1&p=Jpeg%20HD"

Can you clarify a bit on the above? This is the only part that I am confused about. I successfully got Pushover alerts working a couple weeks ago and the only part that I haven't got working is links that persist after a DBCompact. Not really a big deal, since I don't usually have a need to go back and view alerts from previous days. But regardless I want to understand how it should work and understand why it doesn't appear to be working for me.

Is the above quoted information still accurate? I ask because if I use rec=@&ALERT_DB in my ui3 URL, I end up with two @'s. And without the @ I end up with "The recording in the URL could not be opened" after doing a compact.

Also doesn't "&ALERT_DB and &ALERT_FILE action set macros now return values which will survive a database compact or rebuild. " mean that the @ is no longer required? Sorry if I am misunderstanding.

Here is what I am using for the curl alert action parameters

https://api.pushover.net/1/messages.json -s --form-string "token=<token>" --form-string "user=<user>" --form-string "message=<b>&CAM</b> &MEMO <a href='https://<ExternalDNSNam:Port>/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='https://<ExternalDNSNam:Port>/ui3.htm?rec=&ALERT_DB'>UI3</a>" --form-string "html=1" --form-string "device=YOUR_PUSHOVER_DEVICE_NAME(S)_HERE" --form-string "sound=YOUR_PUSHOVER_SOUND_HERE" -F "attachment=@C:\BlueIris\Alerts\&ALERT_PATH"

Results in a link like this
https://<ExternalDNSName:Port>/ui3.htm?rec=@xxxxxxxxx, which works fine, except not after a DBCompact

What I use when I add the @
https://api.pushover.net/1/messages.json -s --form-string "token=<token>" --form-string "user=<user>" --form-string "message=<b>&CAM</b> &MEMO <a href='https://<ExternalDNSNam:Port>/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='https://<ExternalDNSNam:Port>/ui3.htm?rec=@&ALERT_DB'>UI3</a>" --form-string "html=1" --form-string "device=YOUR_PUSHOVER_DEVICE_NAME(S)_HERE" --form-string "sound=YOUR_PUSHOVER_SOUND_HERE" -F "attachment=@C:\BlueIris\Alerts\&ALERT_PATH"

Results in a link like this
https://<ExternalDNSName:Port>/ui3.htm?rec=@@xxxxxxxxx, which opens UI3 but opens an old clip for a specific camera (not the one that alerted lol).

UI3 version 223, Blue Iris version: 5.6.2.3 in case it matters.

Thanks again for making this thread! You rock! :headbang:
 
I'm happy this thread has been helpful.

Can you clarify a bit on the above? This is the only part that I am confused about. I successfully got Pushover alerts working a couple weeks ago and the only part that I haven't got working is links that persist after a DBCompact. Not really a big deal, since I don't usually have a need to go back and view alerts from previous days. But regardless I want to understand how it should work and understand why it doesn't appear to be working for me.

Is the above quoted information still accurate? I ask because if I use rec=@&ALERT_DB in my ui3 URL, I end up with two @'s. And without the @ I end up with "The recording in the URL could not be opened" after doing a compact.
The requirement for the @ came straight from Ken for the reason in this post. I'm unaware of any changes to this.
THAT SAID...
I just used my msg.exe trick to show the value of the macros.
And it appears that &ALERT_DB is now expanding already prefixed with @.
That would explain why you are seeing a double @@.

1664550261136.png


Interestingly, I just checked my own curl actions on the Alert tabs, and none of them are using the UI3.htm?rec=@&ALERT_DB syntax.
So I wasn't following my own guidance!

I've just edited post #1 to reflect that the @ prefix should not be used.

I just performed a DBcompact. A sampling of my past pushover notifications showed that they still played back the correct clip when I touched the UI3 link.
So, unfortunately I cannot reproduce your observation... Ditto after a DBrebuild.

My current BI version and UI3 versions are the same as yours.
 
Last edited:
  • Like
Reactions: Philip Gonzales
I'm happy this thread has been helpful.


The requirement for the @ came straight from Ken for the reason in this post. I'm unaware of any changes to this.
THAT SAID...
I just used my msg.exe trick to show the value of the macros.

View attachment 141253

It appears that &ALERT_DB is now expanding already prefixed with @.
That would explain why you are seeing a double @@.

Interestingly, I just checked my own curl actions on the Alert tabs, and none of them are using the UI3.htm?rec=@&ALERT_DB syntax.
So I wasn't following my own guidance!

I've just edited post #1 to reflect that the @ prefix should not be used.

I just performed a DBcompact. A sampling of my past pushover notifications showed that they still played back the correct clip when I touched the UI3 link.
So, unfortunately I cannot reproduce your observation... Ditto after a DBrebuild.

My current BI version and UI3 versions are the same as yours.

Thanks for looking into this. Glad to know that I am not crazy! Well I still may be crazy, but just for other reasons than this haha. I will try turning some stuff off and back on again to see if my URL's work after DBCompact. Thanks!
 
I'm happy this thread has been helpful.


The requirement for the @ came straight from Ken for the reason in this post. I'm unaware of any changes to this.
THAT SAID...
I just used my msg.exe trick to show the value of the macros.
And it appears that &ALERT_DB is now expanding already prefixed with @.
That would explain why you are seeing a double @@.

View attachment 141253

Interestingly, I just checked my own curl actions on the Alert tabs, and none of them are using the UI3.htm?rec=@&ALERT_DB syntax.
So I wasn't following my own guidance!

I've just edited post #1 to reflect that the @ prefix should not be used.

I just performed a DBcompact. A sampling of my past pushover notifications showed that they still played back the correct clip when I touched the UI3 link.
So, unfortunately I cannot reproduce your observation... Ditto after a DBrebuild.

My current BI version and UI3 versions are the same as yours.

With the help of Ken, I figured out the issue of my links not surviving a DBCompact. Failure to RTFM was the main cause! I did not create the AV exclusions in Windows Defender for the Blue Iris directory and the Blue Iris executable. The issue is specific to not being able to read from the DB, so it creates the "old" and much shorter version of the links or what not. Creating the exclusions fixed the issue right away.
 
  • Like
Reactions: bp2008 and jaydeel
This is probably a stupid question, as I'm sure I know the answer, but before I go through the trouble of configuring my local tablets, I just want to confirm...

If my tablets are all isolated from the WAN - that is, they have only LAN access to the BI server - that would preclude any of the Pushover functions from working, correct? The API communication occurs between the cloud and each of the tablets, thus eliminating the pathway?
 
If my tablets are all isolated from the WAN - that is, they have only LAN access to the BI server - that would preclude any of the Pushover functions from working, correct? The API communication occurs between the cloud and each of the tablets, thus eliminating the pathway?
Yes & yes.

This is just a brain fart. If your primary device is an Android phone, you might be able to use Tasker to intercept Pushover notifications and Join to push local notifications to your LAN devices.
 
Canceling Emergency-Priority Retries By Tag

You may find this post useful if you ever want to automate the handling of Pushover emergency-priority notifications.

Here is my case example... I've long used Tasker on my Android device to intercept Blue Iris notifications (see this post).
When Pushover ALSO sends an emergency priority notification, this means I am receiving TWO notifications - the 1st from Blue Iris and the 2nd from Pushover.
In this case I have have to dismiss both notifications in order to cancel the emergency alert retries. Now I can now automatically cancel the Pushover emergency notification retries when I dismiss the Blue Iris notification.

How to cancel retries by tag...

To an existing Blue Iris "Run a program" curl action executing the Pushover API with these emergency priority arguments ...
--form-string "priority=2" --form-string "retry=30" --form-string "expire=300"

add a 'tags' argument, for example...
--form-string "tags=a=BI,c=&CAM,g=Front"

This example adds 3 tags to the Pushover emergency priority notification:
a=BI ... app = Blue Iris
c=&CAM ... camera = &CAM
g=Front ... group = Front

You can now use ANY of these tags to cancel emergency retries for all notifications that have the specified tag.
Simply issue another curl command, like these...
https://api.pushover.net/1/receipts/cancel_by_tag/a=BI.json' -s --form-string "token=YOUR_APP_TOKEN_HERE"
https://api.pushover.net/1/receipts/cancel_by_tag/c=&CAM.json' -s --form-string "token=YOUR_APP_TOKEN_HERE"
https://api.pushover.net/1/receipts/cancel_by_tag/g=Front.json' -s --form-string "token=YOUR_APP_TOKEN_HERE"

An easy way to experiment is to assign one of them to a Preset 'On call' action set for one of your cameras.

For reference, here's the link to API ... Pushover: Receipts API
And a link to post #135, which covers emergency notifications.
 
Last edited:
  • Like
Reactions: fenderman
PowerShell scripts for experimenting with the Pushover API.

I don't think I've shared these before.

Note that before successfully using the scripts, you will need to edit them to replace current placeholders with your API App Token and User Key.
 

Attachments

  • Like
Reactions: fenderman
I am receiving an error that the JPG attachment is too large to send to pushover, where can I set the jpg quality/size in BI? Looks like the max is 2.5MB and the images are saving around 3.5MB in size.
 
I am receiving an error that the JPG attachment is too large to send to pushover, where can I set the jpg quality/size in BI? Looks like the max is 2.5MB and the images are saving around 3.5MB in size.
I don't think you can.

Out of curiosity I just checked my system (using my utility in this post)... the largest jpg in my alerts folder is 1.6MB. These are for my 4MP cams (Dahua IPC-T5442T-ZE).

Can you post an image of how is the error displayed in the notification?
 
Last edited:
  • Like
Reactions: TonyR
I don't think you can.

Out of curiosity I just checked my system (using my utility in this post)... the largest jpg in my alerts folder is 1.6MB. These are for my 4MP cams (Dahua IPC-T5442T-ZE).

Can you post an image of how is the error displayed in the notification?

I was testing through the command line, that is how I discovered the error. I never receive the notification, unless I use an image that is smaller then 2.5MB. The Dahua cam I am using is an 8MP (IPC-Color4K-T)