If you like to improve your setup I can recommend a BME280 (pressure, temperature, humidity) instead of the DHT22. It can be hooked on the same I2C bus as the BH1750. I used both (DHT & BME) in parallel for half of a year. The measurements of the BME are more accurate and less noisy.
Last remark: Did you remove the voltager divider of the Wemos D1 mini? Otherwise the measurements of ADC_MODE(ADC_VCC) aren’t useful. The ADC pin must float for ADC_VCC measurements.
The voltage divider is a feature of the Wemos D1 mini and can be hindrance if you want to use ADC_VCC. You can just remove the ADC_VCC code line and wire the ADC pin to your battery if the battery doesn’t supply more than 3.3V. I assume there is a voltage regulator between the battery and your ESP8266.
Thanks for all your assistance with this. I’ve learned a lot more about the inner workings of MQTT as a result and will be delving further into this area with future automations.
refers to GPIO2 on the NodeMCU. On the drawing you can see that this is D4, and this is where I have connected my sensor.
From your picture I see you have connected it to D6.
So you should try this line
ok, sorry that makes sense. D04 is GPI02 on my db as well so that’s where I’ll place the wire. I have the RST to D0 pin as well to allow for deep sleep.
Still no response for temp and humidity but the NodeMCU light is now constantly on, not just flicking on when power is connected.
Could you check the size of your pull resistor of your DHT11 sensor board. May be this is the problem and the pull-up resistor is sized for 5V instead of 3.3V.
it’s 4.7k ohm but I am powering it from the VIN pin which is 5V isn’t it? This is from the original layout from the initial sketch I used. Should I change to 3.3 pin?
cool. so at this stage I’m thinking the DHT11 is cactus. the fact I get this output now
sensor/bathroom/temperature nan
sensor/bathroom/battery 2.94
sensor/bathroom/humidity nan
makes me very happy. Sadly I do not have a spare DHT or alternative sensor available to test but will try to organise something tomorrow. Here in Australia everything needs to be ordered in but I can get something within a week or so at the outside so will then hopefully have this up and reporting in as desired.
Can’t wait as then I can set several of them up for other rooms to assist in triggering automations.