I’m using the code and fritz from pages 92ff. in “Home Automation using ESP8266”
I’ve tried two different dht11’s and one dht22, but all provide a temperature reading which is (comparing it with an accurate thermometer I’ve used in the past) a few degrees higher than my accurate thermometer.
Getting higher readings with the DHT11 is very common.
How many degrees higher? The DHT11 is a very cheap sensor and has +/- 2 degree accuracy.
Depending on how it is placed on your circuit, it may get some “heat” from other parts of the circuit.
If the sensors always behaves similarly (for example, you always get more 2 degrees than it should), than, you can correct your value in the code as suggested here: https://forum.mysensors.org/topic/2622/can-you-calibrate-dht11
We have a blog post that compares the behavior of several temperature sensors on the same conditions that you may find interesting: https://randomnerdtutorials.com/dht11-vs-dht22-vs-lm35-vs-ds18b20-vs-bme280-vs-bmp180/