Send Pushover notifications with pictures and hyperlinks

Joined
Sep 5, 2015
Messages
662
Reaction score
484
Sounds like a crappy app/server software. Blue Iris for the win! I'm sure @fenderman would get a kick out of that lol.
Regards,
Philip
Actually Digital Watchdog is more powerful than Blue Iris and less quirky and more stable. The timeline playback is smoother and the mobile app is easy to use. It's built for enterprise/business so it's not catered to home use like Blue Iris is. DW has a whole API built for integration into 3rd party systems, but I just don't know how to use it.. yet lol. Blue Iris does have the advantage in features set and price tho.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
The email option works, I was just hoping I could get it configured where I could send it directly to pushover without having to use an email address and have a bunch of emails in my "sent" folder. Worse cause I will just use the DW app for push notifications. Only problem is I can't change the sounds on DW app and I like the distinctive sound of the pushover alerts.
I'm looking at the Pushover API, and it has a simple percent-encoded request example (see code block below).
Have you tried testing it the 'HTTP(S) Content' field (edited for your pushover user and app tokens).
I'd leave the 'Login' and 'Password' fields blank.

Code:
token=azGDORePK8gMaC0QOYAMyEEuzJnyUi&user=uQiRzpo4DXghDmr9QzzfQu27cmVRsG&device=droid4&title=Backup+finished+-+SQL1&message=Backup+of+database+%22example%22+finished+in+16+minutes.
 
Joined
Sep 5, 2015
Messages
662
Reaction score
484
I'm looking at the Pushover API, and it has a simple percent-encoded request example (see code block below).
Have you tried testing it the 'HTTP(S) Content' field (edited for your pushover user and app tokens).
I'd leave the 'Login' and 'Password' fields blank.

Code:
token=azGDORePK8gMaC0QOYAMyEEuzJnyUi&user=uQiRzpo4DXghDmr9QzzfQu27cmVRsG&device=droid4&title=Backup+finished+-+SQL1&message=Backup+of+database+%22example%22+finished+in+16+minutes.
Yeah, I tried it yesterday with just my token, user and message. I just tried tha example code with my credentials and still a no go :(. Oh well, thanks for trying tho lol.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
Yeah, I tried it yesterday with just my token, user and message. I just tried tha example code with my credentials and still a no go :(. Oh well, thanks for trying tho lol.
You're welcome.

A final thought... does the documentation for the software provide any examples using the 'Do HTTP(S) Request'?
 

prsmith777

Getting comfortable
Joined
Dec 23, 2019
Messages
268
Reaction score
382
Location
Colorado
I updated Blue Iris from 5.7.9.12 to 5.8.0.16 and my push messages don't have images any more. Has anyone seen this?

The update notes talk about changes in folders. Could this be the issue?
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
I updated Blue Iris from 5.7.9.12 to 5.8.0.16 and my push messages don't have images any more. Has anyone seen this?

The update notes talk about changes in folders. Could this be the issue?
Let's try this first...
Do the notifications have an icon?
Is so, try tapping it.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
The next to try is the 'msg.exe trick'.
This tests if the Blue Iris macros are resolving correctly.

It can also provide clues if the database is corrupted.
 

Barboots

Pulling my weight
Joined
Mar 15, 2018
Messages
408
Reaction score
241
Location
Perth, Western Australia
I've just been proving how tech-tarded I'm becoming by trying to get this working. I've got to the point where I'm getting a notification with a snapshot and link to UI3, but this takes me to a live view of all cams... not a clip of the alert event. I doubt this is correct given the complexity of the full URL, which is along the lines of:


Perhaps someone could confirm what I should expect to land at?

Anyway, for those who might be struggling, my learnings were:
  • If your BI machine is not being used to access this forum directly, use a USB drive to copy the code across. Formatting means you will almost certainly mis-transcribe the structure, particularly with regard to whitespace.
  • Don't do your edits in BI, as you can't identify excess whitespace at the line-wrap points easily... I found cutting and pasting to and from Notepad easier.
  • The BI editor is a bit clunky with regard to quotation marks, and you may have to hit space after entering one to avoid hieroglyphics. This is another reason to cut and paste from Notepad.
  • this is all one long chunk of code, so no line breaks y'all.
  • I had set up my Windows 11 installation with a Local Account for simplicity, which meant that I had to create a Microsofton Account, and also set up Blue Iris with the new credentials in Services.
  • Using &WAN was no good in my application, but changing it to &LAN meant that the UI3 link at least resolved to my BI computer. Obviously if I'm out I need to activate my VPN tunnel prior to attempting to view the video, but at least at home it works directly.

Many thanks for the overall solution. If I could get some commentary on the video link aspect that'd be great.

Cheers!
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
Glad you you got it (almost) working.

The UI3 URL should not have the ‘*’ sign, nor the ‘t=live’ and ‘group=‘ HTTP query parameters.

Please share the entire entry of the Parameters field in the ‘Run a program’ Action… To make sure you get it all, click once inside the field, and type Ctrl-A, then Ctrl~C. And after you paste it, remove the pushover user & app keys.

I’m suspecting that you’ve still pasted a line break in the code string, possibly after the ‘ui3.htm?’ bit.
 
Last edited:

Barboots

Pulling my weight
Joined
Mar 15, 2018
Messages
408
Reaction score
241
Location
Perth, Western Australia
I’m suspecting that you’ve still pasted a line break in the code string, possibly after the ‘ui3.htm?’ bit.
Would you take a whitespace... exactly where you suggested though! I must have slipped it in there while replacing deletions made to simplify the string while fault-finding other aspects.

Maybe I'll have to accept using my BI computer on websites. I made this task a lot harder by not being able to paste your original code, and typed it in by hand using Tapatalk as the source. It doesn't do the code presentation any justice... so I will add this to my list of learnings.

Ironically I thought getting the keys typed in correctly would have been the difficult part

Thanks heaps for your innovation and attention to this solution Jaydeel, it's now all I'd wished for. Have a fantastic New Year.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
I keep finding new ways to use Pushover.

On Black Friday I ordered from Shelly a BLU Motion detector and a BLU Gateway (detects Bluetooth signals and relays them to the Shelly Cloud or locally to other Shelly devices). The BLU Gateway supports scripting.

Yesterday, I created a script to send Pushover notifications to my devices when the BLU Motion detector is triggered.
 

Sybertiger

Known around here
Joined
Jun 30, 2018
Messages
4,717
Reaction score
13,614
Location
Orlando
Sometimes when I receive a push notification the link (Play Video Alert) generated does not work. Taking a closer look I can see that the curl script sometimes generates a link with is not valid. When you click on the Play Video Alert link, instead of the video clip playing in UI3, I get an error message that it can't open the link. For some reason the formed string creates a link that is not valid.

1704053286911.png


When it works correctly the link generated looks like this:

1704052767554.png


But sometimes it generates a link like this which doesn't work:

1704052799941.png


Here's my json command:

https: /api.pushover.net/1/messages.json -s --form-string "token=MyToken" --form-string "user=MyUserID" --form-string "message=<b>Mailman (USPS) is here!</b> &MEMO" --form-string "html=1" --form-string "device=MobilePhone" --form-string "sound=bugle" --form-string "url_title=Play Video Alert" --form-string "url=&LAN/ui3.htm?rec=&ALERT_DB&maximize=1" -F "attachment=@E:\BlueIris\Alerts\&ALERT_PATH"

Is this possibly happening because BI is in the middle of processing another alert so by the time the curl command grabs the time stamp and camera ID it's pointing to something different? Is there a work around to guarantee 100% of the time it's correctly grabbing the timestamp and camera ID correctly?
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,146
Reaction score
1,253
Location
SF Bay Area
Sometimes when I receive a push notification the link (Play Video Alert) generated does not work. Taking a closer look I can see that the curl script sometimes generates a link with is not valid. When you click on the Play Video Alert link, instead of the video clip playing in UI3, I get an error message that it can't open the link. For some reason the formed string creates a link that is not valid.

View attachment 181336

When it works correctly the link generated looks like this:

View attachment 181334

But sometimes it generates a link like this which doesn't work:

View attachment 181335

Here's my json command:

https: /api.pushover.net/1/messages.json -s --form-string "token=MyToken" --form-string "user=MyUserID" --form-string "message=<b>Mailman (USPS) is here!</b> &MEMO" --form-string "html=1" --form-string "device=MobilePhone" --form-string "sound=bugle" --form-string "url_title=Play Video Alert" --form-string "url=&LAN/ui3.htm?rec=&ALERT_DB&maximize=1" -F "attachment=@E:\BlueIris\Alerts\&ALERT_PATH"

Is this possibly happening because BI is in the middle of processing another alert so by the time the curl command grabs the time stamp and camera ID it's pointing to something different? Is there a work around to guarantee 100% of the time it's correctly grabbing the timestamp and camera ID correctly?
I can replicate the funky URL in a browser by using the following
ui3.htm?rec=&cam=mycam
So I would agree that the likely cause is that macro &ALERT_DB is not resolving.

Recommend that you email Ken and inquire if it’s possible that a race condition is resulting in the unresolved (blank) macro. Perhaps he can code a fix.

As a work arounds, you could try:
  • Inserting a ‘Wait’ action (say 500 msec) before the Curl ‘Run a program’ action.
  • Enabling the ‘Wait for process to complete’ option in the Curl ‘Run a program’ action.

PS - Macro &ALERT_DB is a database record, not a timestamp.
 

Sybertiger

Known around here
Joined
Jun 30, 2018
Messages
4,717
Reaction score
13,614
Location
Orlando
I can replicate the funky URL in a browser by using the following
ui3.htm?rec=&cam=mycam
So I would agree that the likely cause is that macro &ALERT_DB is not resolving.

Recommend that you email Ken and inquire if it’s possible that a race condition is resulting in the unresolved (blank) macro. Perhaps he can code a fix.

As a work arounds, you could try:
  • Inserting a ‘Wait’ action (say 500 msec) before the Curl ‘Run a program’ action.
  • Enabling the ‘Wait for process to complete’ option in the Curl ‘Run a program’ action.

PS - Macro &ALERT_DB is a database record, not a timestamp.
Kind of surprised no one else is reporting this issue.

I don't see a "wait until process finished" option. I'm on 5.5.7.11 which is the last version that officially supports DeepStack. Or is there a curl command line option?
 
Top