feat: polling of exhaust gas temperature (#42) and heating return temperature; added new sensors to HA

This commit is contained in:
Yurii
2024-03-30 00:04:51 +03:00
parent 41cca76bfa
commit f544f01caa
5 changed files with 88 additions and 0 deletions

View File

@@ -293,6 +293,12 @@ protected:
// Get current heating temp
updateHeatingTemp();
// Get heating return temp
updateHeatingReturnTemp();
// Get exhaust temp
updateExhaustTemp();
// Fault reset action
if (vars.actions.resetFault) {
@@ -655,6 +661,21 @@ protected:
return true;
}
bool updateExhaustTemp() {
unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermRequestType::READ_DATA,
OpenThermMessageID::Texhaust,
0
));
if (!CustomOpenTherm::isValidResponse(response)) {
return false;
}
vars.temperatures.exhaust = CustomOpenTherm::getFloat(response);
return true;
}
bool updateHeatingTemp() {
unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermMessageType::READ_DATA,
@@ -675,6 +696,21 @@ protected:
return true;
}
bool updateHeatingReturnTemp() {
unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
OpenThermMessageType::READ_DATA,
OpenThermMessageID::Tret,
0
));
if (!CustomOpenTherm::isValidResponse(response)) {
return false;
}
vars.temperatures.heatingReturn = CustomOpenTherm::getFloat(response);
return true;
}
bool updateDhwTemp() {
unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(