diff --git a/esp32/src/PlantCtrl.cpp b/esp32/src/PlantCtrl.cpp index 246d880..a01f847 100644 --- a/esp32/src/PlantCtrl.cpp +++ b/esp32/src/PlantCtrl.cpp @@ -264,9 +264,9 @@ void Plant::advertise(void) { // Advertise topics mPump = this->mPlant->advertise("switch").setName("Pump").setDatatype("Boolean"); - this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Integer").setUnit("unixtime"); - this->mPlant->advertise("moist").setName("Percent").setDatatype("Float").setUnit("%"); - this->mPlant->advertise("moistraw").setName("adc").setDatatype("Float").setUnit("3.3/4096V"); - this->mPlant->advertise("state").setName("state").setDatatype("String"); + this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Integer").setUnit("unixtime").setRetained(true); + this->mPlant->advertise("moist").setName("Percent").setDatatype("Float").setUnit("%").setRetained(true); + this->mPlant->advertise("moistraw").setName("adc").setDatatype("Float").setUnit("3.3/4096V").setRetained(true); + this->mPlant->advertise("state").setName("state").setDatatype("String").setRetained(true); }