Home Elements Boards Recipes

BH1750 Element

The BH1750Element allows retrieving the environment light intensity from BH1750 Ambient Light based sensors using the i2c bus for communication

From the values of the sensor the lightness in lumen (lx) can directly be calculated as the sensor delivers a linear equivalence.

The actual conversion factor can be given by a setup parameter.

The i2c bus interface offers a simple communication implementation with the sensor so no external library is required.

The sensor offers 3 different resolutions each in continuous or single measurement mode. The Element implementation supports the 3 modes of taking single probes and the timing parameters of the Sensor Element implementation.

Element Configuration

The following properties are available for configuration of the element:

address – The I2C Address of the sensor. The default value is 0x23.

factor – The factor used to convert the raw sensor value into lumen (lx). The default value is 1.2 from the datasheet.

mode – The following probing modes are supported by the element implementation:

From the base Sensor Element implementation the following properties are available for configuration:

readTime – Time between 2 probes being fetched from the sensor. Default value is 1m.

resendTime – The current values of the probe are resent after this specified time even when not changing.

warmupTime – This time is waited after powering the sensor on the first start or after a reset before the first data is fetched. The default time is set to 3 seconds.

restart – This property can be set to true to enable an automated restart when the sensor was not responding data.

From the base element implementation the following properties are available for configuration:

title – Caption text for the element. Used by the element specific cards on the dash boards.

description – A line of text that gives a short description of the device used in the web UI.

room – The location of the device.

loglevel – This property holds the element specific log level. The default value is LOGGER_LEVEL_ERR == 1.

startup – This property can be used to start the element using a different initialization phase. Possible values are “sys”, “net”, “time”. See The Startup sequence.

Configuration Example

This example shows how to configure this element:

{
  "bh1750": {
    "daylight": {
      "address": "0x23",
      "readtime": "30s"
    }
  }
}

State

The following properties are available with the current values at runtime:

active – Is set to true when the element is active.

value – The current sensor value.

Example State

{
  "bh1750/new": {
    "active":"true",
    "value":"705.6"
  }
}

See also

Tags

Element Sensor