diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 04850ea1..2ab3040c 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -187,6 +187,7 @@ // Topics that will be reported in heartbeat #define HEARTBEAT_REPORT_STATUS 1 +#define HEARTBEAT_REPORT_SSID 1 #define HEARTBEAT_REPORT_IP 1 #define HEARTBEAT_REPORT_MAC 1 #define HEARTBEAT_REPORT_RSSI 1 @@ -731,6 +732,7 @@ #define MQTT_TOPIC_LED "led" #define MQTT_TOPIC_BUTTON "button" #define MQTT_TOPIC_IP "ip" +#define MQTT_TOPIC_SSID "ssid" #define MQTT_TOPIC_VERSION "version" #define MQTT_TOPIC_UPTIME "uptime" #define MQTT_TOPIC_DATETIME "datetime" diff --git a/code/espurna/utils.ino b/code/espurna/utils.ino index baa9e9a8..cec21efc 100644 --- a/code/espurna/utils.ino +++ b/code/espurna/utils.ino @@ -184,6 +184,9 @@ void heartbeat() { #if (HEARTBEAT_REPORT_HOSTNAME) mqttSend(MQTT_TOPIC_HOSTNAME, getSetting("hostname").c_str()); #endif + #if (HEARTBEAT_REPORT_SSID) + mqttSend(MQTT_TOPIC_SSID, WiFi.SSID().c_str()); + #endif #if (HEARTBEAT_REPORT_IP) mqttSend(MQTT_TOPIC_IP, getIP().c_str()); #endif