marcoboers / home-assistant-quatt

Unofficial Quatt heat pump integration for Home Assistant
MIT License
32 stars 5 forks source link

Issues with defrost binary sensor #130

Open jeroen85 opened 3 weeks ago

jeroen85 commented 3 weeks ago

System Health details

N/A

Checklist

Describe the issue

I experience a lot of Defrost cases with my HP1 while it is not defrosting at all. It happens during start of the HP.

bnpG0hOhZCTf9QlpiHMuM6PH

in my case it is caused by a small temperature difference of the water inlet and outlet sensor when the HP is not in use. This results in the power measurement becoming negative, exceeding -100W and triggering the defrost binary sensor. gQ3RuQAqn5hKC7khNQJZug2n

Maybe some additional parameters should be checked to determine defrost situations?

Reproduction steps

N/A

Debug logs

N/A

Diagnostics dump

No response

jeroen85 commented 3 weeks ago

As the heat power decreases up to -6000W during defrost I would suggest to change the threshold to something like -2000W instead of -100W

patrickvorgers commented 3 weeks ago

What I see in the code is that it uses the power and powerinput from the Quatt and not the waterdelta. Can you create a graph of a longer period of the power and powerinput of HP1?

What I see in the graph currently that it probably has to do something with having a Quatt Duo. When HP2 is active HP1 is running on "low" power (less than 100W).

patrickvorgers commented 3 weeks ago

Looking at my own Quatt (don't have a duo), it seems like that changing the heatpower check to -2500 could do the trick.

image

Could you change in the file coordinator.py (custom_components/quatt) the computedDefrost function? Especially the return statement which checks the ranges of the input and output power. After the change you have to restart Home Assistant to activate the change. Please check whether that fixes the issue for you.

    def computedDefrost(self, parent_key: str | None = None):
        """Compute Quatt Defrost State."""
        if parent_key is None:
            return None

        powerInput = self.getValue(parent_key + ".powerInput")
        powerOutput = self.getValue(parent_key + ".power")

        LOGGER.debug("%s.computedDefrost.powerInput %s", parent_key, powerInput)
        LOGGER.debug("%s.computedDefrost.powerOutput %s", parent_key, powerOutput)

        if powerInput is None or powerOutput is None:
            return None

        powerOutput = float(powerOutput)
        powerInput = float(powerInput)

        return powerOutput < -2500 and powerInput > 100
jeroen85 commented 3 weeks ago

What I see in the code is that it uses the power and powerinput from the Quatt and not the waterdelta. Can you create a graph of a longer period of the power and powerinput of HP1?

The power is a calculated value within the CiC. It is theflow * heat capacity of water * T_waterdelta. As the T_waterdelta becomes slightly negative (-0,1 degC), the resulting power measurement also get's negative. This exceeds the threshold of -100W and triggers the defrost binary.

I will change the coordinator.py file, thanks for the suggestion!

patrickvorgers commented 3 weeks ago

What I see in the code is that it uses the power and powerinput from the Quatt and not the waterdelta. Can you create a graph of a longer period of the power and powerinput of HP1?

The power is a calculated value within the CiC. It is theflow * heat capacity of water * T_waterdelta. As the T_waterdelta becomes slightly negative (-0,1 degC), the resulting power measurement also get's negative. This exceeds the threshold of -100W and triggers the defrost binary.

I will change the coordinator.py file, thanks for the suggestion!

You are right that the CIC uses a similar formula as the Quatt integration when an external powermeter is used to calculate the produced heat computedWaterDelta * flowRate * 1.137888.

Great that you are going to test out the change. Please report back whether it fixes the issue. I will also apply the change myself and check the effects on a single Quatt. After some testing I will create a pull request (PR) for the change.

jeroen85 commented 3 weeks ago

It worked as expected. Binary sensor indicated defrost when power was below -2500W. No defrost for small power drops (for example the -233W around 12:00)

Screenshot 2024-11-04 200315

patrickvorgers commented 3 weeks ago

@jeroen85, I created a PR with the fix. Hopefully it will be merged soon.

patrickvorgers commented 2 weeks ago

Today, I was checking the defrost sensor and I saw that I don't get any negative power values anymore. After some investigation I saw that the CiC was upgraded to version 2.20.2. Below is what I see currently and I suspect that it is a defrost:

image

@jeroen85, could you check whether you see the same behaviour?

jeroen85 commented 2 weeks ago

I will, unfortunately no defrosts these days