Algorithm to decide on electricity price is high or low based on historical prices

That’s interesting I have the same setup.
The tricky part for me is to calculate how many hours I need to heat the house, there are many factors:

  1. Sunny or cloudy day - sunny day the heat from sunshine will heat the rooms faster
  2. Temperature outdoor?
  3. Current rooms’ temperatures - this is by far the worst as different room have different characteristics, some room heat faster than others.
    Can you reveal the idea behind your solution?

I currently have a very simple schedule, basically turn off the compressors when el is expensive. In my country the most expensive hours during winter is 17-21, there is *almost no exception (I find one with flat price almost whole day, it’s because the state adds a ridicularly high tax during this period) based on what I observed in the past year. So I just turn off compressor for ventilation and geothermal heating during this period. I leave the hot water on as I have small tank but I lower the temperature so the compressor kicks in as late as possible. Same thing I do if in the morning 6-9AM el is expensive. The modern heat pumps are quite smart already, it will stop consume energy when set temperature is reached.

Can I ask what is your consumption annually? Have you compared the average price? I find last year’s price was lower in my area.

That looks interesting - in my case it’s simpler, el car is only for work and I never need it for more than 150km. Use Tesla binding I know the remaining battery, and I could just check if during night is cheap or expensive to charge, if cheap I will schedule full charge, otherwise only charge to 30% which is more than I need. When I arrive home with the car I will receive a reminder from OpenHAB in case it finds suitable to charge, and in summer I hardly charge more frequently than once per week. In winter maybe twice per week.

I’m now trying to plot the wind speed data from OpenWeatherMap and el price. I believe there is strong correlation (what I got for 1 month data):

Something for example: if tomorrow’s wind speed above 30km/h, there is a chance the el price will be lower than today (maybe I need some safety margin). It’s not going to be right every time, but as soon as it’s right more than 50% of time I’m happy :slight_smile:

Yes, there is a strong correlation but you can also see from this sample with a naked eye that the wind speed is not the only factor in this as it does not explain all the peaks and dips in your screenshot.

In other words, there are other significant factors. Like outdoor temperature (especially during winter when people need to heat their houses), day of the week (many factories are closed during weekends), time of the day (many factories are closed during nights, people tend to use kitchen more at certain times), public holidays, downtime of production facilities (see Nordpool UMM messages), downtime of major factories like paper mills and steel factories that normally consume lots of electricity (see Nordpool UMM messages), downtime of transfer lines between the countries and areas within countries (see Nordpool UMM messages).

Point being: there are so many factors that you need a machine learning model for this. The best model I’ve seen for this is the Sahovatkain I linked earlier and even that is not very accurate anymore.

I’m more than happy to, because I believe these kind of algorithms want to be open. And secondly, I firmly believe that discussing the concepts with others make them better.

I had a long and very good brainstorming with the maintainer of Pörssäri (porssari.fi) who has developed a popular optimizing solution in Finland. Our conversation is in Finnish but you can use Google Translator or ChatGPT or any other translator of your choice to see how the concept evolved.

The discussion starts here:

And here’s what it evolved to, this is what the next version of openhab-spot-price-optimizer will do once I publish the next version:

I have an exhaust air heatpump, with water-based heating (under-floor on the ground floor and radiators upstairs). So like you I can store a lot of heat in the concrete baseplate. But the problem is that the heatpump is not powerful enough to concentrate the heating to a few hours without the electric add-on kicking in, leading to 3 times higher electric consumption for ~ 1.75 times the heat output. The only time this would save me money is if the price is significantly cheaper (< 1/3 of the rest of the day) during those hours. The compressor shuts down if the inside temperature drops below 17, so that’s also a risk if waiting too long between heating sessions, especially if we lower the wanted temperature to 19 due to an expensive winter.

The heatpump already calculates the heating demand based on the outside temperature, but ideally I would also like to make some corrections based on forecast, to prevent over/under heating if there’s a rapid change in temperature. I already lower the setpoint when it’s sunny, since that heats our house quite a lot.

Note for myself: when I was on vacation I captured the temperature drop of my water tank

Anybody know a good way to create equation based on the data points?

ChatGPT recommended Desmos.com or just providing the data for chatgpt so that it can give you the equation for the curve.