I've developed a Powershell script (pushover_snapshot.ps1) that can send a Pushover notification with a current camera snapshot, or current video stream image. The second method can also send camera group images. Additionally, all attachments can be resized before sending.
When sending Blue Iris snapshots, the database memo is set to make it clear that the snapshot was created by the script.
When sending a current stream image from a dual-stream camera, the default is a sub stream image. You have the option of grabbing a main stream image instead.
The resize feature enables shrinking large attachments (exceeding 2.5MB) that would otherwise result in the rejection of the notification by the Pushover API.
The script accepts a variety of user customizations via a separate Powershell 'user_settings' file.
The script also automatically logs its activity to a CSV file.
Here's a screenshot of all arguments available in the script:
HOW TO GUIDE...
STEP #1:
STEP #2:
STEP #3:
STEP #4:
Script Zip File
When sending Blue Iris snapshots, the database memo is set to make it clear that the snapshot was created by the script.
When sending a current stream image from a dual-stream camera, the default is a sub stream image. You have the option of grabbing a main stream image instead.
The resize feature enables shrinking large attachments (exceeding 2.5MB) that would otherwise result in the rejection of the notification by the Pushover API.
The script accepts a variety of user customizations via a separate Powershell 'user_settings' file.
The script also automatically logs its activity to a CSV file.
Here's a screenshot of all arguments available in the script:
pushover_snapshot.ps1 -Help
HOW TO GUIDE...
STEP #1:
Install the script and its companion 'user settings file'
- Extract all the files from the attached zip file to your desktop, or scripts folder.
- Please note that the folder used must be in your PC's environment path.
- Create a working folder for this script - it will be used to process the attachments files; to hold the script's log file, etc.
- To use the folder, you must edit a user setting
$app_path
in the user-settings script file (see Step #2)
NOTE: If you've never used PowerShell on your Blue Iris PC, you may first to need to change its default security policy.
Open PowerShell in Administrator mode, and type the following, then hit the Enter key:
Set-ExecutionPolicy RemoteSigned
(click here for a nice beginner's tutorial to using PowerShell).
STEP #2:
Edit the user settings file
- The user settings file is named 'pushover_snapshot_user_settings.ps1'?
- Open the file in a code text editor (I use Notepad++)
- Edit the REQUIRED variables in the USER SETTINGS section (see screenshot)
- Ignore the remaining settings for now. They provide customizations that you may want to explore later.
STEP #3:
Test the script from the console
- Open an Admin PowerShell window, or Powershell-ISE window
- Select and copy each of the the following commands and paste it into the console (one at a time)
pushover_snapshot.ps1 -Msg "current snapshot" -CamName "DW1"
pushover_snapshot.ps1 -Msg "current stream grab" -CamName "DW1" -Grab -Mainstream
pushover_snapshot.ps1 -Msg "current stream grab" -CamName "Index" -Grab
- Edit 'DW1' to match the short name of one of your cameras
- Hit the Enter key.
The response should look like following screenshot
You should also receive your first Pushover notifications from the script, like these examples:
And the first command in #2 above should show a new entry in the cliplist, like this
NOTE: The script can also be executed from an Admin cmd.exe window using a command like
powershell.exe "C:\ps_scripts\{scriptname}.ps1 args"
STEP #4:
Test on a on a camera Preset
- Click 'Camera settings' > 'PTZ/Control' tab
- Click 'Edit Presets..." to open the preset editor
- Create a new 'Run a program' action, and configure it as shown in the following screenshot
The code for the 'Parameters' field is like the following:
"C:\ps_scripts\pushover_snapshot.ps1" -Msg """current image <b>&CAM</b>""" -CamName &CAM
"C:\ps_scripts\pushover_snapshot.ps1" -Msg """current image <b>&CAM</b>""" -CamName &CAM -Grab -Mainstream
Please note that the triple double quotes (""") in the -Msg parameter are ESSENTIAL.
Script Zip File
Attachments
Last edited: