This is an esphome component for the LTR390 (ltr390) UV and ambient light sensor.
Copy the ltr390
directory into your ESPHome custom_components
directory (creating it if it does not exist).
The I2C Bus must be set up in order for this component to work.
The following configuration shows the minimal set up to read temperature and humidity from the sensor.
i2c:
sensor:
- platform: ltr390
uv:
name: "LTR390 UV"
light:
name: "LTR390 Light"
light
: calculated lux (lx)als
: raw light sensor count (#)uvi
: calculated UV Index (UVI)uv
: raw UV sensor count (#)
gain
: Adjusts the sensitivity of the sensor. A larger value means higher sensitivity. See table below for details. Default is"X3"
.resolution
: ADC resolution. Higher resolutions require longer sensor integration times. See table below for details. Default is18
.wfac
: Window correction factor. Use larger values when using under tinted windows. Default is 1.0, must be >= 1.0.address
: The I2C address of the device. Default is0x53
.update_interval
: How frequently to poll the device. It is recommended that the update interval is at least 1 second since updates can take up to 800ms when using a high resolution value. Default is60s
.
- platform: ltr390
light:
name: "LTR390 Light"
als:
name: "LTR390 ALS Count"
uvi:
name: "LTR390 UVI"
uv:
name: "LTR390 UV"
gain: "X3"
resolution: 18
wfac: 1
address: 0x53
update_interval: 60s
where:
als
anduv
are the sensor valuesgain
is the amount of gain, see the table below for detailsint
is the integration time in 100s of ms and is tied to the resolution, see the table below for detailssensitivity
has the value2300
and is the sensor's count per UVIwfac
is the window correction factor
|
|
The hardware is available from Adafruit https://www.adafruit.com/product/4831