kamaradclimber / heishamon-homeassistant

An integration for heatpumps handled by heishamon
Apache License 2.0
36 stars 20 forks source link

COP Calculation improvement #199

Open KalleArulaane opened 3 months ago

KalleArulaane commented 3 months ago

Hi, currently COP is an added calculated sensor and it works exactly as on the heat pump. It should be noted however, that there is a small flaw: during defrost COP is shown as a VERY high number and not negative. a) During defrost state energy is actually pulled from the heating system and put to the external unit and the pump indeed is working. So ideally the energy consumed during defrost should be "energy consumed" + "energy produced". b) For COP sensor it would make sense to use "blanking" when defrorst is active - i.e. show "0". I fixed it like this:

      {%- if (states('sensor.heishamon_power_consumed') | float(0) > 0) and (states('sensor.aquarea_defrost_state') == 'Inactive') -%}
        {{ '%.2f' % ((states('sensor.heishamon_power_produced') | float ) / (states('sensor.heishamon_power_consumed') | float )) }}
geduxas commented 3 months ago

You are wrong, during defrost pump switches in reverse (cool mode) so produces cool, to heat outdoor evaporator. It's not using indoor heat directly..

KalleArulaane commented 3 months ago

Hello. how am i wrong? During colder periods my wish is to put energy into the house, not drain out. as the pump is working, obviously it is working with COP. However the energy balance is negative - the indoor already saved heat is used to defrost the unit. Yes, it happens with a "very high" COP obviously but it does not matter. my intention with low external temperatures is not to cool my house with very high COP. From heating perspective the defrost is waste of energy only. Please explain me how it is not so.

PGnl commented 3 months ago

You are correct. The COP should be negative.

Daily COP would then be (approximately) the average COP on the day while omitting values of zero.

Best on a daily basis is however to use heat produced (which should also be allowed to go negative) divided by energy consumed. I am only using this as the instantaneous COP is to my view irrelevant. Also this gives the most exact result as it uses overall energy consumed by my kWh meter including pump etc..

geduxas commented 3 months ago

Why cop should be negative? Everyone thinks that if it's defrost, it should be something that pump is sucking out of house.. why?!?

Defrost is same working conditions as heating, but it's in opposite direction.. COP is not value which should represent how pump is effective only for heating.. but how pump is working, and how energy is produced.

So during defrost it's still working, and producing Eneergy! I don't think that it's right to calculate cop only for heating..

Yes in graphics it would be looking nicer..

PGnl commented 3 months ago

During a defrost, heat that was brought into the house is being brought back to the outdoors. the first part is a positive (this influx) of energy in the form of heat. This heat is now turned back outside for a defrost (outflux). Both should result in a total of zero energy towards the house. Both directions however have cost energy in the form of electricity. Inward more than outward due to the efficiency therefore COP in is lower than out.

COP (in general) is the energy (total) brought into the house divided by the electric energy used. The energy (heat and electricity) used for defrost did eventually not heat the house and thus should not artificially increase the COP.

If one sees the defrost as zero or even positive, one is overestimating one’s COP.

But instantaneous COP is for me irrelevant. I find daily heat generated (where heat is allowed to go negative during a defrost) divided by the daily power consumption much more relevant and accurate. This also removes the inaccurate COP values.

geduxas commented 3 months ago

So again who told that cop is only for bringing heat to home? :D cop is generated energy devided by consumed energy.. I know that you would like to see heating cop, cooling cop, defrosting cop... But they all are different.. main cop is calculated by energy.. and there is no matter where energy flows... Inside/outside.

KalleArulaane commented 3 months ago

Sorry for the delay - long and boring business trip. Let's put it to layman's terms:

  1. background - 7th grade physics: Imagine you're walking in a straight line. You can either walk forward or backward. This is like a one-dimensional vector. It tells you two things: how far you're going (like the number of steps) and in which direction (forward or backward). Even though it's just a straight line, it still counts as a vector because it has both direction and magnitude (how much). So, even simple movements along a line are considered vectors because they show both how much and which way. Or lets discuss acceleration of a car. If you have a known function of any days acceleration a=f(t) and integrate over it, you should get the speed value of 0, presuming the person driving will drive back home and stop the car every night. If you ignore the fact that breaking is negative acceleration, you will end up with an unrealistic speed if the integration period is long enough.

  2. net energy explanation: Imagine you have two heat pumps for heating your house, and you're comparing how effective they are over an entire day. Both pumps are great at heating, but one needs to defrost itself more often. During defrosting, the heat pump actually works in reverse—it uses energy to pump heat out of your house to melt the ice that's built up on it. This isn't just a break; it's a period when it's actively using energy but not for heating your home. When we talk about the average effectiveness, or COP, of these heat pumps throughout a day, we're looking at how much warmth they provide compared to the energy they use. Even if a heat pump is very efficient during its defrost cycle (meaning it doesn't waste a lot of energy), the fact that it's not heating your house during this time and instead using energy in the opposite way (cooling) affects its overall performance. So, if you're only interested in heating and not cooling, the heat pump that spends less time defrosting (and thus, less time reversing its operation and effectively cooling your house) will have a better average COP over the day. This means it's more efficient at keeping your house warm because it spends more time heating and less time in energy-consuming defrost cycles. If you ignore this and add the idiotically high COP of defrost, the shittier heat pump starts looking better.

KalleArulaane commented 3 months ago

so mathematically you are putting an ABS function where it should not be. If heating mode, the postitive flux is towars the house and in cooling mode vice versa. if you reverse, you must have negative. The world is full of such examples. Plus COP should show how well the heat pump works. If it would just very efficiently cool my house every time I try to heat it, positive COP would lie.

PGnl commented 3 months ago

You are right. Even though it is highly efficient at taking heat from the house during a defrost, this is a “negative” on your overall performance.

simplest way is to let COP go negative, this however seems quite coarse as the measurement locations and the flow is quite drastic during a defrost. Overall it however will provide a better number (read more realistic).

That is why I turned to an daily and hourly COP based on generated heat (which I allowed to go negative) this shows actual provided energy to the house. this divided by the electric energy consumed gave me better (read more realistic) numbers.

I have heard people say they had a daily COP of more than 6 while having defrosts every 50mins. That is just not realistic.

I checked this for the energy used in the days before when using gas heating. The energy based on weighed degree days is practically identical when compared between gas and the heat pump. This also the case when having defrosts however only when I allow the energy generated to go negative (similarly to allowing the COP negative).

however if someone believes it needs to be different. That is their choice. I just want to know how much energy is brought into my house and how much electric energy this cost me. This way I can see what the efficiency over the year is and and also, when using degree days, if the energy needed is decreasing because of the changes I am making to my house and how much.

kamaradclimber commented 3 months ago

Hello all, great to see conversation like this and to see it stay civil :+1: .

I'd be glad to implement improvements to the COP measurement. We don't even have to find a single definition that makes everyone happy, I think it could be valid to have different measurement to fit the different use cases. From the thread, I see:

I'd be very grateful if you could come up with a definition for those use cases and I'll gladly implement them.