diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 90a1ccef..1094b617 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -194,6 +194,7 @@ #define MQTT_REPORT_FREEHEAP 1 #define MQTT_REPORT_VCC 1 #define MQTT_REPORT_RELAY 1 +#define MQTT_REPORT_COLOR 1 #define MQTT_REPORT_HOSTNAME 1 #define MQTT_REPORT_APP 1 #define MQTT_REPORT_VERSION 1 diff --git a/code/espurna/espurna.ino b/code/espurna/espurna.ino index 1cd1cbde..3a6c2c2a 100644 --- a/code/espurna/espurna.ino +++ b/code/espurna/espurna.ino @@ -81,6 +81,11 @@ void heartbeat() { #if (MQTT_REPORT_RELAY) relayMQTT(); #endif + #if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE + #if (MQTT_REPORT_COLOR) + mqttSend(MQTT_TOPIC_COLOR, lightColor().c_str()); + #endif + #endif #if (MQTT_REPORT_VCC) #if ENABLE_ADC_VCC mqttSend(MQTT_TOPIC_VCC, String(ESP.getVcc()).c_str());