From 4dc475282398634476631224f93adb68ceac6c5f Mon Sep 17 00:00:00 2001 From: Attila Darazs Date: Sat, 4 Mar 2023 18:31:32 +0100 Subject: [PATCH] Add GJ (gigajoule) as an energy meter unit (#2114) Some district heating meters are displaying their values in GJ and Home Assistant is also capable of accepting heating values in this format. --- code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp | 3 +++ sd-card/html/edit_config_param.html | 1 + 2 files changed, 4 insertions(+) diff --git a/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp b/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp index 003cfaa6..058bc147 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp @@ -156,6 +156,9 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph) else if (toUpper(splitted[1]) == "ENERGY_MWH") { mqttServer_setMeterType("energy", "MWh", "h", "MW"); } + else if (toUpper(splitted[1]) == "ENERGY_GJ") { + mqttServer_setMeterType("energy", "GJ", "h", "GJ/h"); + } } if ((toUpper(splitted[0]) == "CLIENTID") && (splitted.size() > 1)) diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 8ccc667f..2ae92890 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -654,6 +654,7 @@ textarea { + $TOOLTIP_MQTT_MeterType