Overview
Energy Control Pro provides two intelligent alert systems that notify you when energy flow conditions persist beyond configured thresholds. These alerts use Home Assistant’s persistent notification system, ensuring they remain visible until acknowledged.Alerts trigger only once per event and automatically reset when conditions clear.
Alert Types
The integration monitors two distinct problematic conditions:Prolonged Grid Export Alert
Triggered when you’re exporting excessive power to the grid for an extended period, indicating unused surplus solar capacity. Notification ID:energy_control_pro_prolonged_grid_export
Import While Solar Available Alert
Triggered when you’re importing from the grid despite active solar production, suggesting optimization opportunities. Notification ID:energy_control_pro_import_while_solar
Configuration Parameters
Three key parameters control when alerts trigger:Import Threshold
Configuration Key (const.py:11, 32):Export Threshold
Configuration Key (const.py:12, 33):Duration Threshold
Configuration Key (const.py:13, 34):Prolonged Export Alert
Trigger Conditions
Logic Function (logic.py:151-164):Notification Creation
Implementation (coordinator.py:201-222):Example Notification
Title: Energy Control Pro: Prolonged Grid ExportMessage: Grid export is above 800 W for 10 minutes. Current: 1250 W, duration: 12 min.
Alert Reset
Reset Logic (coordinator.py:223-226):The alert flag resets when energy state changes from “exporting” to “importing” or “balanced”, allowing a new alert for subsequent export events.
Import While Solar Alert
Trigger Conditions
Logic Function (logic.py:167-179):This alert does not require a duration threshold—it triggers immediately when conditions are met.
Notification Creation
Implementation (coordinator.py:228-253):Example Notification
Title: Energy Control Pro: Importing While Solar AvailableMessage: You are importing energy while solar production is available. Import: 950 W, Solar: 1200 W, duration: 3 min.
Alert Reset
Reset Logic (coordinator.py:252-253):The alert flag resets as soon as import drops below threshold or solar production falls below 300W.
Alert Processing Flow
Alerts are processed during every coordinator update cycle: Processing Entry Point (coordinator.py:128, 182-253):Read Configuration
Load
import_threshold_w, export_threshold_w, and duration_threshold_min from optionsExtract Current Data
Get current
solar_w, grid_import_w, grid_export_w, energy_state, and duration valuesAlert State Tracking
The coordinator maintains two boolean flags in memory: Initialization (coordinator.py:71-74):_export_alert_sent
_export_alert_sent
Tracks whether the prolonged export alert has been sent for the current export event. Prevents duplicate notifications during the same continuous export period.
_import_alert_sent
_import_alert_sent
Tracks whether the import-while-solar alert has been sent. Prevents duplicate notifications while import and solar conditions persist.
Persistent Notification System
Both alerts use Home Assistant’s built-in persistent notification service:Persistent Notification Benefits
- Remains visible in Home Assistant UI until manually dismissed
- Accessible via notification panel
- Can trigger additional automations
- Supports unique notification IDs to update existing notifications
Dismissing Alerts
Alerts can be dismissed through:- Home Assistant UI: Click the notification in the notification panel
- Service Call:
- Automatically: Alerts with the same
notification_idare replaced when conditions retrigger
Using Alerts in Automations
You can create automations that respond to these notifications:Example: Send Mobile Notification
Example: Turn On Load When Export Alert Fires
Configuration Example
Alert Timing
Export Alert Timeline
Import Alert Timeline
Export alerts require duration persistence, while import alerts trigger immediately when conditions are met.
Troubleshooting
Alert not triggering
Alert not triggering
Check:
- Verify threshold values are appropriate for your system
- Confirm duration has been met (for export alerts)
- Check Home Assistant logs for any errors
- Verify sensor values using Developer Tools > States
Duplicate alerts
Duplicate alerts
Cause: Alert flag may not be resetting properlySolution: Check that energy state is transitioning correctly. Review
sensor.energy_state history.Alerts not clearing
Alerts not clearing
Cause: Persistent notifications remain until dismissedSolution: Manually dismiss in UI or use
persistent_notification.dismiss serviceNext Steps
Energy Monitoring
Learn about the sensors that drive alert logic
Load Optimization
Automatically respond to surplus/import conditions
Configuration
Configure alert thresholds and durations
Troubleshooting
Resolve alert notification issues