TSL2561¶
Light/Lux - TSL2561 NORMAL CLIMATE
Introduction¶
The TSL2561 are light-to-digital converters that transform light intensity to a digital signal output. First targeted to accompany LCD and OLED displays in order to dim them if the ambient light is lower, making the battery life better for the unit its a part of. The unit can also be found in illuminated keyboards and digital cameras.
The TSL2561 sensor is a luminosity sensor. It’s spectral sensitivity approximately meets the human eye sensitivity. The gain of the sensor can be set to a 16x gain mode with the settings. It is connected to the ESP via I²C so connecting even with several sensors and a display is easy to do.
- Specifications:
Output: 0.1 - 40 000+ Lux
Temperature (-30 to +70C but best readings between +5 to +50C)
Humidity (0 - 60 % rel. humidity)
Wiring¶
ESP TSL2561
GPIO (5) <--> SCL
GPIO (4) <--> SDA
ADDR (not used = 0x39)
Power
3.3V <--> VCC
GND <--> GND
The ADDR pin can be used if you have an i2c address conflict, to change the address.
Connect it to GND to set the address to 0x29.
Connect it to VCC (3.3V) to set the address to 0x49.
Leave it floating (unconnected) to use address 0x39.
Some boards have soldering pads or jumper selectors for the ADDR.
Setup¶
Task settings¶
Device: Name of plugin
Name: Name of the task (example name Light)
Enable: Should the task be enabled or not
Sensor¶
I2C Address: Default 0x39 is used.
Integration time: 13 msec is the default, works in normal lit areas. Increase the integration time for low light areas, it will collect light longer if set to longer time.
Send sensor to sleep: Have it checked in order to save the unit from wear, especially good if you do measurements with long intervals in between.
Enable 16x Gain: Have it checked in order to get higher readings in low light areas.
Data Acquisition¶
This group of settings are standard available configuration items.
Single event with all values: When this setting is enabled, all available values will be sent in a single event
<TaskName>#All, with all values in order as arguments to the event.Show derived values: When checked, the Devices overview page, and the
/jsonendpoint (used for updating the Devices overview page) will include any Derived values as defined. See theTaskValueSetDerivedandTaskValueSetPresentationcommands.Event & Log derived values: When checked, the Derived values will be generated as Events, to be handled in Rules, and sent to logging devices like the Syslog server and/or SD-card logging.
(The derived values options are only available if String variables feature is included in the build.)
Send to Controller: Select the Controller(s) to send the Values to, either on a
TaskRuncommand applied to the task, or on an Interval time action.
Send to Controller is only visible when one or more Controllers are configured.
Depending on the controller capabilities, some configuration settings may be shown:
All configured Controllers are shown here, including the enabled or disabled state (multiple Controllers can be enabled, only a single MQTT Controller can be enabled at one time!).
For each controller the user can select wether the data should be sent on each Interval (or explicit TaskRun).
For the Domoticz controllers the value index (IDX) has to be configured.
For some controllers, like Home Assistant/openHAB, there are extra options available.
Group: This represents the group id to combine all values from multiple tasks into a single grouped-device during MQTT AutoDiscovery. Groups, by design, can span multiple ESPEasy devices, if desired, as long as the Task/Valuename combinations are unique. If a group should only combine Tasks from a single ESPEasy unit, the group id should be unique across multiple ESPEasy units. The group description, default Group <n>, can be adjusted in Home Assistant. If the Group value matches the current Unit nr, the Unit name,
%sysname%, is used instead of Group <nr>.Retained: For MQTT Controllers, this setting can be enabled to send the values for the current task with the Retain flag set. The Publish Retain flag in the Controller settings will override this by sending all task values with Retain flag enabled.
Send derived: This checkbox determines if any configured Derived values should also be sent to the controller (and included in the AutoDiscovery if that’s available and enabled).
Resend MQTT Discovery: When checked, will start a resend of the MQTT Discovery process for this task after a random delay, when Submit is clicked, so any changed settings will be updated in the MQTT broker. This setting is only available if the controller is enabled, the Auto Discovery feature is available and enabled for the controller. This setting is not stored.
Other controllers, like f.e. FHEM HTTP, do not support additional settings besides the checkbox to enable sending the data.
Interval: How often should the task publish its value (5..15 seconds is normal).
Indicators (recommended settings)¶
Indicator |
Value Name |
Interval |
Decimals |
Extra information |
|---|---|---|---|---|
Visible light |
VI_Lux |
10 |
0 |
In normal lit areas you probably don’t need a decimal. |
Infrared light |
IR_Lux |
10 |
0 |
Light not visible to humans but felt in some cases, used in dry saunas and patio heating etc. |
Broadband light |
BR_Lux |
10 |
0 |
Visible or near visible light that is felt, used in skin treatments etc. |
Rules examples¶
on Light#VI_Lux do
if Light#VI_Lux>100
Publish,%sysname%/light,Is on
else
Publish,%sysname%/light,Is off
endif
endon
Where to buy¶
Store |
Link |
|---|---|
AliExpress |
|
Banggood |
|
eBay |
$ = affiliate links which will give us some money to keep this project running, thank you for using those.