mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 02:34:29 +05:00
feat: added diagnostic code polling via opentherm, added hex value for fault code and diag code
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
"pressure": "Давление",
|
||||
"dhwFlowRate": "Расход ГВС",
|
||||
"faultCode": "Код ошибки",
|
||||
"diagCode": "Диагностический код",
|
||||
"indoorTemp": "Внутренняя темп.",
|
||||
"outdoorTemp": "Наружная темп.",
|
||||
"heatingTemp": "Темп. отопления",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user