Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Add Custom Low Battery Alerts to Windows 11

How to Add Custom Low Battery Alerts to Windows 11

Managing your device’s battery life effectively is crucial, especially when you’re on the go. While Windows 11 provides default low battery alerts, they may not always suit your preferences or needs. Adding custom low battery alerts allows you to be more proactive, receive notifications tailored to your specific usage, and avoid unexpected shutdowns. This guide walks you through the process of setting up custom low battery alerts in Windows 11, ensuring you stay informed before your device runs out of power.

What You’ll Need

  • A Windows 11 PC or laptop
  • Administrative access to install or modify system settings
  • Optional: A third-party notification app or scripting tool if you want highly customized alerts

Step-by-Step

  1. Open the Settings app by pressing Windows key + I or clicking the Start menu and selecting Settings.
  2. Navigate to the System section and click on Power & battery.
  3. Scroll down to the Battery section and click on the ‘Battery usage’ link to view detailed battery info.
  4. Identify the current battery percentage threshold for low battery alerts. Windows typically alerts at around 20% or 10%.
  5. To create custom alerts, you’ll need to use Task Scheduler. Search for ‘Task Scheduler’ in the Start menu and open it.
  6. In Task Scheduler, click on ‘Create Basic Task’ in the Actions pane.
  7. Name your task something like ‘Custom Low Battery Alert’ and click Next.
  8. Select ‘When a specific event is logged’ and click Next.
  9. Choose ‘Microsoft-Windows-Battery/Operational’ as the log, and set the Event ID to 105 (which indicates low battery level).
  10. Configure the trigger to activate when the event with Event ID 105 occurs, then click Next.
  11. In the Action step, select ‘Start a program’ and click Next.
  12. Choose a notification method, such as launching a script or an app that displays a custom message. For example, you could use a simple PowerShell script to show a notification.
  13. Enter the path to your PowerShell script or notification app, then click Next.
  14. Review your settings and click Finish to create the task.
  15. To customize the notification, create a PowerShell script that displays a message box or toast notification at your preferred low battery level. For example:

    “`powershell
    [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
    $template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
    $textNodes = $template.GetElementsByTagName(‘text’)
    $textNodes.Item(0).AppendChild($template.CreateTextNode(‘Your battery is running low! Please plug in your charger.’))
    $toast = [Windows.UI.Notifications.ToastNotification]::new($template)
    $notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier(‘CustomBatteryAlert’)
    $notifier.Show($toast)
    “`

    Save this as a .ps1 file and point your scheduled task to execute it.

  16. Test your setup by manually triggering the event or lowering your battery to the threshold you set, ensuring your custom alert appears.

Common Mistakes

  • Not setting the correct Event ID: Make sure you’re monitoring the right event that indicates low battery in the Event Viewer.
  • Incorrect script path or syntax errors in PowerShell scripts: Double-check the script’s location and code for errors.
  • Forgetting to run Task Scheduler with administrator privileges: Some tasks require elevated permissions to execute properly.
  • Not testing the setup thoroughly: Always verify your custom alerts work as expected before relying on them.

Tips

  • Use third-party notification tools like Snarl or Growl for more customizable and visually appealing alerts.
  • Adjust the battery thresholds in Windows settings to match your alert preferences.
  • Combine multiple triggers, such as different battery levels, to get layered notifications.
  • Keep your PowerShell scripts simple and well-documented for easier troubleshooting.

Troubleshooting

  • If your custom alert doesn’t trigger, verify that the event ID and log are correctly set in Task Scheduler.
  • Check the Task Scheduler history for errors or failed attempts to run the task.
  • Ensure your PowerShell execution policy allows running scripts. You can set this by running PowerShell as administrator and executing ‘Set-ExecutionPolicy RemoteSigned’.
  • Test your PowerShell script independently to confirm it displays notifications correctly.
  • If using third-party notification apps, verify they are installed and configured properly.

Frequently Asked Questions

Can I set different alerts for various battery levels?

Yes, by creating multiple tasks with different event triggers or scripting different battery thresholds, you can receive alerts at various levels.

Is it possible to have a voice alert instead of a visual notification?

Absolutely. You can modify your PowerShell script to use text-to-speech commands, like ‘Add-Type –AssemblyName System.Speech’ and ‘Speak()’ method, to generate voice alerts.

Will these custom alerts work when my laptop is asleep or turned off?

No, notifications only work when Windows is running and awake. For critical alerts, consider hardware solutions or external battery monitors.

Can I automate this process for multiple devices?

Yes, by exporting your scheduled task and script, then importing and adjusting them on other devices, you can replicate your custom alerts easily.

Are there any risks in editing system logs or scripts?

Modifying system logs and scripts can cause issues if not done carefully. Always back up your settings and test changes in a controlled environment.

What if I want to revert to default Windows alerts?

Simply disable or delete your custom scheduled tasks and restore default battery notification settings in Windows.

By following these steps and tips, you can tailor your low battery alerts to better suit your needs, ensuring you stay informed and avoid unexpected shutdowns. Custom alerts can be as simple or as advanced as you prefer, giving you greater control over your device’s notifications and power management.

Related

How to Add Custom Low Battery Alerts to Windows 11
Scroll to top