Fix meter lifecycle and MQTT/HA integration bugs #1

Merged
adebaumann merged 8 commits from fix-attach-meters-detach into main 2026-06-26 23:53:16 +00:00
Showing only changes of commit b10c89505c - Show all commits
+1
View File
@@ -258,6 +258,7 @@ static void mqttPublishDiscovery() {
doc["name"] = name;
doc["state_topic"] = stat;
doc["command_topic"] = stat + "/set";
doc["retain"] = true; // HA publishes commands retained so values survive restarts
doc["availability_topic"] = String(mqttCfg.prefix) + "/status";
doc["payload_available"] = MQTT_PAYLOAD_AVAILABLE;
doc["payload_not_available"] = MQTT_PAYLOAD_NOT_AVAILABLE;