Advanced Heat Pump Optimization (PV or w/o PV, Battery & Weather Aware)

:star2: Advanced Heat Pump Optimization (PV & Grid Optimized)

:arrows_counterclockwise: Update: Version 1.5

Changelog

:arrows_counterclockwise: Update: Version 1.5

:broom: Refactor: Internal automation structure streamlined – The blueprint was cleaned up internally for better readability and maintainability without changing the intended control behavior.

:zap: Optimization: Weather forecast call now only runs in the 12:30 midday branch – Previously, the forecast service call was executed on every trigger, even when not needed. It is now scoped only to the midday decision logic.

:shield: Improvement: Unnecessary number.set_value calls are now avoided – The automation now checks whether the target correction value is already active before writing it again. This reduces no-op writes and keeps traces cleaner.

:repeat: Restore: Zone Yellow (Smart Gliding) now fully includes the original flow temperature safeguard again – The soft-limit glide-down only applies when the actual flow temperature is still below the target flow temperature plus hysteresis, preserving the original anti-cycling behavior.

:jigsaw: Improvement: Additional blueprint inputs added for full flexibility – Flow actual sensor, flow target sensor, PV cutoff threshold, and load cutoff sun elevation are now configurable in the blueprint so users can adapt the logic without editing YAML directly.

:white_check_mark: Behavior preserved: Core logic and priorities remain unchanged – Zone Red, Zone Yellow, Morning Boost, Midday Matrix, and Safety Cutoff still follow the same priority structure and default operating behavior as before.

:arrows_counterclockwise: Update: Version 1.4

:bug: Fix: 12:30 Midday Check – No longer overrides active Cutoff – When the indoor temperature was already at or above the soft limit at 12:30, the automation previously fell into the default branch and reset the correction value to 0, overriding an active cutoff (e.g. -4). The default block now does nothing (default: ), leaving the current value untouched.

:arrows_counterclockwise: Update: Version 1.3

:bug: Fix: Zone Yellow (Smart Gliding) – The correction value could unintentionally drift into negative territory when the trigger fired multiple times in a row. Added a lower boundary of 0.0 (| max). Negative values remain exclusively reserved for Zone Red & Cutoff.

:wrench: Fix: Cutoff Trigger – Replaced trigger: state on grid_consumption_sensor with numeric_state above: 0. Prevents rapidly fluctuating PV/consumption values from continuously resetting the 5-minute timer, which could cause the cutoff to never fire.

:broom: Cleanup: Redundant trigger removed – sun.elevation below: sun_elevation_trigger was redundant since the evening logic is already fully evaluated inside the condition block.

Blueprint updated in Gist – import link stays the same. :white_check_mark:

Hi everyone,

I developed this blueprint to turn my “dumb” heat pump into a smart energy manager.
It works for systems WITH or WITHOUT a home battery!

The goal is simple:

  1. Store energy in the floor (thermal storage) when the sun shines.
  2. Stop heating immediately when household consumption exceeds PV production (to prevent grid import or battery drain).

It works with any heat pump that allows a target temperature correction (parallel shift) via Home Assistant (e.g., Luxtronik, Vaillant, etc.).

:bulb: No PV? No Problem!
Even if you don’t have solar panels, you can use this blueprint to heat up your home when outside temperatures are high (better efficiency/COP) or when electricity prices are low (Dynamic Tariffs). Simply create a template sensor that outputs “2000 W” when energy is cheap, and feed that into the PV Power Sensor input.

:sparkles: Key Features

  • :sun_with_face: Adaptive PV Boost: Dynamically increases the heating curve (+1.0K to +3.0K) around noon…
  • :moneybag: Grid & Battery Saver: Hard cutoff (-4.0K) in the afternoon when the sun gets low (< 25° elevation) AND house consumption exceeds PV production.
    • If you have a battery: Prevents draining it for heating.
    • If you have NO battery: Prevents expensive grid import.
  • :fried_egg: Anti-Sauna Protection: Prevents overheating in the kitchen/living room.
    • Soft Limit: Gently reduces heating when approaching the target.
    • Hard Limit: Actively throttles the heat pump (-1.5K) if the room gets too hot (e.g., due to cooking or passive solar gain).
  • :battery: Battery & Grid Protection: Hard cutoff (-4.0K) in the afternoon when the sun gets low (< 25° elevation) AND house consumption exceeds PV production (e.g., cooking dinner or charging an EV). This prevents draining the battery for floor heating.
  • :snowflake: Weather Forecast Integration: Proactively increases heating (+1.0K) during the day if the forecast for the coming night drops below 4°C.
  • :shield: Anti-Cycling Logic: Includes a 5-minute filter for passing clouds or short load spikes (microwave) to prevent the heat pump from turning on/off rapidly.

:gear: Requirements

To use this blueprint, you need:

  1. Indoor Temperature Sensor (e.g., in your main living area).
  2. Outdoor Temperature Sensor.
  3. PV Power Sensor (in Watts).
  4. Grid/House Consumption Sensor (in Watts).
  5. Weather Entity (configured in HA).
  6. Heating Correction Entity (Number entity that shifts the target temperature, e.g., number.heating_target_correction).

:inbox_tray: Import Blueprint

Import Blueprint


How it works:
The automation runs throughout the day. It starts with a pre-heat in the morning, switches to a matrix-based logic at noon (checking sun/clouds), and switches to a “safety mode” in the evening to protect your battery.

Let me know if you have any questions or suggestions for improvement!


:heart: Support my work

If this blueprint saves you some money on your energy bill, feel free to support my work!
:coffee: Buy me a coffee via PayPal