The availability topic in MQTT is not set to "offline" when the wordclock e.g. is turn off (at least in my configuration). I suspect that the line where it is set:
mqtt_client_.setWill(availabilityTopic.c_str(), "offline");
should also set the RETAIN flag to TRUE and maybe also the QOS to 0. This by the looks of the code in the used MQTT lib:
void MQTTClient::setWill(const char topic[], const char payload[], bool retained, int qos)
The availability topic in MQTT is not set to "offline" when the wordclock e.g. is turn off (at least in my configuration). I suspect that the line where it is set:
mqtt_client_.setWill(availabilityTopic.c_str(), "offline");should also set the RETAIN flag to TRUE and maybe also the QOS to 0. This by the looks of the code in the used MQTT lib:
void MQTTClient::setWill(const char topic[], const char payload[], bool retained, int qos)