diff --git a/src/MqttHandleDtu.cpp b/src/MqttHandleDtu.cpp index e8192b2e2..0f69f56d3 100644 --- a/src/MqttHandleDtu.cpp +++ b/src/MqttHandleDtu.cpp @@ -7,6 +7,7 @@ #include "MqttSettings.h" #include "NetworkSettings.h" #include +#include MqttHandleDtuClass MqttHandleDtu; @@ -34,6 +35,11 @@ void MqttHandleDtuClass::loop() MqttSettings.publish("dtu/uptime", String(millis() / 1000)); MqttSettings.publish("dtu/ip", NetworkSettings.localIP().toString()); MqttSettings.publish("dtu/hostname", NetworkSettings.getHostname()); + MqttSettings.publish("dtu/temperature", String(CpuTemperature.read())); + MqttSettings.publish("dtu/heapSize", String(ESP.getHeapSize())); + MqttSettings.publish("dtu/heapFree", String(ESP.getFreeHeap())); + MqttSettings.publish("dtu/heapMinFree", String(ESP.getMinFreeHeap())); + MqttSettings.publish("dtu/heapMaxAlloc", String(ESP.getMaxAllocHeap())); if (NetworkSettings.NetworkMode() == network_mode::WiFi) { MqttSettings.publish("dtu/rssi", String(WiFi.RSSI())); MqttSettings.publish("dtu/bssid", WiFi.BSSIDstr()); diff --git a/src/MqttHandleHass.cpp b/src/MqttHandleHass.cpp index 87f1ccb9b..7e002ec5d 100644 --- a/src/MqttHandleHass.cpp +++ b/src/MqttHandleHass.cpp @@ -61,6 +61,11 @@ void MqttHandleHassClass::publishConfig() publishDtuSensor("IP", "", "diagnostic", "mdi:network-outline", "", ""); publishDtuSensor("WiFi Signal", "signal_strength", "diagnostic", "", "dBm", "rssi"); publishDtuSensor("Uptime", "duration", "diagnostic", "", "s", ""); + publishDtuSensor("Temperature", "temperature", "diagnostic", "mdi:thermometer", "°C", "temperature"); + publishDtuSensor("Heap Size", "", "diagnostic", "mdi:memory", "Bytes", "heapSize"); + publishDtuSensor("Heap Free", "", "diagnostic", "mdi:memory", "Bytes", "heapFree"); + publishDtuSensor("Largest Free Heap Block", "", "diagnostic", "mdi:memory", "Bytes", "heapMaxAlloc`"); + publishDtuSensor("Lifetime Minimum Free Heap", "", "diagnostic", "mdi:memory", "Bytes", "heapMinFree`"); publishDtuBinarySensor("Status", "connectivity", "diagnostic", config.Mqtt.Lwt.Value_Online, config.Mqtt.Lwt.Value_Offline, config.Mqtt.Lwt.Topic); yield();