2025-11-0701

This commit is contained in:
2025-11-07 22:12:40 +01:00
parent 29a8be80c6
commit b2157d524b

View File

@@ -278,16 +278,6 @@ void callback(char* topic1, byte* payload, unsigned int length) {
}
msg[length] = '\0';
// CO2 Wert vom Sensor
/* if(strcmp(topic1, topic_Co2)== 0){
#ifdef DEBUG
Serial.print("Co2 Sensor: ");
Serial.print(msg);
Serial.println();
#endif
Co2 = atoi(msg);
} */
// Wetter Wert
if(strcmp(topic1, topic_Wetter)== 0){
#ifdef DEBUG
Serial.print("Aussentemperatur: ");
@@ -296,6 +286,7 @@ void callback(char* topic1, byte* payload, unsigned int length) {
#endif
Aussentemp = atof(msg);
}
if(strcmp(topic1, topic_Pressure)== 0){
#ifdef DEBUG
Serial.print("Luftdruck: ");
@@ -304,6 +295,7 @@ void callback(char* topic1, byte* payload, unsigned int length) {
#endif
Pressure = atoi(msg);
}
if(strcmp(topic1, topic_Luftfeuchtigkeit)== 0){
#ifdef DEBUG
Serial.print("Luftfeuchtigkeit: ");
@@ -312,39 +304,7 @@ void callback(char* topic1, byte* payload, unsigned int length) {
#endif
Luftfeuchtigkeit = atof(msg);
}
/* if(strcmp(topic1, topic_Hell)== 0){
#ifdef DEBUG
Serial.print("Helligkeit: ");
Serial.print(msg);
Serial.println();
#endif
hell = atoi(msg);
}
if(strcmp(topic1, topic_Dunkel)== 0){
#ifdef DEBUG
Serial.print("Dunkel: ");
Serial.print(msg);
Serial.println();
#endif
dunkel = atoi(msg);
}
if(strcmp(topic1, topic_ZeitStart)== 0){
#ifdef DEBUG
Serial.print("ZeitStart: ");
Serial.print(msg);
Serial.println();
#endif
StartderAbdunklung = atoi(msg);
}
if(strcmp(topic1, topic_ZeitEnde)== 0){
#ifdef DEBUG
Serial.print("ZeitEnde: ");
Serial.print(msg);
Serial.println();
#endif
EndederAbdunklung = atoi(msg);
} */
if(strcmp(topic1, topic_Helligkeit)== 0){
Serial.print("Helligkeit: ");
Serial.print(msg);
@@ -354,7 +314,8 @@ void callback(char* topic1, byte* payload, unsigned int length) {
if (Helligkeit < 0) Helligkeit = 0;
display.setBrightness(Helligkeit);
}
if(strcmp(topic1, topic_Akku)== 0){
if(strcmp(topic1, topic_Akku)== 0){
#ifdef DEBUG
Serial.print("AKKU: ");
Serial.print(msg);
@@ -367,10 +328,10 @@ void reconnect() {
sprintf(clientName, "%s%s", "Uhr", "_Zentrale" );
// Loop until we're reconnected
while (!client.connected()) {
//Serial.print("Attempting MQTT connection...");
Serial.print("Attempting MQTT connection...");
if (client.connect(clientName)) {
/* MQTTStatus.setPic(3); */
//Serial.println("connected");
Serial.println("connected");
/* client.subscribe(topic_Co2); */
client.subscribe(topic_Covid);
client.subscribe(topic_Wetter);