Use Case: Thermal Model #340
Replies: 18 comments 15 replies
-
Beta Was this translation helpful? Give feedback.
-
Now i have looked more in the Thermal Model. Key is to know heating_rate and cooling_constant. I saw that EMHASS has also The machine learning regressor and looks like this could be something to use to collect data in the model and predict the heating_rate and cooling_constant. So i would collect this daily data from HA to CSV:
Now when writing this I came to a conclusion that this way I cannot get the heating_rate and cooling_constant, as these are daily values and resolution is not enough, but what i would get is prediction of next 24h heating hours and power needed, which I can feed in to deferrable load. On the other hand, if I would increase data collection resolution to 1h then i should be able to calculate heating_rate and cooling_constant as well. @davidusb-geek @werdnum , what are your thoughts? Maybe i could feed in my heating power sensor instead? From it both power and heating hours can be hourly (or even more frequent) data collected and correlated with the outside and inside temperature. |
Beta Was this translation helpful? Give feedback.
-
Hi. Yes definitely, the heating rate and cooling constant are good candidates to be predicted by the ML regressor method. However when you have your data with the correct resolution start by computing these directly over a small period and use them to set and get initial results for the thermal modeling. Then if satisfied with the results go ahead and try the ML method to predict them automatically |
Beta Was this translation helpful? Give feedback.
-
@davidusb-geek , could you guide me to the right direction of initial data collection. What would be a reasonable resolution? Hourly? I actually should have at least 7 days of data stored in HA which i can use, but i have no idea how to get it out from HA. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@werdnum does the EMHASS thermal model only currently support heating? I'm heading into summer and am looking to implement for cooling, but couldn't find any flags to switch over. I would image the model could support cooling, but is currently hard coded for heating only. |
Beta Was this translation helpful? Give feedback.
-
I forget the details but pretty sure it can do both. Either there's a sense
parameter and/or you set the heating rate negative.
— Andrew Garrett
…On Sun, 29 Sep 2024 at 16:32, Mark Purcell ***@***.***> wrote:
@werdnum <https://github.com/werdnum> does the EMHASS thermal model only
currently support heating?
I'm heading into summer and am looking to implement for cooling, but
couldn't find any flags to switch over.
I would image the model could support cooling, but is currently hard coded
for heating only.
—
Reply to this email directly, view it on GitHub
<#340 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCFXRKSYYOCCARR4KK4WLZY6NG3AVCNFSM6AAAAABNJX7ZC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZYG42DANA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Yeah set sense to cool and heating rate negative:
https://github.com/davidusb-geek/emhass/blob/master/src/emhass/optimization.py#L417
— Andrew Garrett
…On Sun, 29 Sep 2024 at 16:45, Andrew Garrett ***@***.***> wrote:
I forget the details but pretty sure it can do both. Either there's a
sense parameter and/or you set the heating rate negative.
— Andrew Garrett
On Sun, 29 Sep 2024 at 16:32, Mark Purcell ***@***.***>
wrote:
> @werdnum <https://github.com/werdnum> does the EMHASS thermal model only
> currently support heating?
>
> I'm heading into summer and am looking to implement for cooling, but
> couldn't find any flags to switch over.
>
> I would image the model could support cooling, but is currently hard
> coded for heating only.
>
> —
> Reply to this email directly, view it on GitHub
> <#340 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACCFXRKSYYOCCARR4KK4WLZY6NG3AVCNFSM6AAAAABNJX7ZC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZYG42DANA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
@werdnum , i'm preparing the thermal model as well to start controlling and optimimizing my heating. I thing I see current model does not take account is Coefficient of Performance (COP), which significantly affects the relationship between the electrical energy consumed and the actual heat energy delivered. The COP depends on outdoor temperature and directly influences how much energy the heat pump outputs relative to the electricity it consumes. When the COP is involved, the amount of heating power delivered is not simply the electrical power consumed by the heat pump but rather: With warm outside temp like +10 C, COP can be 4 or even more, but -20C it's 1, so there is heat energy equals electricity energy. I understand that the model currently has heating energy and it's assumed to be equal to electricity energy. I would suggest to add the COP to the equation, but it's quite individual to different heating elements and probably not linear, which makes it complicated to implement. |
Beta Was this translation helpful? Give feedback.
-
The thermal model uses the heating constant as a crude conversion factor
between electrical power used and change in temperature. It's defined as
the amount the temperature will go up if the heating runs at full blast for
an hour, neglecting losses to the outside which are modelled using the
cooling constant.
There are too many variables to attempt a conversation from first
principles between power input and temperature rise. The COP is one, the
air volume of the conditioned space is another, as is thermal mass and so
on. You can capture all of those effects with a single constant by
observing (I basically just eyeballed it from a graph) the temperature rise
from running your system at full blast for an hour. My number is 3-5°C but
yours will probably be different.
— Andrew Garrett
…On Tue, 1 Oct 2024 at 20:14, martinarva ***@***.***> wrote:
@werdnum <https://github.com/werdnum> , i'm preparing the thermal model
as well to start controlling and optimimizing my heating.
I thing I see current model does not take account is Coefficient of
Performance (COP), which significantly affects the relationship between the
electrical energy consumed and the actual heat energy delivered. The COP
depends on outdoor temperature and directly influences how much energy the
heat pump outputs relative to the electricity it consumes.
When the COP is involved, the amount of heating power delivered is not
simply the electrical power consumed by the heat pump but rather:
P_{\text{heat}} = P_{\text{elec}} \cdot \text{COP}(T_{\text{out}})
—
Reply to this email directly, view it on GitHub
<#340 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCFXXIOHJBDFYXCNVQ4Y3ZZJYZNAVCNFSM6AAAAABNJX7ZC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBQG4ZTGMI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi all, thanks for the info in this thread and work to get the thermal model implemented - we just got a heat pump installed so very interested in using this for it. I'm having an issue where I can only return infeasible, even though it seems like the model has returned appropriate values (except for my other deferable load only showing 1w). There's nothing in the log to suggest why it's infeasible. I wondered if it was the hours I set for def2, but I upped that and it didn't seem to change anything. Can you see if I've missed something obvious? Payload to Emhass:
|
Beta Was this translation helpful? Give feedback.
-
I find I have feasibility issues quite often. I think one common cause is
setting a desired temperature for the first or second timestep - if that
temperature isn't being met right now, then the whole thing is infeasible
because the system has no time to meet it.
I think a better solution would be to replace the constraints with
penalties for not meeting the desired temperature, but I haven't got around
to it (I have half a change somewhere in my local repo I think)
…On Thu, Oct 3, 2024 at 1:28 AM Stouten80 ***@***.***> wrote:
Hi all, thanks for the info in this thread and work to get the thermal
model implemented - we just got a heat pump installed so very interested in
using this for it. I'm having an issue where I can only return infeasible,
even though it seems like the model has returned appropriate values (except
for my other deferable load only showing 1w). There's nothing in the log to
suggest why it's infeasible. I wondered if it was the hours I set for def2,
but I upped that and it didn't seem to change anything. Can you see if I've
missed something obvious?
Payload to Emhass:
{ "soc_final": 0.5, "soc_init": 0.89, "load_cost_forecast": [ 0.27258,
0.32529, 0.33327, 0.36708, 0.366765, 0.38094, 0.23331, 0.227115, 0.20832,
0.160965, 0.18564, 0.18522, 0.169155, 0.165795, 0.17661, 0.167475,
0.160965, 0.16317, 0.165585, 0.177765, 0.172095, 0.1701, 0.16695, 0.169785,
0.185325, 0.17682, 0.17745, 0.1701, 0.21168, 0.20958, 0.24024, 0.255465,
0.24801, 0.24801, 0.240345, 0.223335, 0.204225, 0.18123, 0.169575,
0.169575, 0.17199, 0.17199, 0.165375, 0.165375, 0.1701, 0.17199, 0.17199,
0.17661 ], "pv_power_forecast": [ 214, 180, 170, 97, 33, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 701, 1221,
1653, 2035, 2381, 2622, 2873, 2950, 2916, 2851, 2671, 2424, 2049, 1726,
1399, 1078, 718 ], "load_power_forecast": [ 500, 500, 800, 1000, 2500,
2500, 400, 400, 400, 400, 300, 300, 300, 300, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 200, 200, 400, 400, 400, 600, 600, 500,
500, 500, 500, 500, 500, 400, 400, 400, 400, 400, 400, 400, 500 ],
"prediction_horizon": 48, "def_total_hours": [5, 2, 5], "set_def_constant":
[false, true, false], "def_current_state": [0, 0, 0], "def_start_penalty":
[1, 5.5, 1], "P_deferrable_nom": [1, 2000, 2000], "def_start_timestep": [0,
13, 0], "def_end_timestep": [0, 28, 0], "P_from_grid_max": [22000],
"SOCmin": 0.11, "SOCmax": 0.9, "outdoor_temperature_forecast": [ 14.7,
14.7, 14.1, 14.1, 13.2, 13.2, 12.4, 12.4, 11.5, 11.5, 10.9, 10.9, 10.4,
10.4, 10, 10, 9.7, 9.7, 9.5, 9.5, 9.1, 9.1, 8.7, 8.7, 8.3, 8.3, 7.9, 7.9,
7.7, 7.7, 7.9, 7.9, 9.5, 9.5, 11.1, 11.1, 12.7, 12.7, 14.1, 14.1, 15.3,
15.3, 15.7, 15.7, 15.9, 15.9, 15.1, 14.7 ], "def_load_config": [ {}, {}, {
"thermal_config": { "heating_rate": 5, "cooling_constant": 0.1,
"overshoot_temperature": 23, "start_temperature": 20.8,
"desired_temperatures": [ 18, 18, 18, 18, 18, 21, 21, 21, 21, 21, 21, 21,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 21, 21,
20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 18 ] } } ]
}
—
Reply to this email directly, view it on GitHub
<#340 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCFXWKFLNMITK56UIAMP3ZZQGIXAVCNFSM6AAAAABNJX7ZC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBSGIZTKMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
— Andrew Garrett
|
Beta Was this translation helpful? Give feedback.
-
Another thing in my local repo is dumping the whole LP file to the output
directory for debugging purposes.
Unfortunately I don't see a tool for PuLP that can explain why the problem
is infeasible, but I suppose in theory one could throw something together
that tries discarding constraints until the thing works.
I'll have to see if I can pull these out into PRs.
— Andrew Garrett
…On Thu, 3 Oct 2024 at 08:28, Mark Purcell ***@***.***> wrote:
I find I have feasibility issues quite often. I think one common cause is
setting a desired temperature for the first or second timestep - if that
temperature isn't being met right now, then the whole thing is infeasible
because the system has no time to meet it.
It would be great if we could get some more debug logging with the thermal
model so we can see what is going on under the covers.
—
Reply to this email directly, view it on GitHub
<#340 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCFXSBNHIERNR444UXL7TZZRQRVAVCNFSM6AAAAABNJX7ZC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBSGU4DIOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The heating constant's natural definition is energy input * CoP / thermal
mass. So for a 100kL swimming pool with a 30 kW nominal (inclusive of CoP)
heat pump, you would start at 30 kWh / (100 000 kg * 4.2 J/g/°C). You can
observe it experimentally by running the load at full blast for an hour at
a time when the impact of the outdoor temperature is minimised (ie outdoor
temperature close to indoor temp) and recording the change in temperature.
The coupling to outdoor temperature (ie how well insulated it is) would be
captured by the "cooling constant". That one you really do need to figure
out experimentally, though it's easier to do because you can observe it in
isolation by turning off the load for an hour, ideally at a time with a big
difference between outdoor and indoor temperature, and dividing the change
in temperature by the difference between outdoor and indoor temperature
(and take the absolute value of the result.
For debugging these values, I've set up the model to export an extra
variable with the forecasted temperature. I'm displaying it in Plotly with
this snippet (on y axis 6 because I have lots of charts)
- entity: sensor.emhass_temp_predicted2
attribute: predicted_temperatures
yaxis: y6
filters:
- fn: |-
({xs, ys, meta, states, statistics, hass, vars}) => {
const forecasts =
states[states.length-1].attributes.predicted_temperatures;
res = {
xs: forecasts.map(fc => fc["date"]),
ys: forecasts.map(fc => fc["emhass_temp_predicted2"]),
meta: meta
};
return res;
}
— Andrew Garrett
…On Tue, 8 Oct 2024 at 01:47, martinarva ***@***.***> wrote:
So do i understand correctly that I should have my own logic for the
heating constant that will take account of the CoP outside temp correlation
etc?
—
Reply to this email directly, view it on GitHub
<#340 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCFXRZ3S2FT54LJ65BGMLZ2KNHVAVCNFSM6AAAAABNJX7ZC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBWHA3TIMI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi! Anybody already an example that works with an heat pump? Kind regards, Rick |
Beta Was this translation helpful? Give feedback.
-
i am running a preceeding EMHASS with 30 minute timelags and 3 deferrable loads. All 3 having their own timewindow, set by the "def_start_timestep"and "def_end_timestep". All this was working very well before I added the thermal model. My house is heated with a all-electric Daikin heatpump and using radiators only, no floor heating and no cooling.
So far I have the following remarks:
|
Beta Was this translation helpful? Give feedback.
-
What weather integration do you use to get a forecast ? |
Beta Was this translation helpful? Give feedback.
-
I've finally found a few hours to do some things I've been thinking about for a while here, and I came up with #374 See details there, but basically my hope is that these changes will fix a lot of the feasibility issues folks have been encountering. |
Beta Was this translation helpful? Give feedback.
-
I have started this thread to document my setup and use of the thermal model within EMHASS.
I hope others can share their experiences.
Currently I have an adhoc thermal model which I want to transition to the EMHASS model.
Warm winter days here so I am playing with my cooling, which is recorded in my Load Power Forecast.
I have been playing around with charging p_nom_power and def_total_run_hours for my HVAC..
I hope the new thermal model will address my setup..
Beta Was this translation helpful? Give feedback.
All reactions