
Home Assistant: What’s New in AIO Energy Management 1.1.0 – 1.4.0
It’s been a busy autumn! Since the 1.0.0 release and the Excess Solar feature back in April, AIO Energy Management has received four feature releases. Most of the work went to the Cheapest Hours side of the integration: smarter slot selection, a completely new configuration UI and a way to define your tariffs and taxes only once.
Something I’m really happy about is that a big part of these releases didn’t come from me at all. The community has stepped up big time, and I’ll give credit where it belongs along the way 🙂
In this article I’ll go through what’s new in each version from 1.1.0 to 1.4.0 and show examples of how to use the new features. I’m using the UI for most of the setup nowadays, but I’ll show the YAML too, since it’s the most compact way to present the options (and YAML is still fully supported).
Heads-up: 1.2.0 and 1.3.0 contain breaking changes. If you’re updating from 1.0.x, read at least the Breaking changes sections below before hitting the update button.
TL;DR – short summary
- 1.1.0: Flexible slots (add_flexible), fall back to today’s prices when tomorrow isn’t published yet
- 1.2.0: Global Settings, minimum block size (min_seq_slots), fixed number of blocks (number_of_blocks). Breaking: no offset for non-sequential sensors
- 1.3.0: New setup wizard and settings menu, flexible slots for sequential sensors, max_price_delta, Nord Pool Official throttling. Breaking: max_number_of_slots now counts the total
- 1.4.0: Global price modifications, edit several settings pages and save once, rewritten min_seq_slots logic
1.1.0 – Flexible Slots
Flexible slots (add_flexible)
This one was requested in issue #105, and it’s a feature I use myself for the outdoor hot tub.
Normally you tell the sensor “give me the 5 cheapest hours”, and that’s what you get. Even when the electricity is practically free the whole night, you still only get 5 hours. With flexible slots the sensor always takes the base number_of_slots, but keeps adding more slots while the price stays cheap enough.
Example: always heat the water for at least 5 hours, but if the price drops under 5 c/kWh, keep heating for up to 10 hours:
aio_energy_management:
cheapest_hours:
- nordpool_entity: sensor.nordpool
unique_id: hot_tub_cheapest_hours
name: Hot Tub Cheapest Hours
first_hour: 21
last_hour: 12
number_of_slots: 5
sequential: false
add_flexible:
max_number_of_slots: 10
price_limit: 5.0
Both max_number_of_slots and the flexible price_limit also accept an entity id, so you can tune them from the dashboard with an input_number instead of reconfiguring the sensor:
add_flexible:
max_number_of_slots: input_numberhot_tub_max_hours
price_limit: input_number.hot_tub_cheap_price
Works with inversed: true too: then the extra slots are added while the price stays above the limit. Handy for finding a longer “avoid” window when prices spike.
Note: the meaning of max_number_of_slots changed in 1.3.0. The example above is already written the 1.3.0+ way, where it means the total. See the 1.3.0 section.
Fall back to today’s prices
Before 1.1.0 the calculation simply waited until tomorrow’s prices were published. Now, if tomorrow’s prices aren’t available, the sensor calculates using today’s prices as long as the time window fits into today. So a daytime sensor such as first_hour: 8 / last_hour: 16 no longer has to wait for the next day’s prices when you set it up in the morning or restart Home Assistant. Overnight windows (e.g. 21 → 12) still wait for tomorrow’s prices, for obvious reasons. This is especially handy when testing out new configurations!
You don’t need to configure anything. Thanks @stefanovic45 for this one!
1.2.0 – Global Settings and Block Control
Global Settings
There’s a new ⚙️ Global Settings entry in the integration. There is always exactly one, it’s created automatically, and it holds the settings that are shared by the whole integration. In 1.2.0 that meant the calendar: Enable calendar and Calendar name (default Energy Management).
The old standalone Calendar config entry is gone. If you had one, it’s migrated into Global Settings automatically on the first start. The calendar keeps its entity id, so your dashboards and automations continue to work.
You’ll find it under Settings -> Devices & Services -> AIO Energy Management -> Global Settings -> Configure.
Minimum block size (min_seq_slots)
Non-sequential sensors pick the cheapest slots wherever they are, and with 15-minute prices that can mean your device switching on and off every 15 minutes. Not great for a heat pump or a compressor!
With min_seq_slots you can tell the sensor that every selected block must be at least this many slots long. For example: 4 hours in total with 15-minute prices, but each run must last at least an hour:
- nordpool_entity: sensor.nordpool
unique_id: floor_heating_cheapest
name: Floor Heating Cheapest
first_hour: 21
last_hour: 12
mtu: 15
number_of_slots: 16
sequential: false
min_seq_slots: 4
Leftover slots are attached to existing blocks, so you never get a block shorter than the minimum.
Fixed number of blocks (number_of_blocks)
If you know exactly how many runs you want, use number_of_blocks instead. The slots are divided into that many separate continuous blocks of balanced size. Six hours of heating split into three runs:
number_of_slots: 6
sequential: false
number_of_blocks: 3
If both are set, number_of_blocks wins and min_seq_slots is ignored. Both options are available in the UI as well.
Big thanks to @stefanovic45 who built Global Settings, the calendar migration, min_seq_slots and number_of_blocks!
Breaking change: no offset for non-sequential sensors
offset now only works on sequential sensors (sequential: true). A non-sequential selection can consist of several separate blocks, and the old implementation applied the start offset only to the very first slot and the end offset only to the very last. The result was a timeframe that didn’t match the selection and could even overlap the next one.
What happens to existing configurations:
- UI: the offset step is hidden for non-sequential sensors, and reconfiguring such a sensor clears the stored offset.
- YAML: the offset is ignored and an error is logged. Remove the
offsetblock, or switch tosequential: trueif you really need it.
1.3.0 – New Configuration UI and Smarter Flexible Slots
A new setup wizard and settings menu
The cheapest hours UI got a full overhaul. Creating a sensor is now a short wizard: data provider -> price source settings -> basic settings, and you’re done. All the rest lives in the settings menu that opens from Configure:
- Price data provider
- Basic settings (now also including Add to calendar and Inversed)
- Advanced settings
- Flexible slots
- Time offset (only shown for sequential sensors)
The Allow dynamic entities and Use offset toggles are gone. Entity-based values now live in a collapsible Dynamic entities (Optional) section on each page. Much cleaner! Again, a huge thanks to @stefanovic45 for the overhaul.
Flexible slots for sequential sensors
Flexible slots now work with sequential: true too. The sensor first picks the cheapest continuous block of number_of_slots, then grows it one slot at a time at either end, always taking the cheaper neighbour, while the price stays within the flexible limit. The result is always one contiguous block inside the first_hour / last_hour window.
This is perfect for things that must run in one go but where a longer run is a bonus, like a dishwasher-plus-dryer combo or the sauna… or charging the car:
- nordpool_entity: sensor.nordpool
unique_id: ev_charging_block
name: EV Charging Block
first_hour: 18
last_hour: 7
number_of_slots: 3
sequential: true
add_flexible:
max_number_of_slots: 8
price_limit: 4.0
Thanks @rmeerkat for implementing this!
Relative limit: max_price_delta
A fixed price limit is easy to understand, but prices vary a lot between seasons. A limit that’s perfect in summer never triggers in winter. The new max_price_delta is relative: extra slots are added while their price is within the given amount of the cheapest price in the window (the most expensive one when inversed).
Example: always 4 slots, and up to 10 if they cost at most 2 c/kWh more than the cheapest slot of the night:
number_of_slots: 4
sequential: false
add_flexible:
max_number_of_slots: 10
max_price_delta: 2.0
Use either price_limit or max_price_delta inside add_flexible, not both. And yes, it can also be an entity id.
Flexible slots now also respect min_seq_slots and number_of_blocks: the total number of slots is decided first, and then the block layout is applied to it.
Nord Pool Official throttling
Sensors using the Nord Pool Official integration now wait at least 5 minutes plus a random 0–5 minutes between fetch attempts. With many sensors this spreads out the API calls nicely. Other providers read the prices from entity attributes and aren’t affected.
Breaking change: max_number_of_slots is now the total
Before 1.3.0, add_flexible.max_number_of_slots meant extra slots on top of number_of_slots. Now it means the total, base slots included (#214).
number_of_slots: 5
add_flexible:
max_number_of_slots: 21
# 1.2.x: up to 5 + 21 = 26 slots
# 1.3.0: up to 21 slots
If you used flexible slots before, add your number_of_slots to max_number_of_slots to get the same result as before. A value lower than number_of_slots is raised automatically and a warning is logged.
Other fixes in 1.3.0
price_limit: 0is no longer ignored. Free (or negative) electricity, here we come!- Whole numbers are accepted in YAML for
price_limit,max_price,add_flexible.price_limitandadd_flexible.max_price_delta. - Integer values from entities no longer crash the update.
- Less debug log noise.
1.4.0 – Global Price Modifications
Global price modifications
This is my favourite of the latest release. Price modifications let you add your transfer tariffs and taxes to the spot price (or convert Nord Pool Official’s EUR/MWh to c/kWh). The problem was that the template had to be copied into every single sensor. I had six sensors with the same template, and every time my electricity contract changed I had to update all of them. Not anymore!
Open ⚙️ Global Settings -> Configure and write the template once into Global price modifications. It uses the same price and time variables as the per-sensor template. My example: Nord Pool Official price to c/kWh, 25.5% VAT and a day/night transfer tariff:
{%- set as_snt = price / 10.0 %}
{%- set with_taxes = (as_snt * 1.255) | float %}
{%- if time.hour >= 22 or time.hour < 7 %}
{{ with_taxes + 3.1 }}
{%- else %}
{{ with_taxes + 5.0 }}
{%- endif %}
Then each cheapest hours sensor chooses its Price modifications source in its advanced settings:
| Source | What it does |
|---|---|
| Global | Uses the template from Global Settings. Default for new sensors created in the UI. |
| Custom | Uses the sensor’s own template. |
| None | Uses the prices as they are. The sensor’s own template is kept but not used. |
YAML sensors can use the global template too with the new price_modifications_mode option. Global Settings itself exists only in the UI, so define the template there:
- nordpool_official_config_entry: 01K07FX4QRHEZW8GHSK3KT1ESY
unique_id: my_cheapest_hours
name: My Cheapest Hours
first_hour: 21
last_hour: 12
number_of_slots: 3
sequential: false
price_modifications_mode: global
A few things worth knowing:
- Existing sensors keep working as before. Sensors created before 1.4.0 use
customif they have a template, otherwisenone. Nothing changes until you switch them to Global. - Changing the global template doesn’t touch plans that are already calculated. Each sensor switches to the new template on its next calculation, after the current plan expires.
- Remember that
price_limitand flexible limits are compared after price modifications, so write your limits in the modified unit (c/kWh in my example).

Edit several pages, save once
When editing a cheapest hours sensor, each settings page now returns to the menu instead of saving and closing the dialog. Change the basic settings, jump to flexible slots, tweak the offset, and press All done to save everything at once.
Smarter minimum block size
The min_seq_slots selection was rewritten. Blocks are no longer split unnecessarily, and they grow towards the cheapest neighbouring slots instead of always at the end. price_limit is now also respected when picking slots for the blocks. Note: the selected slots may differ from 1.3.0 if you use min_seq_slots, so it’s worth checking your sensors after the update.
Other fixes in 1.4.0
- Python 3.13 support restored (1.3.0 accidentally used Python 3.14-only syntax).
- The settings pages now show the current values saved through the options, not the values from when the sensor was created.
Once again a big thank you to @stefanovic45 for the min_seq_slots rewrite, the price_limit fix and the new settings menu!
Final Words & What’s Next
Four releases, two breaking changes and a lot of new options. If I had to pick the ones to try first:
- Flexible slots with
max_price_delta: more heating when it’s cheap, without having to adjust limits between seasons. min_seq_slotsif you’re on 15-minute prices and your devices toggle too often.- Global price modifications if you have more than one sensor. Set your tariffs once and forget about it.
The Excess Solar feature didn’t get much love in these releases as summer is over and no longer solar here in Finland. But it’s still on my list and will get more love once the sun is back next spring. As always, if you find a bug or have an idea, drop a comment below or open an issue on the GitHub project page. Full documentation is in the README.
And finally, thanks to everyone who contributed code, reported issues and tested the dev builds. This integration is much better because of you!
