esphome-docs/esphomeyaml/components/sensor/bh1750.rst
2018-05-17 18:58:01 +02:00

49 lines
2.0 KiB
ReStructuredText

BH1750 Ambient Light Sensor
===========================
.. warning::
This sensor is experimental has not been fully tested yet as I do not own all sensors. If you
can verify it works (or if it doesn't), please notify me on `discord <https://discord.gg/KhAMKrd>`__.
The ``bh1750`` sensor platform allows you to use your BH1750
(`datasheet <http://www.mouser.com/ds/2/348/bh1750fvi-e-186247.pdf>`__, `Aliexpress`_, `mklec`_)
ambient light sensor with esphomelib. The `I²C
bus </esphomeyaml/components/i2c.html>`__ is required to be set up in
your configuration for this sensor to work.
.. figure:: /esphomeyaml/components/sensor/images/bh1750-full.jpg
:align: center
:target: `Aliexpress`_
:width: 50.0%
BH1750 Ambient Light Sensor. Images from `Aliexpress`_ and `mklec`_.
.. _Aliexpress: https://www.adafruit.com/product/1603
.. _mklec: http://mklec.com/modules/micro-controller-modules/bh1750-bh1750fvi-digital-light-sensor-module
.. code:: yaml
# Example configuration entry
sensor:
- platform: bh1750
address: 0x23
update_interval: 15s
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name for the sensor.
- **address** (*Optional*, int): Manually specify the i^2c address of the sensor.
Defaults to ``0x23`` (address if address pin is pulled low). If the address pin is pulled high,
the address is ``0x5C``.
- **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*, `time </esphomeyaml/configuration-types.html#time>`__): The interval to check the
sensor. Defaults to ``15s``.
- **id** (*Optional*, `id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID used for code
generation.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.