Send Pushover notifications with pictures and hyperlinks

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,132
Reaction score
1,240
Location
SF Bay Area
Ok, I just ran your suggested test from the (elevated, admin) command prompt and it worked perfectly, I did get the proper alert in the Pushover app. This of course was with a direct path to a photo in my B.I Alerts folder, as suggested.

What now?
It appears we’ve narrowed this down the &ALERT_PATH macro not resolving to an existing alert jpg. Did you try the msg.exe trick to confirm the macro is resolving?

Also, are you sure you are saving alert *.jpgs for the triggering camera?

@wittaj The API’s ’attachment’ argument seems to require an existing file to successfully push the message. I’ll look at the API guide again to see if there’s any other way.
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,132
Reaction score
1,240
Location
SF Bay Area
The Pushover: API has these details. (See below)
  • Images must be sent as a file attachment.
  • Images must be no larger than 2.5 megabytes.
Brain fart… maybe Ken could make create new macro that when used creates a temporary database *.jpg file in the Alerts folder, say ‘database.jpg’ … and resolves to the same name.

1644895088488.png
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
It appears we’ve narrowed this down the &ALERT_PATH macro not resolving to an existing alert jpg. Did you try the msg.exe trick to confirm the macro is resolving?

Also, are you sure you are saving alert *.jpgs for the triggering camera?

@wittaj The API’s ’attachment’ argument seems to require an existing file to successfully push the message. I’ll look at the API guide again to see if there’s any other way.
Yes, the msg.ex trick works as expected, no problems there.

As for making sure I am saving alert *.jpgs for the triggering camera: it is confusing, because B.I presents a couple of areas that seem to cover almost the same thing here:

on the Trigger tab, I have "When triggered" set to: Add to alerts list: Hi-res JPEG files

on the Record tab, I have the checkbox checked for JPEGs set to : "When Triggered", but those go to the "New" folder, not the "Alerts" folder.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,132
Reaction score
1,240
Location
SF Bay Area
It seems everything is in order, yet still not working. Maybe the actions just aren’t firing?

I assume you’ve set the curl ’Run a program’ action in the ‘On alert…’ page on camera settings ‘Alerts’ tab. Two things that might explain why it’s not working (as well as the ‘Push’ action) is if:
  • you’ve inadvertently unchecked the ‘Enabled’ option at the top left corner (see screenshot).
  • the curl and push actions are disabled for the profiles of interest.

If this is not the case, did you try assigning the curl action to a camera preset as I suggested previously (for testing)? An alertnative is do what @sebastiantombs did - set the curl action in the ‘Immediate actions’ option on the ’Trigger tab’.

1644907542515.jpeg
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
I only had a few minutes to look at this before leaving the house this morning, but I did try a few things you suggested, unfortunately no luck there either. I tried adding the action both under presets as well as directly in the immediate trigger actions, neither worked.

After leaving the house, it occurred to me that I have not explicitly (manually) added curl.exe to the environment path, as it should already be there: everything under %SystemRoot%/System32 is always in the path by default. I will run some more command line tests to verify that this evening, by running the previously successful curl [Parameters] line with the hard-coded path to an alert jpg file, but starting it somewhere other than inside /System32/.
Beyond that, I can also try running the modified Parameters line (again with the hard-coded path to an alert jpg) inside Blue Iris to see if that works.

Hopefully more results to follow this evening...and thanks again.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,132
Reaction score
1,240
Location
SF Bay Area
Sounds good. If you see the following response by typing ‘curl.exe -V’ into a cmd.exe window after changing drives, then curl.exe is on your path.

1644944160661.png
 

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
OK, finally full success to report, and the failures were all linked to one very subtle and maddening typo: near the very end of the parameters where we specify the path to the photo attachment, I had accidentally entered a space in "BlueIris" (actually it is there from what I copy/pasted from your first post, I only changed the Drive Letter without paying any attention to rest of the path).

So in my case, "C:\Blue Iris\Alerts\&ALERT_PATH", rather than the correct "C:\BlueIris\Alerts\&ALERT_PATH".

Once that was solved, I just needed to adjust the UI3 link portion of the parameter statement from "&WAN" to "&LAN" as I use a permanent OpenVPN connection on my mobile phone back to my home router. For my purposes, my B.I. server has a static private LAN address, regardless of whether I am inside or outside the home LAN.

I thank you once again for all your help, hopefully this troubleshooting work will inspire more people to pursue this very elegant route of getting notifications. One of the reasons I really wanted to get this working was due to the fact that I still can't get the official android B.I app notifications to "punch through" when the app isn't running in the foreground. If you have any patience left over to offer any further troubleshooting suggestions on that one, I'd love to hear your ideas. This is on a Samsung S10E, and I have verified that the app has been granted all the possible notification permissions, as well as turning off the battery optimization setting. The phone shows up in the B.I general "Mobile Devices" setting screen, and the checkbox is enabled for push notifications. I haven't setup geofencing, so it's not a problem with that. On the camera Alert settings tab, it is also Enabled, as shown below (basically the stock default settings):
Settings.jpg
 

sebastiantombs

Known around here
Joined
Dec 28, 2019
Messages
11,511
Reaction score
27,692
Location
New Jersey
I ran into a similar situation. Being somewhat OCD I store all alerts in sub directories under the main alerts directory and use the camera short name for that discrete directory name. A few typos there and stuff didn't work. I think I've got them all fixed and will know, for sure, tomorrow. Again, at the very end of the string of code.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,132
Reaction score
1,240
Location
SF Bay Area
Sorry I overlooked the extra space. Good catch!

As for your device, let start with this…. If you haven’t done so already, try deleting the phone from ‘Mobile devices’ then logging in again from your phone to add it back. Pay attention to the DeviceID; it should change after adding the phone back... This procedure is often a cure for mobile device issues.
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
Sorry I overlooked the extra space. Good catch!

As for your device, let start with this…. If you haven’t done so already, try deleting the phone from ‘Mobile devices’ then logging in again from your phone to add it back. Pay attention to the DeviceID; it should change after adding the phone back... This procedure is often a cure for mobile device issues.
Ok, I just went through that process: first delete the phone from Mobile devices, then re-opened the app (which added it back to the B.I server). I re-enabled push notifications, and re-verified that it was still an enabled Alert on one camera, but sadly no change in notifications coming through. Oh well, I'm glad it was that easy to re-add the device, that was good to learn, as I was hesitant to delete it before.

Edit: BTW, the Device ID did NOT change upon re-adding it back.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,132
Reaction score
1,240
Location
SF Bay Area
In the mean time, try sending an issue report to the developer from the BI Android app. It may take a few weeks to get a response.
 

Tazz 316

Getting the hang of it
Joined
Aug 11, 2016
Messages
261
Reaction score
54
Can someone explain what curl is?
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
Can someone explain what curl is?
Used in linux/unix and now included Windows natively as curl.exe:
 

Tazz 316

Getting the hang of it
Joined
Aug 11, 2016
Messages
261
Reaction score
54
Used in linux/unix and now included Windows natively as curl.exe:
So i need to point to it's location?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,916
Reaction score
48,624
Location
USA
Pretty cool. Do they have to be out of the alerts folder? I am trying to get the hi-rez from the records tab but not having much luck
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
So i need to point to it's location?
Not strictly needed, as I found that curl.exe is installed by default in Windows 10 in C:\Windows\System32\, which is always automatically in the default Environment Path, so Blue Iris can "find it" even without specifying the full path to the file.
 
Last edited:

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
374
Reaction score
489
Location
USA
Pretty cool. Do they have to be out of the alerts folder? I am trying to get the hi-rez from the records tab but not having much luck
Hmm.. not sure which ones you are trying to use: mine are being pulled from Alerts folder, so the ones found on the "Trigger" tab, middle section under "When trigered" , "Add to alerts list:", "Hi-res JPEG files" is selected.

I don't know why it doesn't pull the nearly identical ones that are usually found on the "Record" tab, checkbox for "JPEGs", "When triggered"; these usually wind up in the "New" folder by default.

Make sure you didn't make the same typo mistake I made when setting up the Parameters line in the Action for Curl.exe: see my post above (Send Pushover notifications with pictures and hyperlinks)
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,916
Reaction score
48,624
Location
USA
I am trying this at the end because I have a separate folder:

"attachment=@G:\Snapshots\&CAM.%Y%m%d_%H%M%S%t"

My intent behind this is to save it for an hour so it can send by API and then have BI delete it.

If I use the ones in the Alerts folder, that folder fills quickly and if you do a BI cleanup to erase those then you lose your alert thumbnails.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,916
Reaction score
48,624
Location
USA
Has anyone tested this by having the alert send the pushover email and the API? I have and mine are coming in at the same time, which surprises me. I thought the API would be faster.

For some reason the UI3 portion doesn't work right for me and I tried changing WAN to LAN in both instances. How much of this would I need to eliminate to take that part out - is it this part:

<a href='&WAN/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='&WAN/ui3.htm?rec=&ALERT_DB'>UI3</a>"

And any idea why this wouldn't work by trying to pull the snapshots from the RECORD tab? I am wondering if it is firing before BI has created the image file?

--form-string "token=REDACTED" --form-string "user=REDACTED" --form-string "message=<b>&CAM</b> &MEMO <a href='&WAN/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='&WAN/ui3.htm?rec=&ALERT_DB'>UI3</a>" --form-string "html=1" -F "attachment=@G:\Snapshots\&CAM.%Y%m%d_%H%M%S%t"
 
Top