marcoboers / home-assistant-quatt

Unofficial Quatt heat pump integration for Home Assistant
MIT License
30 stars 4 forks source link

Option to use a Input kWh sensor instead of Watt sensor #119

Closed w-Oeps closed 2 weeks ago

w-Oeps commented 3 weeks ago

Checklist

Is your feature request related to a problem? Please describe.

I have a Quatt duo. In the electrical panel I have both Quatts on a seperate phase both measured with a modbus wired to my HA system. I have a sensor which adds the kWh for HP1 and HP2. In the Quatt HA integration I must use a Watt sensor so I created a HP1 + HP2 Watt sensor too.

I assume that internally in the Quatt integration the input Watts are recalculated to kWh with Riemann(?). This seems less accurate as I have the real kWhs available.

Describe the solution you'd like

Is it possible to add a feature to chose between a Watt sensor and a kWh sensor? Thanks!

Describe alternatives you've considered

Just keep using the current Watt sensor!

Additional context

This is a nice to have feature request if it is easy to accomplish.

patrickvorgers commented 2 weeks ago

The external sensor that can be configured can be in W or kW. This sensor represents the actual power usage at that specific point in time (sensor deviceclass: POWER). Sensors with kWh represent a different category of sensors because those sensors measure power over time (sensor deviceclass: ENERGY) which are different as sensors that represent the actual power being used.

Probably the modbus also has the actual power (W) being used available instead of the power over time (kWh). I personally use Qubino's in my electical panel which measure the usage. There I see separate sensors for the current power usage (W) and the total power used since installation (kWh).

w-Oeps commented 2 weeks ago

Currently I have a Watt sensor configured and is working to calculate the COP. My modbus has indeed both W and kWh available.

The question is more that IF there would be a kWh sensor, the COP calculation would be more accurate. My assumption with this is that the integration has to convert Watts into kWh with Riemann or similar so you could skip a calculation step.

If it is worth adding is else. My 2 cents: If it is easy I would say why not. If difficult, skip it. What I understand is that the Riemann calculation is accurate with a more or less continuous power usage and becomes less accurate when the power usage varies. Hopefully heat pumps have a relative continuous power usage (with a samples every x seconds). Thanks!

patrickvorgers commented 2 weeks ago

The calculation is done based on a formula found on Tweakers that is quite accurate: computedHeatPower = computedWaterDelta * flowRate * 1.137888; computedCOP = computedHeatPower / electicalPower; electricalPower is the Power in W

w-Oeps commented 2 weeks ago

Thanks for the explanation. If I understand the formula correctly this calculates a COP of a moment in time. For an average COP over a period for a day more calculations must be done with computedHeatPower and electicalPower. I'm will try if can do this in Home Assistant and see if there is a meaningfull difference when using kWh instead of electicalPower. I leave it to you guys if it is worth to implement a kWh feed or not (my coding skills are limited to copy/adapt/paste unfortunately). This request can be closed. Thanks again for looking into this!

patrickvorgers commented 2 weeks ago

@marcoboers , this one can also be closed.

w-Oeps commented 2 weeks ago

Closed