diff --git a/esp32/include/HomieConfiguration.h b/esp32/include/HomieConfiguration.h index a364c4b..508da87 100644 --- a/esp32/include/HomieConfiguration.h +++ b/esp32/include/HomieConfiguration.h @@ -28,6 +28,7 @@ #define TEMPERATUR_SENSOR_LIPO "lipo" #define TEMPERATUR_SENSOR_WATER "water" #define TEMPERATUR_SENSOR_OUTSIDE "temp" +#define TEMPERATUR_SENSOR_CHIP "chip" #define TEMPERATURE_NAME "Temperature" #define TEMPERATURE_UNIT "°C" diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index e6ce79a..50e726e 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -387,6 +387,11 @@ void mode2MQTT() } } + if (! isnan(mChipTemp)) { + sensorTemp.setProperty(TEMPERATUR_SENSOR_CHIP).send(String(mChipTemp)); + Serial << "Chip Temperatur " << mChipTemp << " °C " << endl; + } + /* deactivate the sensors */ digitalWrite(OUTPUT_SENSOR, LOW); } @@ -798,6 +803,10 @@ void systemInit() .setName(TEMPERATURE_NAME) .setDatatype(NUMBER_TYPE) .setUnit(TEMPERATURE_UNIT); + sensorTemp.advertise(TEMPERATUR_SENSOR_CHIP) + .setName(TEMPERATURE_NAME) + .setDatatype(NUMBER_TYPE) + .setUnit(TEMPERATURE_UNIT); sensorLipo.advertise("percent") .setName("Percent")