A Home Assistant custom integration to prevent exceeding your household's power budget by automatically turning off less critical appliances based on real-time power consumption.
- Monitors the total house power consumption from a main sensor.
- Compares current usage against a configured power budget.
- Automatically turns off pre-defined controllable appliances when the budget is exceeded.
- Allows configuring multiple monitored circuits/sensors, each linked to a controllable appliance.
- Prioritize which appliances to turn off based on configured importance levels.
- Flag certain appliances as "last resort" to only turn them off if absolutely necessary.
- Optional "assumed power on" value for appliances to react quickly to potential overloads before sensor data updates.
- Provides a control switch entity to easily enable or disable the load balancing function.
- Includes a sensor entity to log balancing events (e.g., which appliance was turned off and why).
- Custom Services: Enhanced
turn_on_applianceandturn_off_applianceservices with proper logging attribution. - Enhanced Logging: Track all balancing actions with detailed event logs and clear attribution in HA logs.
Before installing, ensure you have:
- Home Assistant (This has currently been tested from 2025.6 and later).
- Power sensors integrated into Home Assistant that provide real-time power consumption (in Watts).
- Controllable switch, light, climate, or media_player entities integrated into Home Assistant for the appliances you want to manage.
- HACS (Home Assistant Community Store) is recommended for easier installation and updates.
- In Home Assistant, navigate to HACS -> Integrations.
- Click the three dots in the top right corner and select "Custom repositories".
- Add this url
https://github.com/chicco-carone/Power-Load-Balancer.git. - Select the category "Integration".
- Click "Add".
- Search for "Power Load Balancer" in the HACS Integrations list.
- Click on the integration, then click "Download".
- Restart Home Assistant.
After installation and restart:
- In Home Assistant, go to Settings -> Devices & Services.
- Click the orange "+ ADD INTEGRATION" button.
- Search for "Power Load Balancer".
- Follow the steps in the configuration flow:
- Main Configuration:
- Select your Main Power Sensor (the sensor representing the total house consumption).
- Enter your Power Budget (Watt). It is recommended to set this slightly below your actual limit to avoid tripping breakers.
- Optionally edit the Cooldown Time (defaults to 10 seconds) to prevent rapid toggling of appliances.
- Add New Monitored Sensor:
- Select a Power Sensor for a specific appliance or circuit you want to monitor.
- Optionally provide a Name for this configuration (defaults to the sensor's friendly name).
- Set the Importance (1 being highest priority to keep on, 10 being lowest priority).
- Check the Last Resort box if this appliance should only be turned off as a last resort.
- Select the Controllable Appliance (switch, light, climate, or media_player entity) associated with this sensor.
- Optionally override the Cooldown Time for this specific appliance.
- You can add multiple monitored sensors and their associated appliances.
- You can remove configured sensors from the main configuration screen.
- Select "Finish Configuration" when done. Not selecting finish configuration at the end will result in no configuration being saved.
- Main Configuration:
Once configured, the integration will automatically monitor your power usage and trigger balancing actions when the budget is exceeded and balancing is enabled.
- Event Log Sensor: A sensor entity named
sensor.power_load_balancer_event_log(or similar) will be created. The state will show the last balancing action, and theeventsattribute will contain a list of recent balancing events (e.g., when appliances were turned off).
The integration provides two enhanced services with better logging attribution:
power_load_balancer.turn_off_appliance: Turn off an appliance with custom reason loggingpower_load_balancer.turn_on_appliance: Turn on an appliance with custom reason logging
These services provide enhanced logging in Home Assistant's logbook and logs, making it easy to track all power management actions. These actions are not supposed to be used directly by the user but are used by the integration itself to manage appliances based on power budget constraints.
- Balancing Not Happening:
- Verify that your power sensors are reporting data correctly.
- Check the Home Assistant logs for any errors related to
power_load_balancer. - Check the "Power Load Balancer Log" sensor for any error messages or indications of actions taken.
- Ensure the configured main power sensor and monitored sensors are reporting in Watts.
- Appliance Not Turning Off:
- Verify the correct controllable appliance entity is selected in the configuration.
- Check if the appliance was already turned off by the balancer (it won't try to turn it off again).
- Ensure the appliance is not marked as "Last Resort" if other, higher importance appliances are still on.
Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue or submit a pull request on the GitHub repository.
- Fork the repository and clone it to your local machine.
- Create a new branch for your feature or bug fix.
- Make sure to install the required dependencies (I recommend using
uv) - Make sure to use the provided
configuration.yamlsince it contains necessary template sensors for testing and make sure to include thetemplate_climatecustom component since its needed for a custom template hvac. - Test your changes thoroughly.
- Commit your changes with clear messages and push to your fork.
- Open a pull request against the main repository with a clear description of your changes.
- Support for solar energy in calculation
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer: This is a custom component and is not officially endorsed or supported by the Home Assistant team. Use at your own risk. Ensure your electrical wiring and appliances are suitable for this type of automation.