Get low-battery push notification from your notebook

Imagine the situation while presenting your newest PowerPoint slide show in front of your customer, when your notebook’s screen suddenly goes black.
Reason: You missed the “Your battery is running critically low on power” message.

But you’re lucky: If you are an owner of a Microsoft Band (or any other push-compatible smart wear), here is a tiny proof-of-concept solution, preventing such a blame:

  1. Get yourself a free account at https://pushalot.com
  2. Remember the app token
  3. Get the appropriate app for your smartphone/smartwear at https://pushalot.com/apps and set it up
  4. Prepare your smartwear
    e.g. Microsoft Band needs the Notification hub enabled
  5. Copy the attached PowerShell file to a favorite location
  6. Update custom settings inside of the PowerShell script (at the very top):
    – $maxBatt: must be set to the value which is shown at full battery level.
    Run the script at 100% battery level to get your specific $maxBatt-Value. For example: 

    So your computer specific $maxBatt value is = 38687

    – $warnlevel: Level in percent at which a notification will be send (Recommendation: above 20%)
    – $pushalotAuthToken: Put your pushalot-App-token here

  7. Create a scheduled task with these settings:
    – Enable: Run whether user is logged on or not
    – Enable: Do not store password
    – Trigger: Run every day at 00:00 and repeat every 1 Minute for 1 day
    – Actions: Run program: 

    Arguments: (Replace path to PowerShell script with your chosen path)

    – Conditions:
    — Disable: Start the task only if the computer is on AC
    — Enable: Start only if the following network connection is: Any connection
    – Settings:
    — Run task as soon as possible after a scheduled start is missed

 

Voila, done is your battery push notification!
From now on you will be reminded by your smartphone/smartwear, as soon as your notebook is at low battery. Minutes before any of your listeners will note, you’re aware of the raising situation and have plenty of time to plug your notebook in a power socket ūüôā

Remark 1:
Windows 10 is introducing the “Battery saving”-mode, which prevents scheduled tasks to run (default level: 20%). This is why you should choose a higher $warnlevel than 20%.

Remark 2:
This is proof-of-concept-code which is not fail safe. Use on your own risk.

PushalotBatteryWarn.ps1

Scheduled task propertiesPushalot Battery Watch Task Page 1

 

 

 

 

 

 

 

 

 

 

Pushalot Battery Watch Task Page 2Pushalot Battery Watch Task TriggerPushalot Battery Watch Task Page 3Pushalot Battery Watch Task ActionPushalot Battery Watch Task Page 4Pushalot Battery Watch Task Page 5