feat: added diagnostic code polling via opentherm, added hex value for fault code and diag code

This commit is contained in:
Yurii
2024-10-05 10:03:14 +03:00
parent 4478e8f204
commit a4ee4c5224
9 changed files with 76 additions and 2 deletions

View File

@@ -100,6 +100,7 @@
"pressure": "Pressure",
"dhwFlowRate": "DHW flow rate",
"faultCode": "Fault code",
"diagCode": "Diagnostic code",
"indoorTemp": "Indoor temp",
"outdoorTemp": "Outdoor temp",
"heatingTemp": "Heating temp",

View File

@@ -100,6 +100,7 @@
"pressure": "Давление",
"dhwFlowRate": "Расход ГВС",
"faultCode": "Код ошибки",
"diagCode": "Диагностический код",
"indoorTemp": "Внутренняя темп.",
"outdoorTemp": "Наружная темп.",
"heatingTemp": "Темп. отопления",

View File

@@ -162,6 +162,10 @@
<th scope="row" data-i18n>dashboard.state.faultCode</th>
<td><b id="ot-fault-code"></b></td>
</tr>
<tr></tr>
<th scope="row" data-i18n>dashboard.state.diagCode</th>
<td><b id="ot-diag-code"></b></td>
</tr>
<tr>
<th scope="row" data-i18n>dashboard.state.indoorTemp</th>
<td><b id="indoor-temp"></b> <span class="temp-unit"></span></td>
@@ -430,7 +434,18 @@
setValue('#ot-modulation', result.sensors.modulation);
setValue('#ot-pressure', result.sensors.pressure);
setValue('#ot-dhw-flow-rate', result.sensors.dhwFlowRate);
setValue('#ot-fault-code', result.sensors.faultCode ? ("E" + result.sensors.faultCode) : "-");
setValue(
'#ot-fault-code',
result.sensors.faultCode
? (result.sensors.faultCode + " (0x" + dec2hex(result.sensors.faultCode) + ")")
: "-"
);
setValue(
'#ot-diag-code',
result.sensors.diagnosticCode
? (result.sensors.diagnosticCode + " (0x" + dec2hex(result.sensors.diagnosticCode) + ")")
: "-"
);
setValue('#indoor-temp', result.temperatures.indoor);
setValue('#outdoor-temp', result.temperatures.outdoor);

View File

@@ -665,4 +665,13 @@ function form2json(data, noCastItems = []) {
let object = Array.from(data).reduce(method, {});
return JSON.stringify(object);
}
function dec2hex(i) {
let hex = parseInt(i).toString(16);
if (hex.length % 2 != 0) {
hex = "0" + hex;
}
return hex.toUpperCase();
}