Chip temperature is published, too

This commit is contained in:
Ollo 2021-02-16 22:29:07 +01:00
parent 5deea587a8
commit 55d66b763c
2 changed files with 10 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#define TEMPERATUR_SENSOR_LIPO "lipo" #define TEMPERATUR_SENSOR_LIPO "lipo"
#define TEMPERATUR_SENSOR_WATER "water" #define TEMPERATUR_SENSOR_WATER "water"
#define TEMPERATUR_SENSOR_OUTSIDE "temp" #define TEMPERATUR_SENSOR_OUTSIDE "temp"
#define TEMPERATUR_SENSOR_CHIP "chip"
#define TEMPERATURE_NAME "Temperature" #define TEMPERATURE_NAME "Temperature"
#define TEMPERATURE_UNIT "°C" #define TEMPERATURE_UNIT "°C"

View File

@ -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 */ /* deactivate the sensors */
digitalWrite(OUTPUT_SENSOR, LOW); digitalWrite(OUTPUT_SENSOR, LOW);
} }
@ -798,6 +803,10 @@ void systemInit()
.setName(TEMPERATURE_NAME) .setName(TEMPERATURE_NAME)
.setDatatype(NUMBER_TYPE) .setDatatype(NUMBER_TYPE)
.setUnit(TEMPERATURE_UNIT); .setUnit(TEMPERATURE_UNIT);
sensorTemp.advertise(TEMPERATUR_SENSOR_CHIP)
.setName(TEMPERATURE_NAME)
.setDatatype(NUMBER_TYPE)
.setUnit(TEMPERATURE_UNIT);
sensorLipo.advertise("percent") sensorLipo.advertise("percent")
.setName("Percent") .setName("Percent")