Energy
Heating on the cheap night tariff (and what it saved)
How I use a two-rate electricity plan to heat a Polish house in winter with a heat pump, what November really cost, and a step-by-step guide to copying it.
When we bought the house, the heating had been left on constantly and set very high. That was never going to be cheap, and it made me think hard about the one number that matters most in winter: what each unit of electricity costs.
Our house is heated by an electric heat pump, so heating is our biggest use of electricity. In Poland I’m on a two-rate plan called G12w. Electricity costs about 27.5 euro cents per kWh on weekdays from 06:00 to 13:00 and from 15:00 to 22:00, and about 14 euro cents the rest of the time, which includes every weekend and public holiday. All the prices in this post are in euros. If you’re British, think of it as Economy 7 with a longer cheap window.
The cheap rate is about half the price, so the plan is simple. Buy heat when it’s cheap, and coast through the expensive hours.
Want to copy it? Skip straight to how to set it up.
Why it works in our house
We have underfloor heating, and a floor holds its warmth for hours. If the house is warm when the expensive rate starts, it takes a long time to cool. So Home Assistant switches the heat pump to making only hot water during the expensive hours, and lets the house coast.
I don’t want to be a cold martyr for the sake of a few euro cents, so there are two safety rules. If the room temperature falls below 21°C, or it’s colder than -5°C outside, the heating comes back on, whatever the price. Comfort wins.
The hot water tank works the same way. During the expensive hours it’s only topped up if it’s nearly empty. It’s heated properly in the cheap hours, overnight and in the early afternoon.
What I got wrong first
My first version pushed the floors hotter in the small hours, to store lots of cheap heat. It worked, but it was too warm at night, and we kept waking up. I turned the night temperature down. Now we sleep well and wake up to a warm house.
Then there was the thermostat. One room’s thermostat had broken, so my wife’s office wasn’t heating at all. I had set everything up and not checked every room, so I was in trouble. Claude helped me track it down and it was an easy fix. The lesson is to check the temperature in every room after you set this up, not just the one you sit in.
Is it warm enough?
Yes. It’s comfortable enough that I walk around in shorts and a T-shirt, although I do run hot. My wife is comfortable as well, which is the more important test. That includes the days at around -10°C.
What it saved
We moved in during autumn, so I don’t have a winter of the same house without these rules to compare. Here’s what I can say honestly, using November, the first properly cold month.
- The house used 779 kWh from the grid.
- 77% of that was at the cheap rate. The cheap hours make up only about 61% of the month, so we used more than our share of cheap electricity.
- At the two rates, that comes to about €134. The actual invoice was €140, which includes about €7 of fixed monthly charges, so the sums hold up.
- The average price I paid was about 17 euro cents per kWh, which is 37% below the 27.5 euro cent daytime rate.

My Energy dashboard for November. Each bar is one day. The grid supplied 779 kWh, and the panels added about 18 kWh, which makes the 797 kWh total.
How much did I save? I can give you a range, not a single figure:
- Buying every unit at the daytime rate would have cost about €215, which is €80 more. But nobody does that, because every house uses some power at night and at weekends.
- If we had used electricity evenly through the week, with no effort to shift it, I’d have paid about €16 more. That’s the cautious figure.
The truth is somewhere in between, and probably closer to the cautious end for now. Most of the benefit is in what we avoid: heating the house with the most expensive electricity of the day. I’ll update this post when I have a colder month to measure.
One more thing. We have solar panels, and in summer they cover nearly everything, so some of our bills were just a few euros of fixed charges. In November the panels gave almost nothing, about 18 kWh in the whole month, which is why the tariff matters so much in winter. I’m still working on getting the panels’ own data into Home Assistant properly, so that’s a post for another day.
How to set it up yourself
This works with any heat pump, or any heating you can control from Home Assistant, as long as you have a time-of-day tariff. I use a Stiebel Eltron heat pump, and the names of the modes will be different on yours.
What you need
- A time-of-day electricity plan, such as G12w in Poland or Economy 7 in the UK. You’ll need the hours of the expensive rate.
- A working Home Assistant.
- Something that heats the house and that Home Assistant can control, such as a heat pump with a “mode” setting or a thermostat.
- A room temperature sensor and an outdoor temperature sensor.
Find your expensive hours
Look at your plan or your bill. Write down which hours are expensive, and whether weekends and public holidays are cheap. In my case the expensive hours are weekdays from 06:00 to 13:00 and from 15:00 to 22:00, and holidays are cheap.
Add the Workday integration
Home Assistant needs to know which days are public holidays. Go to Settings, then Devices & services, press Add integration, type workday and choose Workday. Pick your country, and leave the defaults, which count Monday to Friday as workdays and exclude public holidays. You’ll get a sensor called Workday Sensor, which is on only on normal working days.
Make a “peak rate” sensor
Go to Settings, then Devices & services, then Helpers, press Create helper, and choose Template, then Template a binary sensor. Name it Peak electricity rate and paste this as the state template, using your own hours:
{% set h = now().hour %}
{{ is_state('binary_sensor.workday_sensor', 'on')
and (6 <= h < 13 or 15 <= h < 22) }}
It reads: “it’s a working day, and it’s between 06:00 and 13:00 or between 15:00 and 22:00.” The sensor is on during the expensive hours and off otherwise. Check it on a weekday morning and again on a Sunday to be sure it behaves.
Choose what to change at the expensive rate
You need something to turn down when the rate goes up. For a heat pump like mine, that’s a mode that makes only hot water. Open the heat pump’s operation mode entity in Home Assistant and look at its list of options, so you know what yours are called. If you have ordinary thermostats instead, lowering their target temperature by a couple of degrees does the same job.
Create the automation
This is the automation, with generic names. Swap in your own sensors and your own mode names. I use “eco” for normal operation and “water_heating” for hot water only.
alias: Heating - hold during peak rate
triggers:
- trigger: state
entity_id: binary_sensor.peak_electricity_rate
- trigger: numeric_state
entity_id: sensor.living_room_temperature
below: 21
- trigger: numeric_state
entity_id: sensor.outdoor_temperature
below: -5
- trigger: homeassistant
event: start
conditions:
- condition: template
value_template: "{{ now().month in [10, 11, 12, 1, 2, 3, 4] }}"
actions:
- variables:
hold: >-
{{ is_state('binary_sensor.peak_electricity_rate', 'on')
and states('sensor.living_room_temperature') | float(0) >= 21
and states('sensor.outdoor_temperature') | float(-99) >= -5 }}
- choose:
- conditions:
- condition: template
value_template: "{{ hold }}"
- condition: state
entity_id: select.heat_pump_operation_mode
state: eco
sequence:
- action: select.select_option
target:
entity_id: select.heat_pump_operation_mode
data:
option: water_heating
- conditions:
- condition: template
value_template: "{{ not hold }}"
- condition: state
entity_id: select.heat_pump_operation_mode
state: water_heating
sequence:
- action: select.select_option
target:
entity_id: select.heat_pump_operation_mode
data:
option: eco
mode: single
What it does: during the expensive hours, in the heating season only, it switches to hot-water-only. It switches back when the cheap rate starts, or sooner if a room falls below 21°C or it drops below -5°C outside. It only touches the mode when the pump is in the mode it expects, so if you’ve chosen a different mode by hand, it leaves it alone. The “start” trigger makes it check again after Home Assistant restarts.
Shift the hot water as well (optional)
Hot water is a big part of the bill. This second automation lowers the hot water temperature during the expensive hours, so the tank only reheats then if it’s nearly empty, and sets it back for the cheap hours. Use your own entity and temperatures:
alias: Hot water - cooler at peak rate
triggers:
- trigger: state
entity_id: binary_sensor.peak_electricity_rate
- trigger: homeassistant
event: start
actions:
- action: number.set_value
target:
entity_id: number.heat_pump_hot_water_target
data:
value: "{{ 42 if is_state('binary_sensor.peak_electricity_rate', 'on') else 50 }}"
Don’t leave the tank cooler than about 50°C for days on end. The tank should reach 50°C regularly, and with this automation it does, because every cheap period sets it back.
Check every room
Wait a few days, then look at the temperature in every room, not just the one you sit in. A room that stays cold usually has a thermostat or a valve problem. Mine did.
Find out what it saved
Home Assistant’s Energy dashboard splits your electricity into the cheap and expensive rate if your meter reports both, and many Polish smart meters do. Compare the share at the cheap rate before and after, and then look at your bill.
If something goes wrong
- The house is too cold in the morning. Raise the temperature threshold in the automation, or heat it a bit more in the last cheap hours.
- It’s too warm at night. Lower the night temperature, as I had to. More heat is not always better.
- One room stays cold. Check that room’s thermostat, and its battery if it has one.
- The sensor is on at the wrong times. Check the Workday integration’s country, and that your hours match your plan.
- The mode doesn’t change. Open the automation’s trace in Home Assistant. The most common cause is a mode name that doesn’t match your heat pump exactly.
The plan doesn’t change how much heat the house needs. It only changes when you pay for it, and for us that’s been a good trade. Start with the sensor, watch it for a few days, and add the automation when you’re happy it’s right.