Smart Power Manager for Home Assistant
Protect your home from circuit breaker trips — automatically.
AvoidBlackout is a smart Home Assistant integration that monitors your home's real-time power consumption and automatically sheds non-essential loads before your circuit breaker trips. Set your power threshold, define which devices to turn off first, and let the integration handle the rest.
- Active Protection — Monitors power sensors and steps in before the breaker trips.
- Priority Management — You decide the order in which devices are turned off.
- Smart Debounce — Prevents false shutdowns caused by momentary power spikes.
- Live Configuration — Change threshold and debounce directly from your dashboard. Changes apply instantly, no restart needed.
- Premium Card — A beautiful Lovelace card to monitor status and restore loads with one tap.
- Smart Notifications — Included Blueprint for instant alerts on your phone or smart speaker.
- Test Mode — Simulate shedding logic without actually turning anything off.
- Multilingual — Full Italian 🇮🇹 and English 🇬🇧 support.
- Open HACS in Home Assistant.
- Go to Integrations → click the three-dot menu (top right).
- Select Custom Repositories.
- Paste this repository URL and select category
Integration. - Click Download and restart Home Assistant.
After installation, add the integration from Settings → Devices & Services:
- Search for AvoidBlackout.
- Power Sensors — Select one or more power sensors (W). If you select multiple, their values are summed (useful for multiple clamp meters).
- Threshold — Set your contracted power limit (e.g.
3300for a 3 kW contract). - Debounce — Seconds to wait before acting after the threshold is exceeded.
- Priority Order — Select which devices to manage and in what order they will be turned off.
💡 Threshold and Debounce can be changed at any time — either from the integration settings or directly via the dedicated dashboard entities (see Exposed Entities). Changes are applied in real time without restarting the integration.
The integration automatically creates the following entities under the AvoidBlackout PowerManager device.
| Entity | Description | Unit | Range |
|---|---|---|---|
number.avoidblackout_max_threshold |
Maximum power threshold. Change it to update the limit in real time. | W | 100 – 10,000 |
number.avoidblackout_debounce_time |
Wait time before the integration acts. Change it to update the delay in real time. | s | 5 – 300 |
The number entities are bidirectionally synced with the integration settings: changing the value from either side updates the other automatically.
You can add them to your dashboard as standard cards, or use them in automations to dynamically adjust the threshold and debounce (e.g. based on time of day).
Example YAML card:
type: entities
title: AvoidBlackout — Configuration
entities:
- entity: number.avoidblackout_max_threshold
- entity: number.avoidblackout_debounce_time| Entity | Description |
|---|---|
sensor.avoidblackout_status |
System state (monitoring, waiting, shedding) with detailed attributes |
Status sensor attributes:
| Attribute | Description |
|---|---|
total_power |
Current total power draw (W) |
threshold |
Active power threshold (W) |
is_over_threshold |
true if power exceeds the threshold |
shutdown_entities |
List of devices currently turned off by the integration |
managed_entities_count |
Number of managed devices |
test_mode |
true if test mode is active |
The card is registered automatically. To add it to your dashboard, pick it from the card picker or paste this YAML:
type: custom:avoidblackout-card
entity: sensor.avoidblackout_status
name: "Energy Monitor" # OptionalA Blueprint is included to simplify creating automations that alert you when a load-shedding event begins:
- Go to Settings → Automations & Scenes → Blueprints.
- Find Load Shedding Notification (AvoidBlackout).
- Click Create Automation.
- Select the status sensor and your notification service (e.g.
notify.mobile_app_your_phone).
For more advanced automations, use the is_over_threshold attribute as a template trigger:
triggers:
- trigger: template
value_template: "{{ state_attr('sensor.avoidblackout_status', 'is_over_threshold') }}"| Service | Description |
|---|---|
avoidblackout.reset_history |
Restores all shed devices and returns the system to monitoring mode. |
avoidblackout.simulate_overload |
Forces a shedding cycle — useful for testing automations. Requires Test Mode to be active. |
| Language | Status |
|---|---|
| 🇮🇹 Italiano | ✅ Supported |
| 🇬🇧 English | ✅ Supported |
v1.1.3 — Fixed "Custom element doesn't exist" error on startup by adding frontend and http dependencies.
See CHANGELOG.md for the full version history.
Made with ❤️ for the Home Assistant community.
If you find this project useful, please leave a ⭐ on GitHub or buy me a coffee ☕


