Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Smart Home Assistant integration for heat pump optimization based on electricity price and temperature.

License

Notifications You must be signed in to change notification settings

JohanAlvedal/PumpSteer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PumpSteer

PumpSteer is a custom Home Assistant integration that optimizes your heat pump in order to reduce your electric bill when using dynamic pricing. The heat pump is controlled via the outdoor temperature sensor input. A secondary benefit is improved comfort by reducing indoor temperature swings due to weather.

Buy Me A Coffee

Open your Home Assistant instance and start setting up a new integration.


โš ๏ธ Disclaimer

You use this integration at your own risk. Heating is a critical system in your home, and incorrect settings may lead to discomfort or damage.

Do not use PumpSteer if your heating system is not performing adequately.

Only use PumpSteer if you understand how it works and have verified that it functions correctly in your specific setup. Always monitor indoor temperatures and system behavior after installation.


๐Ÿ—ƒ๏ธ Recorder Data Requirement

PumpSteer calculates price levels using 72 hours of raw electricity price history from the Home Assistant recorder. Long-term statistics are not used, so ensure the recorder keeps at least three days off data


PumpSteer

PumpSteer Drift & Status PumpSteer Chart
PumpSteer Troubleshooting PumpSteer Templates

PumpSteer Price & Holiday


โœ… Features

  • ๐Ÿ”ง Smart control of outdoor temperature

  • ๐ŸŒก๏ธ Dynamic comfort control using:

    • Indoor temperature
    • Target indoor temperature
    • Electricity price forecast
    • Weather forecast
    • Thermal inertia
  • ๐Ÿ’ธ Electricity price adjustment via Nordpool or other sensor

  • ๐ŸงŠ Braking mode: limits heating when power is expensive

  • โ˜€๏ธ Summer mode: disables heating control during warm weather

  • ๐Ÿ๏ธ Holiday mode: temporarily reduces temperature when away

  • โ„๏ธ Precool: pauses heating ahead of forecasted warm weather

  • ๐Ÿ“ˆ Switchable price model (hybrid or percentiles)

  • ๐Ÿค– ML analysis: learns how your house responds (session-based) (beta, work in progress)

  • ๐Ÿ” Auto-adjustment of house_inertia (beta, disabled by default, work in progress)

  • ๐Ÿง  Recommendations for improved comfort/savings balance (beta, work in progress)

  • โš™๏ธ Adjustable heating and braking compensation factors

  • ๐ŸŽ›๏ธ Fine-tuning via input_number, input_text, input_boolean, input_datetime

  • ๐Ÿ–ผ๏ธ Extra sensors for UI visualization

๐Ÿ’ก Note: Holiday mode is only active when the outdoor temperature above the summer threshold.

โ„๏ธ Precool Mode

When the weather forecast shows temperatures exceeding the summer threshold in any of the next 24 hours, PumpSteer enters precool mode which turns down the heat in advance.


๐Ÿ”ง Installation via HACS (Custom Repository)

If PumpSteer is not yet available in HACS, so you need to add it as a custom repository:

  1. Go to HACS > โ‹ฎ > Custom Repositories
  2. Add: https://github.com/JohanAlvedal/PumpSteer
  3. Choose Integration as category
  4. Install PumpSteer
  5. Restart Home Assistant
  6. Follow the setup guide and select helper entities

For a complete step-by-step installation guide, including setting up helper entities and automations, please refer to our wiki:

PumpSteer - Installation och Grundkonfiguration


๐ŸŒค๏ธ Weather Forecast Automation

PumpSteer requires hourly temperature forecasts in input_text.hourly_forecast_temperatures. Instead of manual entry, use our automated blueprint:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

What it does:

  • ๐Ÿ”„ Automatically fetches 24-hour temperature forecasts
  • ๐Ÿ“Š Formats data as comma-separated values for PumpSteer
  • โฐ Updates on configurable intervals (default: every 30 min)
  • ๐ŸŒก๏ธ Works with SMHI, Met.no, OpenWeatherMap, and more

Quick Setup:

  1. Import blueprint from the Gist above
  2. Create automation using your weather entity
  3. Set target to input_text.hourly_forecast_temperatures
  4. Configure update interval (recommended: every 30 minutes)

Once configured, PumpSteer will automatically receive fresh weather data for optimal heating decisions without any manual intervention.


๐Ÿ“ฆ Helper Entities (via pumpsteer_package.yaml)

Type Entity Function
input_number indoor_target_temperature Target indoor temperature
input_number pumpsteer_summer_threshold Threshold to activate summer mode
input_number pumpsteer_aggressiveness Comfort vs savings (0โ€“5)
input_number house_inertia How slow/fast the house responds (0โ€“10)
input_text hourly_forecast_temperatures Temperature forecast (24 CSV values)
input_boolean holiday_mode Activates holiday mode
input_boolean autotune_inertia Allow system to adjust house_inertia
input_select pumpsteer_price_model Price classification model (hybrid or percentiles)
input_datetime holiday_start / holiday_end Automatically enable holiday mode

๐Ÿงช Forecast Format

input_text.hourly_forecast_temperatures must contain exactly 24 comma-separated temperature values (ยฐC):

-3.5,-4.2,-5.0,-4.8,โ€ฆ (total 24 values)

If the format is invalid, an error will be logged and the forecast ignored.


๐Ÿ“Š Sensor: sensor.pumpsteer

This sensor is the main output of the integration.

State:

Virtual (fake) outdoor temperature sent to your heat pump.

Attributes:

Attribute Meaning
Mode heating, neutral, braking_mode, summer_mode
Fake Outdoor Temperature Calculated temperature sent to the heat pump
Price Category Classification of current electricity price
Status System status, e.g. "OK" or error messages
Current Price Current electricity price in SEK/kWh
Max Price Highest price of the day
Aggressiveness Comfort vs savings (0โ€“5)
Inertia Estimated house inertia
Target Temperature Desired indoor temperature
Indoor Temperature Current indoor temperature
Outdoor Temperature Real outdoor temperature
Summer Threshold Threshold for summer mode
Braking Threshold (%) Percent threshold to trigger braking
Price Factor (%) Position of current price within daily range (0% = min, 100% = max)
Holiday Mode Whether holiday mode is active
Last Updated Last update timestamp
Temp Error (ยฐC) Deviation from target indoor temperature
To Summer Threshold (ยฐC) Distance to triggering summer mode
Next 3 Hours Prices Upcoming electricity prices
Saving Potential (SEK/kWh) Potential savings from current price
Decision Reason Reason for current decision
Price Categories All Hours Classification for all hours
Current Hour Current hour of the day
Data Quality Availability and completeness of input data

๐Ÿง  Sensor: sensor.pumpsteer_ml_analysis

ML sensor showing analysis and recommendations based on your house's behavior.

Attributes:

Attribute Description
success_rate How often the system reached the target temperature
avg_heating_duration Average heating session duration (min)
most_used_aggressiveness Most used aggressiveness level
total_heating_sessions Total number of sessions
recommendations Text suggestions based on system performance
auto_tune_active If automatic inertia adjustment is active
last_updated Last analysis update timestamp

Recommendations can be shown in UI or in markdown cards.


๐Ÿง  How it works

PumpSteer controls your heat pump's perceived demand using a fake outdoor temperature:

  • Slightly increases heating (1 ยฐC overshoot) only when electricity prices are very cheap
  • Avoids heating when prices are high
  • Goes to neutral mode when stable
  • Disables heating when it's warm outside (summer mode)
  • Pre-cools ahead of warm periods when the forecast exceeds the summer threshold
  • Lowers target temp to 16 ยฐC during holidays
  • Learns over time how your house reacts and adjusts settings (if autotune_inertia is enabled)

All control is done locally without any cloud dependency.


โ“ FAQ

Can PumpSteer directly control my heat pump?

PumpSteer does not talk to the heat pump over Modbus, REST, or any proprietary interface. Instead, it exposes the calculated value as a Home Assistant sensor (sensor.pumpsteer) that represents a[...]

What is thermal inertia and how is it calculated?

house_inertia describes how quickly your building responds to heating or braking. A low value (โ‰ˆ0.5โ€“1.5) means the house reacts fast, so PumpSteer can shift temperatures aggressively. A high val[...]

If you enable input_boolean.autotune_inertia, the machine-learning module keeps track of every heating session: it records how far the indoor temperature was from the target, how long it took to rec[...]

What does the ML module actually learn?

The ML collector watches the indoor temperature, target temperature, aggressiveness, and inertia during every heating cycle. It estimates success rate, typical heating duration, and how often comfort [...]

Which sensors must be connected to PumpSteer?

The integration needs:

  • Indoor temperature sensor (input_number.indoor_target_temperature + actual indoor temperature entity)
  • Outdoor temperature sensor
  • Electricity price sensor
  • Optional: hourly outdoor temperature forecast, holiday switches, etc.

You do not need to provide flow temperature, set-point, compressor status, or other proprietary heat pump sensors. As long as the heat pump follows the virtual outdoor temperature, PumpSteer can o[...]

How is the PumpSteer efficiency score calculated?

sensor.pumpsteer_efficiency_score is an informative metric that blends comfort and savings on a 0โ€“100 scale. It takes the absolute indoor temperature error (penalising large deviations) and the cu[...]


๐Ÿ› ๏ธ Logging

  • Errors and warnings are logged in Home Assistant
  • Sensor shows unavailable when data is missing
  • ML data is stored in pumpsteer_ml_data.json (max 100 sessions)
  • Auto-tuned inertia is saved in adaptive_state.json

๐Ÿงช Note

This is a hobby project built with the help of ChatGPT, Copilot, and a lot of patience. Feedback and improvement ideas are always welcome.


๐Ÿ”— Links


License

As of version v1.6.2, this project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). Previous versions (โ‰ค v1.5.1) are available under the Apache License 2.0.

ยฉ Johan ร„lvedal

About

Smart Home Assistant integration for heat pump optimization based on electricity price and temperature.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages