Thanks @mwittig and @rikki78
I did those changes. However, that did not do the trick.
It is strange: when I tested the original file (file -> examples -> ESP8266WiFi -> WiFi Client), I could successfully compile my code.
The other example code (from funduino.de -> http://funduino.de/anleitung-dht11-dht22)
#include "DHT.h" //DHT Bibliothek laden
#define DHTPIN 2 //Der Sensor wird an PIN 2 angeschlossen
#define DHTTYPE DHT11 // Es handelt sich um den DHT11 Sensor
DHT dht(DHTPIN, DHTTYPE); //Der Sensor wird ab jetzt mit „dth“ angesprochen
void setup() {
Serial.begin(9600); //Serielle Verbindung starten
dht.begin(); //DHT11 Sensor starten
}
void loop() {
delay(2000); //Zwei Sekunden Vorlaufzeit bis zur Messung (der Sensor ist etwas träge)
float Luftfeuchtigkeit = dht.readHumidity(); //die Luftfeuchtigkeit auslesen und unter „Luftfeutchtigkeit“ speichern
float Temperatur = dht.readTemperature();//die Temperatur auslesen und unter „Temperatur“ speichern
Serial.print("Luftfeuchtigkeit: "); //Im seriellen Monitor den Text und
Serial.print(Luftfeuchtigkeit); //die Dazugehörigen Werte anzeigen
Serial.println(" %");
Serial.print("Temperatur: ");
Serial.print(Temperatur);
Serial.println(" Grad Celsius");
}
works as well. Both on their own. Adding sprintf and dtostrf was pretty much all I really changed; all the other stuff (adding variables, deleting and/or commenting out serial output) should not have caused any problems. But the final code from my last posting does not work at all.
I finally got all the annoying stuff out of the way (setting up each and every 433MHz for remote controls, figuring out which pimatic rules I need), now adding a bunch of DHT11 sensors to my room was pretty much going to be “it”. But it takes longer than all the other work combined
-.-