mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
added IP and version to MQTT start payload, added support for RC100/Moduline 1010, Fixed Junkers thermostat writing
This commit is contained in:
@@ -598,7 +598,14 @@ void MyESP::_mqttOnConnect() {
|
||||
_mqtt_last_connection = millis();
|
||||
|
||||
// say we're alive to the Last Will topic
|
||||
mqttPublish(_mqtt_will_topic, _mqtt_will_online_payload, true); // force retain on
|
||||
// send online appended with the version information as JSON
|
||||
const size_t capacity = JSON_OBJECT_SIZE(3);
|
||||
StaticJsonDocument<capacity> doc;
|
||||
JsonObject payload = doc.to<JsonObject>();
|
||||
payload["status"] = _mqtt_will_online_payload;
|
||||
payload["version"] = _app_version;
|
||||
payload["IP"] = WiFi.localIP().toString();
|
||||
mqttPublish(_mqtt_will_topic, doc, true); // force retain on
|
||||
|
||||
// subscribe to general subs
|
||||
mqttSubscribe(MQTT_TOPIC_RESTART);
|
||||
|
||||
Reference in New Issue
Block a user