After testing the single modules for a sensor I finished the combination. Now the ESP8266 reads the temperature and humidity and sends them to the MQTT broker together with the actual voltage and the number of attempts to make a connection to the broker. The later is useful, because the ESP cannot reliably connect to the broker. I don’t know the reason, some investigation is necessary.
After a lot of gambling around with a breadboard and afterwards soldering on a perfboard, I finished the first version of the sensor, which I want to spread in my flat. So the hardware is finished (for now – there are ideas for improvement). For the software I tested the individual parts.