diff --git a/esp32/src/PlantCtrl.cpp b/esp32/src/PlantCtrl.cpp index ca68bfa..0030fb0 100644 --- a/esp32/src/PlantCtrl.cpp +++ b/esp32/src/PlantCtrl.cpp @@ -211,9 +211,14 @@ void Plant::deactivatePump(void) void Plant::publishState(int stateNumber, String stateString) { + String buffer; + StaticJsonDocument<200> doc; if (this->mConnected) { - this->mPlant->setProperty("state").send(stateString); + doc["number"] = stateNumber; + doc["message"] = stateString; + serializeJson(doc, buffer); + this->mPlant->setProperty("state").send(buffer.c_str()); } }