Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
26 changes: 26 additions & 0 deletions luxtronik.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ Luxtronik.prototype._processData = function () {
}
}
values.opStateHeatingString = heatingStateString;
values.estimatedEnergyConsumption = this._calculateElectricEnergyConsumption(values);

return this.receivy.callback(null, {
values,
Expand All @@ -471,6 +472,31 @@ Luxtronik.prototype._processData = function () {
});
};

Luxtronik.prototype._calculateElectricEnergyConsumption = function(values) {
const heatPumpRunning =
values.heatpump_state3 == 0 || // heizbetrieb
values.heatpump_state3 == 8 || // pumpenvorlauf
values.heatpump_state3 == 17 || // elek. zusatzheizung
values.heatpump_state3 == 18; // elek. zusatzheizung
const hotWaterProductionRunning =
values.heatpump_state3 == 5 || // brauchwasser
values.heatpump_state3 == 9 || // thermische desinfektion
values.heatpump_state3 == 19; // warmwasser nachheizung

if (heatPumpRunning || hotWaterProductionRunning) {
// this factor is estimated by observation
const factor = hotWaterProductionRunning
? 44
: 37;

const estimatedHeatPumpEnergyUsage = (values.temperature_hot_gas ?? 0) * factor;

return estimatedHeatPumpEnergyUsage;
}

return undefined;
};

function sendData(client, data) {
if (typeof client !== 'undefined' && client !== null) {
data.forEach(function (element) {
Expand Down
Loading