Resend sensors to HA if online status received

This commit is contained in:
Gunnar Skjold
2023-12-15 20:03:24 +01:00
parent 0c1525b018
commit 00278659f8
12 changed files with 49 additions and 2 deletions

View File

@@ -547,3 +547,12 @@ uint8_t HomeAssistantMqttHandler::getFormat() {
bool HomeAssistantMqttHandler::publishRaw(String data) {
return false;
}
void HomeAssistantMqttHandler::onMessage(String &topic, String &payload) {
if(topic.equals(statusTopic)) {
if(payload.equals("online")) {
if(debugger->isActive(RemoteDebug::INFO)) debugger->printf_P(PSTR("Received online status from HA, resetting sensor status\n"));
l1Init = l2Init = l2eInit = l3Init = l3eInit = l4Init = l4eInit = rtInit = rteInit = pInit = sInit = false;
}
}
}