Page 1 of 1

Newbie question: LDR

Posted: 25 May 2019, 10:43
by pgielen
I have just succesfully flashed my first Wemos D1 with ESP Easy and got a PIR sensor to work following the tutorial in the Wiki. The values are read in Domoticz. Now, of course I want to add a LDR in a voltage divider circuit, following this tutorial: ... e_resistor. In the newest version of ESP Easy, the settings are not the same as in the wiki tutorial, for example, I do not see a delay or port setting, but I think these should work:

Code: Select all

Device: Analog input - ADS1115
Name: LDR
Enabled: checked
I2C Address: default
Gain: 1x
Input multiplexer: AIN0-AIN1 (Differential)	
Calibration: not checked
Send to Controller: checked
IDX: 182
Interval: 60 sec
Name #1 Analog
Formula: 100-%value%*100/32752
Decimals: 0
The idx 182 is of a virtual device I created in Domoticz, of the type LUX. The value however always stays 200, regardless if it is dark or light. The log file does not show any data coming in from ESP. Am I overlooking something?

I also tried changing the Device tot Analog - internal. No improvement.


Re: Newbie question: LDR

Posted: 25 May 2019, 12:28
by pgielen
I solved it myself... The LDR does not return a LUX value, but a voltage, so I had to create a Voltage device in Domoticz and set the formula in ESP Easy to (%value%/1024)*3.3
If light, the voltage is low, if dark, the voltage is high... :D