bruvv / LILYGO-T-Higrow-Esphome

GNU General Public License v2.0
30 stars 14 forks source link

Added variables for calibration #6

Closed wolph closed 1 year ago

wolph commented 1 year ago

I've added a few variables for calibration so it's not required to duplicate all files for every plant sensor :)

PS: why is lux multiplied by 200? Is the default value incorrect?

bruvv commented 1 year ago

The card that I use uses lumen instead of lux so the default lux isn't correct. I cannot find the correct calculation for it and found this: https://esphome.io/cookbook/temt6000.html Do you think this is better ?

wolph commented 1 year ago

Ah, that explains :)

For my devices it doesn't appear to be correct. At least... when comparing it to a cheap 5-in-1 multimeter it seems that the regular value is correct without conversion. But my boards are very old, probably among the first ones that LILYGO made.

bruvv commented 1 year ago

That think you are sending measures only lux, I think there is a difference in lux and luminosity. But I cannot tell what the real difference is since I have 0 knowledge. Only thing I know is that the lux data was way to low without the conversion compared to the xiaomi flower plants.

wolph commented 1 year ago

I've got no clue either, but for my device the values without the multiplication look reasonable. I've compared the values with several other of my light sensors and they are close enough to be roughly correct.

You can test your device with the values that wikipedia provides: https://en.wikipedia.org/wiki/Lux

Illuminance (lux) Surfaces illuminated by
0.0001 Moonless, overcast night sky (starlight)[4]
0.002 Moonless clear night sky with airglow[4]
0.05–0.3 Full moon on a clear night[5]
3.4 Dark limit of civil twilight under a clear sky[6]
20–50 Public areas with dark surroundings[7]
50 Family living room lights (Australia, 1998)[8]
80 Office building hallway/toilet lighting[9][10]
100 Very dark overcast day[4]
150 Train station platforms[11]
320–500 Office lighting[8][12][13][14]
400 Sunrise or sunset on a clear day.
1000 Overcast day;[4] typical TV studio lighting
10,000–25,000 Full daylight (not direct sun)[4]
32,000–100,000 Direct sunlight

Inside a living room with a few lights on should be about 50 lux

Having that said, the plantbook values are indeed rather high by comparison but that is to be expected. The sun gives an absolutely insane amount of light compared to indoor lighting :)

bruvv commented 1 year ago

Yup 50 sounds about right. But I rather have it default as it is now. And if people want to use lux they can remove it. I will merge it after a small change in the checks, thanks!