Automatic reboot when MQTT is lost (#1058)

* Fixing board type overwrite, zmartcharge default issues and disabling entsoe

* Fixed Zmartcharge configuration issue

* Option to auto reboot if MQTT connection is lost
This commit is contained in:
Gunnar Skjold
2025-11-06 18:26:40 +01:00
committed by GitHub
parent eefbc08222
commit ffd8d46f2e
14 changed files with 81 additions and 44 deletions

View File

@@ -979,7 +979,8 @@ void AmsWebServer::configurationJson() {
mqttConfig.stateUpdate,
mqttConfig.stateUpdateInterval,
mqttConfig.timeout,
mqttConfig.keepalive
mqttConfig.keepalive,
mqttConfig.rebootMinutes == 0 ? "null" : String(mqttConfig.rebootMinutes, 10).c_str()
);
server.sendContent(buf);
@@ -1405,6 +1406,7 @@ void AmsWebServer::handleSave() {
mqtt.stateUpdateInterval = server.arg(F("qd")).toInt();
mqtt.timeout = server.arg(F("qi")).toInt();
mqtt.keepalive = server.arg(F("qk")).toInt();
mqtt.rebootMinutes = server.arg(F("qe")).toInt();
} else {
config->clearMqtt(mqtt);
}
@@ -2246,6 +2248,10 @@ void AmsWebServer::configFileDownload() {
server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttPayloadFormat %d\n"), mqtt.payloadFormat));
server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttSsl %d\n"), mqtt.ssl ? 1 : 0));
if(mqtt.timeout > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttTimeout %d\n"), mqtt.timeout));
if(mqtt.keepalive > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttKeepalive %d\n"), mqtt.keepalive));
if(mqtt.rebootMinutes > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttRebootMinutes %d\n"), mqtt.rebootMinutes));
if(mqtt.payloadFormat == 3) {
DomoticzConfig domo;
config->getDomoticzConfig(domo);