Send Pushover notifications with pictures and hyperlinks

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
When I first played with the 'When triggered' setting I was getting dozens of images until I set the JPEG interval >> the break time.
Is this also how you are getting just 1one *,jpg file per triggered event?
 
Last edited:

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
14,848
Reaction score
27,582
Location
USA
Ok, I have played with this some more.

Many that have followed this are aware of my concern that depending on your situation, if you save these hi-res images that go in the alerts folder, they show up as clips that can grow quickly in some instances. If you set up in clips and archiving to delete the Alerts folder frequently to bring down your clip total and increase storage space, you then lose the thumbnail alerts for any alerts that were deleted. You still have the video, just not the thumbnail alert image.

I have found that if you manually go in and delete the images from the alerts folder and then repair/regenerate the DB, it will then eliminate all the image clips yet still keep the thumbnail alert images!
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
260
Reaction score
341
Location
USA
Ok, I have played with this some more.

Many that have followed this are aware of my concern that depending on your situation, if you save these hi-res images that go in the alerts folder, they show up as clips that can grow quickly in some instances. If you set up in clips and archiving to delete the Alerts folder frequently to bring down your clip total and increase storage space, you then lose the thumbnail alerts for any alerts that were deleted. You still have the video, just not the thumbnail alert image.

I have found that if you manually go in and delete the images from the alerts folder and then repair/compact the DB, it will then eliminate all the image clips yet still keep the thumbnail alert images!
Nice discovery, now all we need is a script to automate this process. Calling @jaydeel perhaps?
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
If you set up in clips and archiving to delete the Alerts folder frequently to bring down your clip total and increase storage space, you then lose the thumbnail alerts for any alerts that were deleted. You still have the video, just not the thumbnail alert image.

I have found that if you manually go in and delete the images from the alerts folder and then repair/compact the DB, it will then eliminate all the image clips yet still keep the thumbnail alert images!
I emailed Ken on Tuesday inquiring about this behavior… No feedback yet.

I'd like to wait until he does before considering a work around.

=====
In an attempt to decipher what may be happening behind the scenes, I've been looking into this some more.

Based on the following excerpt from the help pdf, it's unclear if both the thumbnail image and the the hi-res image pointer are stored to the database (in the Alerts folder). I feel fairly confident that it must be both because -- regardless of the Trigger tab 'Add to alerts list' setting -- I can always get a thumbnail image using the /thumbs/{filename} HTTP interface command -- like http://192.168.1.3:8600/thumbs/@462226516.

1646412588862.jpeg


I'm starting to think that when the ‘Clips and archiving’ limit functionality does its thing, it removes all alerts with hi-res pointers that no longer exist in the Alerts folder. If Blue Iris is indeed always saving the thumbnail image to the database, It seems it could instead just replace the hi-res pointer with the thumbnail reference.

=====
I've also been experimenting with the JSON clipstats command today...

When I use it to inspect the filename (&ALERT_DB) for a alert that with a hi-res image saved via the Trigger tab 'Add to alerts list' setting, I get the following output.
If I then use Windows Explorer to search for the highlighted [file] in my Purple drive 'Blue Iris' folder, it locates the file in the Alerts folder (as expected).

1646418360136.png


On the other hand, here's the JSON clipstats command output for a alert that WITHOUT A HI-RES IMAGE saved via the Trigger tab 'Add to alerts list' setting.
If I use Windows Explorer to search for the highlighted [file] entry in my Purple drive 'Blue Iris' folder, it CANNOT LOCATE IT.
Therefore, I conclude that it is not an actual file. I think it's just an internal descriptor for the database thumbnail image.
I note also that the value for the [filesize] key is different.
1646418576864.png
 
Last edited:

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
14,848
Reaction score
27,582
Location
USA
Now my pushes from the API are not making a noise thru when the phone is on DND and I have it set to bypass that. The email alerts on the ones I haven't switched yet still make it through with the phone is on DND. Is anyone else having that trouble?
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
I just tested my Android device (Galaxy S21+).
I'm having no problems getting notifications through DND after adding the PushOver app to the list of apps that can ignore DND.

Neat discovery... you can specify that only PushOver notifications with certain sounds can ignore DND.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
14,848
Reaction score
27,582
Location
USA
Android

Hmm let me see if that certain sounds think is blocking
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
Just tested iOS (iPhoneXS).
Also having no problems getting notifications through DND after adding the PushOver app to the list of apps that can ignore DND.

With iOS it looks like you choose a single 'high-priority' sound that will allow PushOver notifications to ignore DND.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
14,848
Reaction score
27,582
Location
USA
Yep - good find - that was a change that must have happened in the Pushover update. The sounds I had were marked DND. The pushover is the default sound that the previous version must have carried over the coding to the update.
 
Joined
Sep 5, 2015
Messages
519
Reaction score
323
I've got this setup for DeepStack notifications. Within the next few days I plan on phasing out any email notifications from Blue Iris. Thanks @jaydeel for posting this! The last item I need to convert over from email are the status alerts for software restarts or errors. What code line would I input in "Parameters" when configuring Pushover for Status Alerts?
Thanks!
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
@smiticans Try something like this…
Code:
https://api.pushover.net/1/messages.json -s --form-string "token=REDACTED" --form-string  "user=REDACTED" --form-string "message=Status Message on '&SERVER' at %X"
Optionally add device and/or sound…
--form-string "device=galaxy-s21" --form-string "sound=cosmic"

EDIT: It might be helpful if Ken added some Blue Iris macro(s) for status errors/warnings that could be used in the message.
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
Ken has already replied to my email inquiring about including status messages in a pushover API message (like what you see in an email body or push/SMS text) when you check the options below. I’ll follow up here if he comes up with something.

1647013540187.jpeg
 
Last edited:
Joined
Sep 5, 2015
Messages
519
Reaction score
323
@smiticans Try something like this…
Code:
https://api.pushover.net/1/messages.json -s --form-string "token=REDACTED" --form-string  "user=REDACTED" --form-string "message=Status Message on '&SERVER' at %X"
Optionally add device and/or sound…
--form-string "device=galaxy-s21" --form-string "sound=cosmic"

EDIT: It might be helpful if Ken added some Blue Iris macro(s) for status errors/warnings that could be used in the message.
Thank you,
I was able to receive the status alert message using the code you provided above. However, on pushover it'll only tell me I have a status message in the title but it won't include the actual status message in the body of the text like it does in email. But for now at least I'll alert me if I have an error or warning and I can log in and look.

I also successfully used the code for my watchdog alerts if a camera goes offline. I just used "message= Signal Loss on Camera (whichever camera the alert is for)". I tested it and it seems to be working perfectly.
 
Joined
Sep 5, 2015
Messages
519
Reaction score
323
Has anyone been able to get the pushover alert with the image on their Apple Watch? It'll only show me the text and I can't view the image from the Apple Watch.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
UPDATE...

Ken has added a new HTTP interface command in 5.5.6.1.
/admin/mlist?latest=x&level=y

This new command displays recent log entries in the browser. The first argument is required; the 2nd is optional.
We can use this in a Pushover message link to inspect the log for recent status entries.

I've been testing it and it's almost there. Right now latest=10 returns the oldest 10 entries instead of the expected 10 newest, I've notified Ken. So for now I'm using a big number latest=100 to show all entries... Right now the optional argument &level=y filters the list for any entries with a level greater than y. I might suggest to Ken that he makes it work as a sum, so it can filter levels 2 & 3 using &level=5, etc.

EDIT: Ken is fixing these issues; see this post…

Here's the Pushover curl parameter code I'm now using in the Status Alerts action set...
Code:
https://api.pushover.net/1/messages.json -s --form-string "token=REDACTED" --form-string  "user=REDACTED" --form-string "message=Status Alert at %X [&nbsp;<a href='&LAN/admin/mlist?latest=100'>view log</a>&nbsp;]" --form-string "html=1"
As always, you can add device and sound args as desired.
Code:
 --form-string "device=galaxy-s21" --form-string "sound=cosmic"
The resulting Pushover notification looks like this...
1647201065789.png


Clicking the hyperlink shows something like the following...
1647201271468.png


For best viewing, put your phone in landscape view.

The 'level' is the value in the 2nd column (after the timestamp).
 
Last edited:
Joined
Sep 5, 2015
Messages
519
Reaction score
323
I'll try this out tomorrow. I also briefly saw on Pushover's website a 3rd party app that'll act as an email server and forward the message to your pushover account. I'm going to check that out because I have two online double conversion UPS's (APC and Battery Backup Power INC.) that I monitor with email alerts using Gmail. Unfortunately, I can't configure those UPS systems to work with Pushover's code.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
750
Reaction score
738
Location
SF Bay Area
I'll try this out tomorrow. I also briefly saw on Pushover's website a 3rd party app that'll act as an email server and forward the message to your pushover account. I'm going to check that out because I have two online double conversion UPS's (APC and Battery Backup Power INC.) that I monitor with email alerts using Gmail. Unfortunately, I can't configure those UPS systems to work with Pushover's code.
What’s the name of the 3rd-party app?
 
Top