Distance - VL53L0X (200cm)¶
Time-of-Flight Distance sensor
Plugin details¶
Type: Distance
Name: VL53L0X
Status ESP32: COLLECTION B
Status ESP8266: COLLECTION B
GitHub: P110_VL53L0X.ino
Maintainer: TD-er, clumsy-stefan, tonhuisman
Used libraries: https://github.com/pololu/vl53l0x-arduino (local copy)
Description¶
This I2C sensor with 2 ranges offers distance measurement based on a Laser Time-of-Flight sensor. Output result is in millimeters.
Configuration¶
Name A unique name should be entered here.
Enabled The device can be disabled or enabled. When not enabled the device should not use any resources.
I2C Options¶
The available settings here depend on the build used. At least the Force Slow I2C speed option is available, but selections for the I2C Multiplexer can also be shown. For details see the I2C Bus page
I2C Address: The address the device is using. Some boards holding this chip offer an extra connection SDO that can be used to select the address, other boards just allow to select the secondary address and keep that active until the next power-cycle of the sensor.
Device Settings¶
Timing: The timing setting of the sensor determines the accuracy of the measurement. There are 3 options available:
Normal The default value (80 msec.)
Fast A faster but less accurate measurement (20 msec.) Can be used with a high speed read interval (1-5 sec).
Accurate A slower but far more accurate measurement (320 msec.) For use with a longer read interval setting (30-60 sec).
Range: the measuring ranges:
Normal For measurements in the 0 to 800 millimeter range.
Long For measurements in the 0 to 2000 millimeter range (but somewhat less accurate).
Send event when value unchanged: When checked, will generate events for every Interval, when unchecked and Interval is set to 0, a change in Distance will immediately trigger events. (NB: Behavior changed since 2024/04/27, when this option was added)
Trigger delta To avoid triggering many events with only a small difference in distance the ‘Trigger delta’ option is available. This can be set to only trigger an event when the new distance is at least the delta less or more than the previous measurement.
NB: This setting is ignored if ‘Send event when value unchanged’ is checked!
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 can now be set to 0, causing events to only be generated when changed, with Trigger delta calculated in.
Values¶
There are 2 values available for this sensor, with the default name Distance and Direction. A formula can be set to recalculate the distance, f.e. to centimeters using %value%/10. The number of decimals can be set to 0, when using millimeters, as no decimals are provided from the measurement.
Value Direction holds the direction relative to the previous distance value: -1 = smaller distance, 0 = unchanged distance, 1 = greater distance.
Change log¶
Changed in version 2.0: …
added 2024-04-27 Add options for Send event when value unchanged and Trigger delta, causing somewhat changed behavior.
added 2021-02-06 Moved to main repository Plugin 110 from PluginPlayground Plugin 133
added 2021-02-06 Refactoring to allow multiple instances of the plugin (when using an I2C multiplexer)