COP energy offset values in P1P2MQTT-bridge.ino#276
Open
AndrCarl wants to merge 1 commit into
Open
Conversation
AndrCarl
commented
May 13, 2026
| * ArduinoJson 6.11.3 by Benoit Blanchon | ||
| * | ||
| * Version history | ||
| * 20260513 v0.9.57 Offset for COP calculation (elecrical/thermal) |
Author
There was a problem hiding this comment.
wrong version :-(. It looks like the example is older; current ino.bin has v0.9.58rc23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The current COP calculations (COP_Lifetime, COP_Before_Bridge, COP_After_Bridge) rely fully on the Daikin-reported lifetime energy counters.
In practice, these counters are often not ideal as an absolute baseline because:
external electricity meters may have different accumulated totals
compressor/outdoor-unit replacements may reset counters
historical values before P1P2MQTT installation may be incomplete
users may want to align COP calculations with calibrated metering data
thermal/electrical lifetime counters may already contain installation-specific offsets
This PR proposes adding configurable offsets for:
electrical consumed energy
thermal produced energy
which are added before COP calculation.
Proposed implementation
Add two new persistent EEPROM-backed parameters:
These should behave like existing configurable bridge parameters:
configurable via telnet
configurable via MQTT / Home Assistant
persistent in EEPROM
changeable without recompiling firmware
Suggested EEPROM fields:
uint32_t electricityConsumedCompressorHeating1Offset;
uint32_t energyProducedCompressorHeating1Offset;
Suggested parameter names:
"Electricity kWh offset"
"Production kWh offset"
COP calculation
Instead of:
cop = produced / consumed;
use:
effectiveConsumed =
daikinConsumed + electricityKwhOffset;
effectiveProduced =
daikinProduced + thermalKwhOffset;
cop = effectiveProduced / effectiveConsumed;
Additional note
To avoid breaking existing EEPROM layouts and parameter numbering, the new parameters should preferably be appended at the end of the existing parameter table instead of inserted between existing parameter IDs.
### Still to do's: I haven't found calucaltion of COP itself
Hope I haven't forgot a if clause with the new parameters
code should look like this
uint32_t electricityConsumedCompressorHeating1ForCop = electricityConsumedCompressorHeating1 + EE.electricityConsumedCompressorHeating1Offset;
uint32_t energyProducedCompressorHeating1ForCop = energyProducedCompressorHeating1 + EE.energyProducedCompressorHeating1Offset;
float copLifetime = electricityConsumedCompressorHeating1ForCop ? (float) energyProducedCompressorHeating1ForCop / (float) electricityConsumedCompressorHeating1ForCop+ : 0;