esphome-docs/components/sensor/bh1750.rst

65 lines
2.3 KiB
ReStructuredText
Raw Normal View History

2018-05-14 21:15:49 +02:00
BH1750 Ambient Light Sensor
===========================
2018-11-14 22:12:27 +01:00
.. seo::
2019-02-16 23:25:23 +01:00
:description: Instructions for setting up BH1750 ambient light sensors in ESPHome.
2018-11-14 22:12:27 +01:00
:image: bh1750.jpg
:keywords: BH1750
2018-05-14 21:15:49 +02:00
The ``bh1750`` sensor platform allows you to use your BH1750
(`datasheet <http://www.mouser.com/ds/2/348/bh1750fvi-e-186247.pdf>`__)
2019-02-16 23:25:23 +01:00
ambient light sensor with ESPHome. The :ref:`I²C bus <i2c>` is required to be set up in
2018-05-14 21:15:49 +02:00
your configuration for this sensor to work.
2018-06-01 18:10:00 +02:00
.. figure:: images/bh1750-full.jpg
:align: center
:width: 50.0%
2018-05-14 21:15:49 +02:00
BH1750 Ambient Light Sensor.
2018-05-14 21:15:49 +02:00
.. figure:: images/bh1750-ui.png
:align: center
:width: 80.0%
.. code-block:: yaml
2018-05-14 21:15:49 +02:00
# Example configuration entry
sensor:
- platform: bh1750
name: "BH1750 Illuminance"
2018-05-14 21:15:49 +02:00
address: 0x23
measurement_time: 69
2019-01-06 18:56:14 +01:00
update_interval: 60s
2018-05-14 21:15:49 +02:00
By default the **measurement_time** is set to ``69`` which will result into measurements up
to 54612.5 lx for this sensor. For low-light situtations consider to choose a higer
measurement_time up to ``254`` which will result in a maximum measurement range up to 14835 lx.
For sunny scenes (for example outdoors with sunlight) use lower values down to ``31`` which will
give you the maximum measurement range up to 121556 lx.
2018-05-14 21:15:49 +02:00
Configuration variables:
2018-08-24 22:44:01 +02:00
------------------------
2018-05-14 21:15:49 +02:00
2018-06-01 18:10:00 +02:00
- **name** (**Required**, string): The name for the sensor.
- **address** (*Optional*, int): Manually specify the I²C address of the sensor.
2018-06-01 18:10:00 +02:00
Defaults to ``0x23`` (address if address pin is pulled low). If the address pin is pulled high,
the address is ``0x5C``.
- **measurement_time** (*Optional*, int): Manually specifiy the measurement time between ``31``
and ``254``. Defaults to ``69``.
2018-06-01 18:10:00 +02:00
- **resolution** (*Optional*, string): The resolution of the sensor in lx. One of ``4.0``,
``1.0``, ``0.5``. Defaults to ``0.5`` (the maximum resolution).
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
2019-01-06 18:56:14 +01:00
sensor. Defaults to ``60s``.
2018-06-01 18:10:00 +02:00
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code
generation.
2019-02-17 12:28:17 +01:00
- All other options from :ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
See Also
2018-08-24 22:44:01 +02:00
--------
2018-06-01 18:10:00 +02:00
- :ref:`sensor-filters`
- :doc:`tsl2561`
- :apiref:`bh1750/bh1750.h`
2018-08-24 22:44:01 +02:00
- `BH1750 Library <https://github.com/claws/BH1750>`__ by `@claws <https://github.com/claws>`__
- :ghedit:`Edit`