Dynamic Strategy Setup
The dynamic flow is provided for automated charging/discharging based on changing hourly rates. This is only relevant if you have a dynamic/hourly contract.
How it works
The strategy will periodically check for new tariff data from your supplier. You can configure which strategy to use during:
- Cheapest hours: Choose between
Charge(from grid) orCharge PV(solar only) - Expensive hours: Choose between
Self-consumptionorSell(to grid) - Regular hours: Choose between
Charge PV(default),Self-consumption, orFull stop
Smart thresholds ensure periods only activate when economically beneficial.
View the explanation videos of the general idea behind this strategy:
- How to SETUP dynamic: English text and subtitles, NL spoken: https://youtu.be/PR1XA5GUlAE
- How to USE dynamic: English text and subtitles, NL spoken: https://youtu.be/PR1XA5GUlAE
Solar prediction
Tuning of charging levels (SoC) based on PV Forecast can be created by you as a user. Via handmade automations or flows setting the now available SoC and threshold fields. The project will move towards built-in integration in the future.
SETUP - getting dynamic up and running
- Install Cheapest Energy Hours if you have not done so already
- Provide data from your Energy supplier to Home Assistant. See this easy list with addons from TheFes.
- Follow any instructions provided by the Data Provider addon.
- Tip: is your energy supplier not supported? Use ENTSO-e.
- Import the
02 strategy-dynamic.jsonflow into Node-RED and deploy - Go to your Home Battery Control dashboard in HA
- Select
Full controlandDynamicto activate the strategy
- Select
- Go to 2nd tab, this shows
timedanddynamicplanning- Select your energy supplier from the dropdown
- The dashboard should (with a small delay) display when it will be charging/idle/discharing in the next 24 hrs.
- Minimum price delta
- Leave the price delta at €0,06/kWh or set it to your desired value
- For a Marstek bought at ~ €1250, 6000 cycles at 88% DoD and an 80% RTE = delta at €0,06/kWh
- If you charge largely using solar power, you can lower the price delta down to €0,00/kWh
Done.
Need an example of a Data Provider utilizing a blueprint and template sensor? See Nordpool (core) example.
USE - the dynamic strategy
Strategy behavior per period
- Regular hours: Select baseline strategy (default:
Charge PVto capture surplus solar power) - Cheapest hours: Select charging strategy (default:
Chargeto charge from grid at lowest rates)- Only activates when average tariff is below configured threshold
- Expensive hours: Select discharge strategy (default:
Self-consumptionto reduce grid usage)- Only activates when price spread exceeds minimum delta threshold
Note the dynamic and timed strategy share settings for charge / charge pv / self-consumption.
Dashboard controls
Energy supplier / Data source
- Select your
energy supplierfrom the dropdown to fetch hourly pricing data - The system needs this to determine when to charge and discharge
Cheapest avg tariff is below (cents/kWh)
- The
cheapest period thresholddetermines when the cheapest period activates - Cheapest hours only activate when average tariff is at or below this value
- Prevents charging from grid when even “cheap” hours are still expensive
Minimum spread (cents/kWh)
- The
minimum price spreadis required between cheap and expensive hours before the expensive period activates - Set based on your battery’s round-trip efficiency and cost per cycle
- Lower this value if you charge primarily with solar power
Cheapest hours (number)
- How many of the
cheapest hoursper day to use for charging from grid - The system automatically finds the cheapest consecutive hours in your data source (often: the current and next day)
Expensive hours (number)
- How many of the most
expensive hoursper day to use for self-consumption (discharging) -
The system automatically finds the most expensive block of consecutive hours in your data source (often: the current and next day)
- Only activates if the
minimum price deltathreshold is met. Otherwise grid power is cheaper than the energy stored in your battery.- it will remain in charge PV mode during
expensive hoursif the threshold is not met.
- it will remain in charge PV mode during
FAQ
- (Optional) guarantee self-consumption during
expensive hours?- Set the
minimum price deltato €0,00 if you always want to switch to self-consumption during expensive hours.
- Set the
- (Optional) want self-consumption throughout the day?
- Set
expensive hoursto 24 -cheapest hours. E.g. you charge during 2 cheapest hours? Set expensive to24 hrs - 2 hrs = 22 hrs - Set
minimum price deltato €0,00 to make sure the strat activates.
- Set
Period start/end times (read-only)
- Shows when the
cheapestandexpensiveperiods start and end - Automatically calculated by the system based on your energy price data
Average tariffs display
- Expensive period: Shows the average price during discharge hours
- Charged at: Shows the average price during charging hours
- Price delta: The difference between expensive and cheap periods
Examples
Nordpool (core)
- Install Nordpool Core integration (link)
- Install Cheapest Energy Hours integration trough HACS (link)
- Install blueprint from Cheapest Energy Hours (link)
- Put following code into your template.yaml file, make sure that file is linked from your configuration.yaml file
- use_blueprint:
path: TheFes/energy_price_sensor.yaml
input:
entity_id: sensor.nordpool_ceh_prices
source: nordpool
resolution: 15
name: Nordpool Cheapest Energy Hours
unique_id: 881b6558-26c6-44bb-81c5-d86c05451bd4
- Now you have a sensor called sensor.nordpool_ceh_prices
- Replace this sensor name in the Node Red flow for Dynamic Strategy as show in this first post: go to Node Red, select tab Strategy Dynamic, double click ‘Data Source Settings’
- Probably you have to wait some time until data is loaded

