I think i'd better continue the post about my "bird house" here.
(From the Hardware pron pics thread.)
The base is a Wemos D1 mini (ESP8266 based) with:
- BME280 Temp/ Hum/ Press sensor
- BH1750 Lux sensor
- 2x 160mW / 5V solarpanel (with a diode per panel) for charging
- TP4056 with battery-protection (6 connections: 2x IN, 2x OUT and 2x BATT)
- Wemos D1 mini proto board
- 100k resistor
- 18650 2200mAh batterycell
- some headers
To monitor the battery power i added the 100k resistor between the +5v (connection of battery to Wemos D1) and A0. Don't know on what website i found that on.
On the Wemos D1 mini there is (a recent) ESPEasy.
It has 5 devices configured:
- BME280 - I2C
- BH1750 - I2C
- Analog Input
- Generic - Dummy 1 (%)
- Generic - Dummy 2 (Vcc)
For the calculations the Dummy devices are needed.
In the rules section i have these calculations:
Where you should change the "<name_of_analog_device>" to, well, the name of the analog device, as on device tab.
Code: Select all
On <name_of_analog_device>#Analog do TaskValueSet 4,1,([<name_of_analog_device>#Analog]/966)*100 TaskValueSet 5,1,([<name_of_analog_device>#Analog]*4.5)/1024 endon
And also check if the 4th device is the % one, and 5th is Vcc one.
Send the 4th device, the batterylevel, to a dummy device in domoticz that shows %,
And same for the 5th, the Volt one.
The 966 is what the analog-device shows as output when the fully charged battery is connected to the Wemos.
The 4.5 is when i needed to get the 966 to 4.24V, which i measured from the battery with a multi-meter.
The Wemos goes into a deep sleep after the sensors are read, for 5minutes.
(don't forget the extra connection between GPIO16 (D0) and RST)
I hope i mentionend everything here. If something is not clear, let me know