For the glass you want Far UV Grade Fused Silica Quartz. This is frequently sold in 30mm squares. I have one and it does not affect the readings from quick testing. My regular windows reduce UVI reading by one decimal place (0.14 → 0.014).
Plan on installing this in a weather station so the readings will probably change.
I have the same weird index values. And I think I figured out the issues. I opened an issue in the esphome github, the details are there:
Until it is fixed in the esphome depository, here are the possible workarounds:
workaround 1:
The resolution config does not work, so leave it at 18-bit default.
The UVI calculation depends on the resolution config and gain config, so calculate your own using this formula:
UVI = ( uv / 2300 * wfac ) * 4 * ( 18 / gain )
The first part is the original formula.
The x 4 is to adjust for being at default 18-bit resolution instead of 20-bit.
The x 18 / gain is to adjust for actual gain configured vs x18 gain assumed in the original formula.
workaround 2:
Use the esphome external components method to override the ltr390 component.
Set up the external component by downloading the ltr390 files from the esphome github, you should get 4 files in the ltr390 directory. Overwrite the ltr390.cpp file by the file I attached in the opened issue above (the attached file should be renamed to ltr390.cpp).
Does this lamda look right?
Also, are the wfac and gain correct assuming I’m not changing any of the defaults?
I’m still getting UVI values about 1/4 what is published for my zip code.
I’m not having any luck receiving data from my Gravity LTR390-UV. It’s connected to a ESP32ThingPlus using the default pins SDA: GPIO23 and SCL: GPIO22.
I’m at a point where I at least get the device discovered. I have experimented with a few different approaches using code others have found works. What should I expect to see? has anyone any suggestions on how I could test to see if it’s even functional. beginning to think I’ve got a dud sensor.
[14:13:02][C][i2c.arduino:054]: SDA Pin: GPIO23
[14:13:02][C][i2c.arduino:055]: SCL Pin: GPIO22
[14:13:02][C][i2c.arduino:056]: Frequency: 50000 Hz
[14:13:02][C][i2c.arduino:059]: Recovery: bus successfully recovered
[14:13:02][I][i2c.arduino:069]: Results from i2c bus scan:
[14:13:02][I][i2c.arduino:075]: Found i2c device at address 0x1C
so, to have it right, shall 2300 in the formula ( ((id(ltr390_uvs).state * wfac) / 2300) * 4 * ( 18 / gain )); be replaced by 1400, so ( ((id(ltr390_uvs).state * wfac) / 1400) * 4 * ( 18 / gain ));?
I know they updated the esphome page for this sensor, but I’m a little confused on which integration time to pick. There’s a chart at the bottom to find the correct integration time but:
They say the default gain should be X18
They say the default resolution should be 20
These are two different rows in the table - I would pick integration time of 100 based on the gain and 400 based on the resolution.
Any ideas what the correct integration time would be with those default gains/resolutions?