Documentation update

This commit is contained in:
Otto Winter 2018-06-01 18:10:00 +02:00
parent d421b904f3
commit dd32551b52
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
234 changed files with 5628 additions and 1982 deletions

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "esphomelib"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.5.1
PROJECT_NUMBER = 1.5.3
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -15,9 +15,10 @@ Supported Binary Sensors
.. toctree::
GPIO Binary Sensor <gpio>
Node Status Binary Sensor <status>
ESP32 Touch Binary Sensor <esp32_touch>
gpio
status
esp32_touch
template
Example Usage
-------------

View File

@ -0,0 +1,16 @@
Template Binary Sensor
======================
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_template_binary_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: binary_sensor::TemplateBinarySensor
:members:
:protected-members:
:undoc-members:

7
api/core/automation.rst Normal file
View File

@ -0,0 +1,7 @@
Automation
==========
API Reference
-------------
.. doxygenfile:: esphomelib/automation.h

View File

@ -9,83 +9,12 @@ API Reference
helpers.h
*********
.. doxygentypedef:: json_parse_t
.. doxygenfile:: esphomelib/helpers.h
.. doxygentypedef:: json_build_t
optional.h
**********
.. doxygenvariable:: HOSTNAME_CHARACTER_WHITELIST
.. doxygenfunction:: get_mac_address
.. doxygenfunction:: generate_hostname
.. doxygenfunction:: sanitize_hostname
.. doxygenfunction:: truncate_string
.. doxygenfunction:: is_empty
.. doxygenfunction:: reboot
.. doxygenfunction:: add_shutdown_hook
.. doxygenfunction:: safe_reboot
.. doxygenfunction:: add_safe_shutdown_hook
.. doxygenfunction:: to_lowercase_underscore
.. doxygenfunction:: build_json
.. doxygenfunction:: parse_json
.. doxygenfunction:: clamp
.. doxygenfunction:: lerp
.. doxygenfunction:: make_unique
.. doxygenfunction:: random_uint32
.. doxygenfunction:: random_double
.. doxygenfunction:: random_float
.. doxygenfunction:: gamma_correct
.. doxygenfunction:: value_accuracy_to_string
.. doxygenfunction:: uint64_to_string
.. doxygenfunction:: uint32_to_string
.. doxygenfunction:: sanitize_string_whitelist
.. doxygenfunction:: disable_interrupts
.. doxygenfunction:: enable_interrupts
.. doxygenfunction:: crc8
.. doxygenclass:: Optional
:members:
:protected-members:
:undoc-members:
.. doxygenfunction:: parse_on_off
.. doxygenclass:: SlidingWindowMovingAverage
:members:
:protected-members:
:undoc-members:
.. doxygenclass:: ExponentialMovingAverage
:members:
:protected-members:
:undoc-members:
.. doxygenclass:: CallbackManager
:members:
:protected-members:
:undoc-members:
.. doxygenfile:: esphomelib/optional.h
ESPPreferences
**************

View File

@ -16,3 +16,4 @@ Core
Web Server <web-server>
Deep Sleep <deep-sleep>
I2C <i2c>
Automation <automation>

52
api/cover/index.rst Normal file
View File

@ -0,0 +1,52 @@
Cover
=====
Supported Covers
----------------
.. toctree::
template
Example Usage
-------------
See :cpp:func:`Application::register_cover`.
API Reference
-------------
.. cpp:namespace:: nullptr
Cover
*****
.. doxygenclass:: cover::Cover
:members:
:protected-members:
:undoc-members:
.. doxygenenum:: cover::CoverState
.. doxygenclass:: cover::OpenAction
:members:
:protected-members:
:undoc-members:
.. doxygenclass:: cover::CloseAction
:members:
:protected-members:
:undoc-members:
.. doxygenclass:: cover::StopAction
:members:
:protected-members:
:undoc-members:
MQTTCoverComponent
******************
.. doxygenclass:: cover::MQTTCoverComponent
:members:
:protected-members:
:undoc-members:

16
api/cover/template.rst Normal file
View File

@ -0,0 +1,16 @@
Template Cover
==============
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_template_cover`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: cover::TemplateCover
:members:
:protected-members:
:undoc-members:

View File

@ -11,4 +11,5 @@ API Reference
Fan <fan/index>
Light <light/index>
Switch <switch/index>
Cover <cover/index>
Miscellaneous <misc/index>

View File

@ -4,6 +4,8 @@ ESP8266 Software PWM
Software PWM for the ESP8266. Warning: This is a *software* PWM and therefore can have noticeable flickering.
Additionally, this software PWM can't output values higher than 80%. That's a known limitation.
.. _esp8266_pwm-example_usage:
Example Usage
-------------

View File

@ -1,11 +1,6 @@
BME280 Temperature/Pressure/Humidity Sensor
===========================================
.. warning::
This sensor is experimental has not been tested yet. If you can verify it works (or if it doesn't),
notify me on `discord <https://discord.gg/KhAMKrd>`__.
The BME280 sensor allows you to use your BME280 i2c-enabled temperature+pressure+humidity sensor with
esphomelib (`datasheet <https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf>`__,
`adafruit <https://www.adafruit.com/product/2652>`__). It requires i2c to be setup to work.
@ -41,9 +36,9 @@ API Reference
.. doxygenenum:: sensor::BME280Oversampling
.. doxygenenum:: sensor::BME280IIRFilter
.. doxygentypdef:: sensor::BME280TemperatureSensor
.. doxygentypdef:: sensor::BME280PressureSensor
.. doxygentypdef:: sensor::BME280HumiditySensor
.. doxygentypedef:: sensor::BME280TemperatureSensor
.. doxygentypedef:: sensor::BME280PressureSensor
.. doxygentypedef:: sensor::BME280HumiditySensor
.. doxygenstruct:: sensor::BME280CalibrationData
:members:

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -41,10 +41,10 @@ API Reference
.. doxygenenum:: sensor::BME680Oversampling
.. doxygenenum:: sensor::BME680IIRFilter
.. doxygentypdef:: sensor::BME680TemperatureSensor
.. doxygentypdef:: sensor::BME680PressureSensor
.. doxygentypdef:: sensor::BME680HumiditySensor
.. doxygentypdef:: sensor::BME2680GasResistanceSensor
.. doxygentypedef:: sensor::BME680TemperatureSensor
.. doxygentypedef:: sensor::BME680PressureSensor
.. doxygentypedef:: sensor::BME680HumiditySensor
.. doxygentypedef:: sensor::BME2680GasResistanceSensor
.. doxygenstruct:: sensor::BME680CalibrationData
:members:

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -22,11 +22,13 @@ See :cpp:func:`Application::register_sensor`.
hdc1080.rst
mpu6050.rst
tsl2561.rst
bht1750.rst
bme280.rst
bme680.rst
sht3xd.rst
bh1750.rst
max6675.rst
rotary_encoder.rst
template.rst
API Reference

16
api/sensor/max6675.rst Normal file
View File

@ -0,0 +1,16 @@
MAX6675 K-Type Thermocouple Temperature Sensor
==============================================
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_max6675_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::MAX6675Sensor
:members:
:protected-members:
:undoc-members:

View File

@ -0,0 +1,16 @@
Rotary Encoder Sensor
=====================
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_rotary_encoder_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::RotaryEncoderSensor
:members:
:protected-members:
:undoc-members:

16
api/sensor/template.rst Normal file
View File

@ -0,0 +1,16 @@
Template Sensor
===============
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_template_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::TemplateSensor
:members:
:protected-members:
:undoc-members:

View File

@ -5,9 +5,10 @@ The `switch_` namespace contains all switch helpers.
.. toctree::
IR Transmitter <ir-transmitter>
Restart Switch <restart>
Shutdown Switch <shutdown>
ir-transmitter
restart
shutdown
template
API Reference
-------------

14
api/switch/template.rst Normal file
View File

@ -0,0 +1,14 @@
Template Switch
===============
See :cpp:func:`Application::make_template_switch`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: switch_::TemplateSwitch
:members:
:protected-members:
:undoc-members:

View File

@ -23,6 +23,9 @@
import os
import subprocess
from sphinx import addnodes
from sphinx.util.docfields import Field, GroupedField
import re
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
@ -71,7 +74,7 @@ author = 'Otto Winter'
# The short X.Y version.
version = '1.5'
# The full version, including alpha/beta/rc tags.
release = '1.5.1'
release = '1.5.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -167,6 +170,8 @@ latex_documents = [
'Otto Winter', 'manual'),
]
latex_engine = 'xelatex'
# -- Options for manual page output ---------------------------------------
@ -188,4 +193,3 @@ texinfo_documents = [
author, 'esphomelib', 'One line description of project.',
'Miscellaneous'),
]

View File

@ -0,0 +1,6 @@
Binary Sensor Core, components/binary_sensor/index, folder-open.svg
GPIO, components/binary_sensor/gpio, pin.svg
Status, components/binary_sensor/status, server-network.svg
ESP32 BLE Device, components/binary_sensor/esp32_ble, bluetooth.svg
ESP32 Touch Pad, components/binary_sensor/esp32_touch, touch.svg
Template Binary Sensor, components/binary_sensor/template, description.svg
1 Binary Sensor Core components/binary_sensor/index folder-open.svg
2 GPIO components/binary_sensor/gpio pin.svg
3 Status components/binary_sensor/status server-network.svg
4 ESP32 BLE Device components/binary_sensor/esp32_ble bluetooth.svg
5 ESP32 Touch Pad components/binary_sensor/esp32_touch touch.svg
6 Template Binary Sensor components/binary_sensor/template description.svg

View File

@ -2,17 +2,15 @@ ADS1115 Hub
===========
The ``ads1115`` domain creates a global hub so that you can later create
individual sensors using the `ADS1115 Sensor
Platform </esphomeyaml/components/sensor/ads1115.html>`__. To use this
hub, first setup the `I²C Bus </esphomeyaml/components/i2c.html>`__ and
connect the sensor to the pins specified there.
individual sensors using the :doc:`ADS1115 Sensor Platform </esphomeyaml/components/sensor/ads1115>`.
To use this hub, first setup the :ref:`I²C Bus <i2c>` and connect the sensor to the pins specified there.
.. figure:: /esphomeyaml/components/sensor/images/ads1115-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: sensor/images/ads1115-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
ADS1115 16-Bit ADC. Image by `Adafruit`_.
ADS1115 16-Bit ADC. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/1085
@ -24,11 +22,12 @@ connect the sensor to the pins specified there.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **address** (**Required**, int): The i²c address of the sensor. See
`I²C Addresses <#i2c-addresses>`__ for more information.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID for this ADS1115 Hub. Use this if you
want to use multiple ADS1115 hubs at once.
- **address** (**Required**, int): The i²c address of the sensor.
See :ref:`I²C Addresses <ads1115_i2c_addresses>` for more information.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this ADS1115 Hub. Use this if you
want to use multiple ADS1115 hubs at once.
.. _ads1115_i2c_addresses:
I²C Addresses
~~~~~~~~~~~~~
@ -37,8 +36,13 @@ In order to allow multiple sensors to be connected to the same i²c bus,
the creators of this sensor hardware have included some options to
change the i²c address.
- If the address pin is pulled to GND, the address is ``0x48``
(Default).
- If the address pin is pulled to GND, the address is ``0x48`` (Default).
- If the address pin is pulled to VCC, the address is ``0x49``.
- If the address pin is tied to SDA, the address is ``0x4a``.
- If the address pin is tied to SCL, the address is ``0x4B``.
See Also
^^^^^^^^
- :doc:`sensor/ads1115`
- :doc:`API Reference </api/sensor/ads1115>`

View File

@ -6,10 +6,12 @@ bluetooth low energy device.
.. note::
See the `ESP32 BLE Hub Page </esphomeyaml/components/esp32_ble.html>`__ for
See the :doc:`ESP32 BLE Hub Page </esphomeyaml/components/esp32_ble>` for
current limitations of this platform
|image0|
.. figure:: images/esp32_ble-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -28,13 +30,10 @@ Configuration variables:
- **mac_address** (**Required**, MAC Address): The MAC address to track for this
binary sensor.
- **name** (**Required**, string): The name of the binary sensor.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
- **id** (*Optional*, :ref:`config-id`): Manually specify
the ID used for code generation.
- All other options from `Binary
Sensor </esphomeyaml/components/binary_sensor/index.html#base-binary-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
and :ref:`MQTT Component <config-mqtt-component>`.
Setting Up Devices
~~~~~~~~~~~~~~~~~~
@ -58,7 +57,10 @@ currently not supported.
Please note that devices that show a ``RANDOM`` address type in the logs cannot be used for
tracking, since their MAC-address periodically changes.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/esp32_ble`
- :doc:`/esphomeyaml/components/binary_sensor/index`
- :doc:`API Reference </api/misc/esp32_ble_tracker>`
.. |image0| image:: /esphomeyaml/components/binary_sensor/esp32_ble.png
:class: align-center
:width: 80.0%

View File

@ -4,12 +4,14 @@ ESP32 Touch Pad Binary Sensor
The ``esp32_touch`` binary sensor platform lets you use the touch peripheral of the
ESP32 to detect if a certain pin is being "touched".
First, you need to setup the `global touch hub </esphomeyaml/components/esp32_touch.html>`__. Then
First, you need to setup the :doc:`global touch hub </esphomeyaml/components/esp32_touch>`. Then
you can add individual touch pads as binary sensors. When a touch is detected on these pins, the binary
sensor will report an ``ON`` state. And, of course, if no touch is detected, the binary sensor will report
an ``OFF`` state.
|image0|
.. figure:: images/esp32_touch-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -25,18 +27,16 @@ an ``OFF`` state.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin to detect touch
- **pin** (**Required**, :ref:`config-pin`): The pin to detect touch
events on.
- **threshold** (**Required**, int): The threshold to use to detect touch events. Smaller values mean
a higher probability that the pad is being touched.
- **name** (**Required**, string): The name of the binary sensor.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
:ref:`config-id`): Manually specify
the ID used for code generation.
- All other options from `Binary
Sensor </esphomeyaml/components/binary_sensor/index.html#base-binary-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
and :ref:`MQTT Component <config-mqtt-component>`.
Touch Pad Pins
~~~~~~~~~~~~~~
@ -63,7 +63,7 @@ raw values mean that it is more likely that a touch is happening. For example, v
1000 to 1600 usually mean the pad is not being touched, and values in the range of 600 and less
mean the pad is probably being touched.
To find suitable threshold values, first configure the `ESP32 touch hub </esphomeyaml/components/esp32_touch.html>`__
To find suitable threshold values, first configure the :doc:`ESP32 touch hub </esphomeyaml/components/esp32_touch>`
to output measured values using the ``setup_mode:`` configuration option. Next, add some binary sensors
for the touch pads you want to observe. Also put some threshold in the configuration as seen below
to make the validator happy, we are going to find good thresholds in a moment anyway.
@ -85,15 +85,16 @@ and you will (hopefully) see the value decreasing a bit. Play around with differ
force you put on the touch pad until you find a good value that can differentiate between
touch/non-touch events.
|image1|
.. figure:: images/esp32_touch-finding_thresholds.png
:align: center
Finally, put your threshold parameter in the configuration. Do not forget to disable the ``setup_mode``
option again by setting it to ``False``. Otherwise you will end up spamming the logs and slowing the device
down.
.. |image0| image:: /esphomeyaml/components/binary_sensor/esp32_touch.png
:class: align-center
:width: 80.0%
See Also
^^^^^^^^
.. |image1| image:: /esphomeyaml/components/binary_sensor/esp32_touch_finding_thresholds.png
:class: align-center
- :doc:`/esphomeyaml/components/esp32_touch`
- :doc:`/esphomeyaml/components/binary_sensor/index`
- :doc:`API Reference </api/binary_sensor/esp32_touch>`

View File

@ -4,7 +4,9 @@ GPIO Binary Sensor
The GPIO Binary Sensor platform allows you to use any input pin on your
device as a binary sensor.
|image0|
.. figure:: images/gpio-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -18,18 +20,15 @@ device as a binary sensor.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**, `Pin
Schema </esphomeyaml/configuration-types.html#pin-schema>`__): The
pin to periodically check.
- **name** (**Required**, string): The name of the binary sensor.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `Binary
Sensor </esphomeyaml/components/binary_sensor/index.html#base-binary-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin to periodically check.
- **name** (**Required**, string): The name of the binary sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
and :ref:`MQTT Component <config-mqtt-component>`.
.. |image0| image:: /esphomeyaml/components/binary_sensor/gpio.png
:class: align-center
:width: 80.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/binary_sensor/index`
- :ref:`config-pin_schema`
- :doc:`API Reference </api/binary_sensor/gpio>`

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -5,25 +5,11 @@ With esphomelib you can use different types of binary sensors. They will
automatically appear in the Home Assistant front-end and have several
configuration options.
Currently supported binary sensor platforms:
====================== ====================== ======================
|GPIO|_ |Status|_
---------------------- ---------------------- ----------------------
`GPIO`_ `Status`_
====================== ====================== ======================
.. |GPIO| image:: /esphomeyaml/images/pin.svg
:class: component-image
.. _GPIO: /esphomeyaml/components/binary_sensor/gpio.html
.. |Status| image:: /esphomeyaml/images/server-network.svg
:class: component-image
.. _Status: /esphomeyaml/components/binary_sensor/status.html
.. _config-binary_sensor:
Base Binary Sensor Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------
All binary sensors have a platform and an optional device class. By
default, the binary will chose the appropriate device class itself, but
@ -33,15 +19,148 @@ you can always override it.
binary_sensor:
- platform: ...
device_class: Device Class
device_class: motion
Configuration variables:
- **device_class** (*Optional*, string): The device class for the
sensor. See https://www.home-assistant.io/components/binary_sensor/
for a list of available options.
- **inverted** (*Optional*, boolean): Whether to invert the binary
sensor output, i.e. report ON states as OFF and vice versa. Defaults
to ``False``.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **device_class** (*Optional*, string): The device class for the
sensor. See https://www.home-assistant.io/components/binary_sensor/
for a list of available options.
- **inverted** (*Optional*, boolean): Whether to invert the binary
sensor output, i.e. report ON states as OFF and vice versa. Defaults
to ``False``.
- **on_press** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when the button is pressed. See :ref:`binary_sensor-on_press`.
- **on_release** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when the button is released. See :ref:`binary_sensor-on_release`.
- **on_click** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when the button is held down for a specified period of time.
See :ref:`binary_sensor-on_click`.
- **on_click** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when the button is pressed twice for specified periods of time.
See :ref:`binary_sensor-on_double_click`.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
Binary Sensor Automation
^^^^^^^^^^^^^^^^^^^^^^^^
The triggers for binary sensors in esphomeyaml use the lingo from computer mouses. This naming might not
perfectly fit every use case, but at least makes the naming consistent. For example, a ``press`` is triggered
in the first moment when the button on your mouse is pushed down.
You can access the current state of the binary sensor in :ref:`lambdas <config-lambda>` using
``id(binary_sensor_id).value``.
.. _binary_sensor-on_press:
``on_press``
""""""""""""
This automation will be triggered when the button is first pressed down, or in other words on the leading
edge of the signal.
.. code:: yaml
binary_sensor:
- platform: gpio
# ...
on_press:
then:
- switch.turn_on:
id: relay_1
Configuration variables: See :ref:`Automation <automation>`.
.. _binary_sensor-on_release:
``on_release``
""""""""""""""
This automation will be triggered when a button press ends, or in other words on the falling
edge of the signal.
.. code:: yaml
binary_sensor:
- platform: gpio
# ...
on_release:
then:
- switch.turn_off:
id: relay_1
Configuration variables: See :ref:`Automation <automation>`.
.. _binary_sensor-on_click:
``on_click``
""""""""""""
This automation will be triggered when a button is pressed down for a time period of length
``min_length`` to ``max_length``. Any click longer or shorter than this will not trigger the automation.
The automation is therefore also triggered on the falling edge of the signal.
.. code:: yaml
binary_sensor:
- platform: gpio
# ...
on_click:
min_length: 50ms
max_length: 350ms
then:
- switch.turn_off:
id: relay_1
Configuration variables:
- **min_length** (*Optional*, :ref:`config-time`): The minimum duration the click should last. Defaults to ``50ms``.
- **max_length** (*Optional*, :ref:`config-time`): The maximum duration the click should last. Defaults to ``350ms``.
- See :ref:`Automation <automation>`.
.. _binary_sensor-on_double_click:
``on_double_click``
"""""""""""""""""""
.. warning::
This trigger is not final and could be replaced by a ``on_multi_click`` option which would
allow triggering for any number of clicks.
This automation will be triggered when a button is pressed down twice, with the first click lasting between
``min_length`` and ``max_length``. When a second leading edge then happens within ``min_length`` and
``max_length``, the automation is triggered.
.. code:: yaml
binary_sensor:
- platform: gpio
# ...
on_double_click:
min_length: 50ms
max_length: 350ms
then:
- switch.turn_off:
id: relay_1
Configuration variables:
- **min_length** (*Optional*, :ref:`config-time`): The minimum duration the click should last. Defaults to ``50ms``.
- **max_length** (*Optional*, :ref:`config-time`): The maximum duration the click should last. Defaults to ``350ms``.
- See :ref:`Automation <automation>`.
See Also
--------
- :doc:`API Reference </api/binary_sensor/index>`
.. toctree::
:maxdepth: 1
gpio.rst
status.rst
esp32_ble.rst
esp32_touch.rst
template.rst

View File

@ -2,11 +2,12 @@ Status Binary Sensor
====================
The Status Binary Sensor exposes the node state (if its connected to
MQTT or not) for Home Assistant. It uses the `MQTT birth and last will
messages </esphomeyaml/components/mqtt.html#last-will-and-birth-messages>`__
MQTT or not) for Home Assistant. It uses the :ref:`MQTT birth and last will messages <mqtt-last_will_birth>`
to do this.
|image0|
.. figure:: images/status-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -18,16 +19,14 @@ to do this.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the binary sensor.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `Binary
Sensor </esphomeyaml/components/binary_sensor/index.html#base-binary-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
Inverted is not supported.
- **name** (**Required**, string): The name of the binary sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
and :ref:`MQTT Component <config-mqtt-component>`. (Inverted mode is not supported)
.. |image0| image:: /esphomeyaml/components/binary_sensor/status.png
:class: align-center
:width: 80.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/binary_sensor/index`
- :doc:`/esphomeyaml/components/mqtt`
- :doc:`API Reference </api/binary_sensor/status>`

View File

@ -0,0 +1,57 @@
Template Binary Sensor
======================
The ``template`` binary sensor platform allows you to define any :ref:`lambda template <config-lambda>`
and construct a binary sensor out if it.
For example, below configuration would turn the state of an ultrasonic sensor into
a binary sensor.
.. code:: yaml
# Example configuration entry
binary_sensor:
- platform: template
name: "Garage Door Open"
lambda: >-
if (isnan(id(ultrasonic_sensor1).value))) {
// isnan checks if the ultrasonic sensor echo
// has timed out, resulting in a NaN (not a number) state
// in that case, return {} to indicate that we don't know.
return {};
} else if (id(ultrasonic_sensor1).value > 30) {
// Garage Door is open.
return true;
} else {
// Garage Door is closed.
return false;
}
Possible return values of the lambda:
- ``return true;`` if the binary sensor should be ON.
- ``return false;`` if the binary sensor should be OFF.
- ``return {};`` if the last state should be repeated.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the binary sensor.
- **lambda** (**Required**, :ref:`lambda <config-lambda>`):
Lambda to be evaluated repeatedly to get the current state of the binary sensor.
Only state *changes* will be published to MQTT.
- **id** (*Optional*,
:ref:`config-id`): Manually specify
the ID used for code generation.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
and :ref:`MQTT Component <config-mqtt-component>`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/binary_sensor/index`
- :doc:`/esphomeyaml/components/sensor/template`
- :ref:`automation`
- :doc:`API Reference </api/binary_sensor/template>`

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,58 @@
Cover Component
===============
The ``cover`` component is a generic representation of covers in esphomelib/yaml.
A cover can (currently) either be *closed* or *open* and supports three types of
commands: *open*, *close* and *stop*.
.. _cover-open_action:
``cover.open`` Action
^^^^^^^^^^^^^^^^^^^^^
This action opens the cover with the given ID when executed.
.. code:: yaml
on_...:
then:
- cover.open:
id: cover_1
.. _cover-close_action:
``cover.close`` Action
^^^^^^^^^^^^^^^^^^^^^^
This action closes the cover with the given ID when executed.
.. code:: yaml
on_...:
then:
- cover.close:
id: cover_1
.. _cover-stop_action:
``cover.stop`` Action
^^^^^^^^^^^^^^^^^^^^^
This action stops the cover with the given ID when executed.
.. code:: yaml
on_...:
then:
- cover.stop:
id: cover_1
Full Cover Index
^^^^^^^^^^^^^^^^
- :doc:`API Reference </api/cover/index>`
.. toctree::
:maxdepth: 1
template.rst

View File

@ -0,0 +1,70 @@
Template Cover
==============
The ``template`` cover platform allows you to create simple covers out of just a few
actions and a value lambda. Once defined, it will automatically appear in Home Assistant
as a cover and can be controlled through the frontend.
.. figure:: images/cover-ui.png
:align: center
:width: 75.0%
.. code:: yaml
# Example configuration entry
cover:
- platform: template
name: "Template Cover"
lambda: >-
if (id(top_end_stop).value) {
return cover::COVER_OPEN;
} else {
return cover::COVER_CLOSED;
}
open_action:
- switch.turn_on:
id: open_cover_switch
close_action:
- switch.turn_on:
id: close_cover_switch
stop_action:
- switch.turn_on:
id: stop_cover_switch
optimistic: true
Possible return values for the optional lambda:
- ``return cover::COVER_OPEN;`` if the cover should be reported as OPEN.
- ``return cover::COVER_CLOSED;`` if the cover should be reported as CLOSED.
- ``return {};`` if the last state should be repeated.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the cover.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda to be evaluated repeatedly to get the current state of the cover.
Only state *changes* will be published to MQTT.
- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode,
any command sent to the template cover will immediately update the reported state and no lambda
needs to be used. Defaults to ``false``.
- **open_action** (*Optional*, :ref:`Action <config-action>`): The action that should
be performed when the remote (like Home Assistant's frontend) requests the cover to be opened.
- **close_action** (*Optional*, :ref:`Action <config-action>`): The action that should
be performed when the remote requests the cover to be closed.
- **stop_action** (*Optional*, :ref:`Action <config-action>`): The action that should
be performed when the remote requests the cover to stopped.
- **id** (*Optional*,
:ref:`config-id`): Manually specify
the ID used for code generation.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`
and :ref:`MQTT Component <config-mqtt-component>`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/cover/index`
- :ref:`automation`
- :doc:`/esphomeyaml/cookbook/garage-door`
- :doc:`API Reference </api/cover/template>`

View File

@ -4,7 +4,7 @@ Dallas Temperature Component
The ``dallas`` component allows you to use your
`DS18b20 <https://www.adafruit.com/product/374>`__
(`datasheet <https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf>`__)
and similar temperature sensors.
and similar One-Wire temperature sensors.
To use your dallas sensor, first define a dallas “hub” with a pin and
id, which you will later use to create the sensors. The 1-Wire bus the
@ -15,24 +15,24 @@ about 4.7KΩ.
# Example configuration entry
dallas:
- id: dallas_hub1
pin: 23
- pin: 23
# Individual sensors
sensor:
- platform: dallas
dallas_id: "dallas_hub1"
address: 0x1c0000031edd2a28
name: "Livingroom Temperature"
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**, number): The pin the sensor bus is connected
to.
- **update_interval** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The interval
that the sensors should be checked. Defaults to 15 seconds.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- **pin** (**Required**, number): The pin the sensor bus is connected to.
- **update_interval** (*Optional*, :ref:`config-time`): The interval that the sensors should be checked.
Defaults to 15 seconds.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
See Also
^^^^^^^^
- :doc:`sensor/dallas`
- :doc:`API Reference </api/sensor/dallas>`

View File

@ -4,7 +4,7 @@ Debug Component
The ``debug`` component can be used to debug problems with esphomelib. At startup, it prints
a bunch of useful information like reset reason, free heap size, esphomelib version and so on.
.. figure:: /esphomeyaml/components/debug.png
.. figure:: images/debug.png
:align: center
Example debug component output.
@ -19,3 +19,9 @@ a bunch of useful information like reset reason, free heap size, esphomelib vers
level: debug
There are no configuration variables for this component.
See Also
^^^^^^^^
- :doc:`logger`
- :doc:`API Reference </api/misc/debug>`

View File

@ -28,15 +28,20 @@ even Over The Air updates.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **run_duration** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__):
- **run_duration** (*Optional*, :ref:`config-time`):
The time duration the node should be active, i.e. run code.
- **run_cycles** (*Optional*, int): The number of ``loop()`` cycles to go through before
entering deep sleep mode.
- **sleep_duration** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__):
The time duration to stay in deep sleep mode.
- **wakeup_pin** (*Optional*, `Pin Schema </esphomeyaml/configuration-types.html#pin-schema>`__):
- **sleep_duration** (*Optional*, :ref:`config-time`): The time duration to stay in deep sleep mode.
- **wakeup_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`):
Only on ESP32. A pin to wake up to once in deep sleep mode. Use the inverted property to wake up
to LOW signals.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
See Also
^^^^^^^^
- :doc:`switch/shutdown`
- :ref:`automation`
- :doc:`API Reference </api/core/deep-sleep>`

View File

@ -34,10 +34,13 @@ for information on how you can find out the MAC address of a device and track it
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **scan_interval** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): The length of each scan.
If a device is not found within this time window, it will be marked as not present. Defaults to 300s.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID for this ADS1115 Hub. Use this if you
want to use multiple ADS1115 hubs at once.
- **scan_interval** (*Optional*, :ref:`config-time`): The length of each scan.
If a device is not found within this time window, it will be marked as not present. Defaults to 300s.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this ADS1115 Hub. Use this if you
want to use multiple ADS1115 hubs at once.
See Also
^^^^^^^^
- :doc:`binary_sensor/esp32_ble`
- :doc:`API Reference </api/misc/esp32_ble_tracker>`

View File

@ -2,7 +2,7 @@ ESP32 Touch Pad Hub
===================
The ``esp32_touch`` component creates a global hub for detecting touches on
the eight touch pads of the ESP32 as `binary senors </esphomeyaml/components/binary_sensor/esp32_touch.html>`__.
the eight touch pads of the ESP32 as :doc:`binary senors </esphomeyaml/components/binary_sensor/esp32_touch>`.
.. code:: yaml
@ -21,30 +21,36 @@ Configuration variables:
- **setup_mode** (*Optional*, boolean): Whether debug messages with the touch pad value should
be displayed in the logs. Useful for finding out suitable thresholds for the binary sensors, but
spam the logs. See `setting up touch pads </esphomeyaml/components/binary_sensor/esp32_touch.html>`__
spam the logs. See :doc:`setting up touch pads </esphomeyaml/components/binary_sensor/esp32_touch>`
for more information. Defaults to false.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID for this ADS1115 Hub. Use this if you
:ref:`config-id`): Manually specify the ID for this ADS1115 Hub. Use this if you
want to use multiple ADS1115 hubs at once.
Advanced options (the defaults are usually quite good, but if you're having accuracy issues, use these):
- **iir_filter** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Optionally set up an
`Infinite Impulse Response <https://en.wikipedia.org/wiki/Infinite_impulse_response>`__
filter should be applied to all touch pads. This can increase the accuracy of the touch pads a lot, but
higher values decrease the response time. A good value to start with is ``10ms``. Default is no IIR filter.
- **sleep_duration** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Set a time period
denoting the amount of time the touch peripheral should sleep between measurements. This can decrease
power usage but make the sensor slower. Default is about 27 milliseconds.
- **measurement_duration** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Set the conversion
time for all touch pads. A longer conversion time means that more charge/discharge cycles of the touch pad
can be performed, therefore increasing accuracy. Default is about 8ms, the maximum amount.
- **low_voltage_reference** (*Optional*): The low voltage reference to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``0.5V``, ``0.6V``, ``0.7V``, ``0.8V``. Default is ``0.5V``.
- **high_voltage_reference** (*Optional*): The high voltage reference to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``2.4V``, ``2.5V``, ``2.6V``, ``2.7V``. Default is ``2.7V``.
- **voltage_attenuation** (*Optional*): The voltage attenuation to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``1.5V``, ``1V``, ``0.5V``, ``0V``. Default is ``0V``.
- **iir_filter** (*Optional*, :ref:`config-time`): Optionally set up an
`Infinite Impulse Response <https://en.wikipedia.org/wiki/Infinite_impulse_response>`__
filter should be applied to all touch pads. This can increase the accuracy of the touch pads a lot, but
higher values decrease the response time. A good value to start with is ``10ms``. Default is no IIR filter.
- **sleep_duration** (*Optional*, :ref:`config-time`): Set a time period
denoting the amount of time the touch peripheral should sleep between measurements. This can decrease
power usage but make the sensor slower. Default is about 27 milliseconds.
- **measurement_duration** (*Optional*, :ref:`config-time`): Set the conversion
time for all touch pads. A longer conversion time means that more charge/discharge cycles of the touch pad
can be performed, therefore increasing accuracy. Default is about 8ms, the maximum amount.
- **low_voltage_reference** (*Optional*): The low voltage reference to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``0.5V``, ``0.6V``, ``0.7V``, ``0.8V``. Default is ``0.5V``.
- **high_voltage_reference** (*Optional*): The high voltage reference to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``2.4V``, ``2.5V``, ``2.6V``, ``2.7V``. Default is ``2.7V``.
- **voltage_attenuation** (*Optional*): The voltage attenuation to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``1.5V``, ``1V``, ``0.5V``, ``0V``. Default is ``0V``.
See Also
^^^^^^^^
- :doc:`binary_sensor/esp32_touch`
- :doc:`API Reference </api/binary_sensor/esp32_touch>`

View File

@ -17,35 +17,32 @@ where you specify the **name** of the node, the **platform** and
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): This is the name of the node. It
should always be unique to the node and no other node in your system
can use the same name. It can also only contain upper/lowercase
characters, digits and underscores.
- **platform** (**Required**, string): The platform your board is on,
either ``ESP32`` or ``ESP8266``.
See `using the latest arduino framework version <#using-the-latest-arduino-framework-version>`__.
for other options.
- **board** (**Required**, string): The board esphomeyaml should
specify for platformio. For the ESP32, choose the appropriate one
from `this
list <http://docs.platformio.org/en/latest/platforms/espressif32.html#boards>`__
and use `this
list <http://docs.platformio.org/en/latest/platforms/espressif8266.html#boards>`__
for ESP8266-based boards.
- **library_uri** (*Optional*, string): You can manually specify the
`version of
esphomelib <https://github.com/OttoWinter/esphomelib/releases>`__ to
use here. Accepts all parameters of `platformio lib
install <http://docs.platformio.org/en/latest/userguide/lib/cmd_install.html#id2>`__.
Use ``https://github.com/OttoWinter/esphomelib.git`` for the latest
(unstable) build. Defaults to the latest stable version.
- **simplify** (*Optional*, boolean): Whether to simplify the
auto-generated code, i.e. whether to remove unused variables, use
``auto`` types and so on. Defaults to ``true``.
- **use_build_flags** (*Optional*, boolean): If esphomeyaml should manually set
build flags that specifically set what should be included in the binary. Most of
this is already done automatically by the linker but this option can help with
shrinking the firmware size while slowing down compilation. Defaults to ``true``.
- **name** (**Required**, string): This is the name of the node. It
should always be unique to the node and no other node in your system
can use the same name. It can also only contain upper/lowercase
characters, digits and underscores.
- **platform** (**Required**, string): The platform your board is on,
either ``ESP32`` or ``ESP8266``. See :ref:`using_latest_arduino_framework`.
- **board** (**Required**, string): The board esphomeyaml should
specify for platformio. For the ESP32, choose the appropriate one
from `this list <http://docs.platformio.org/en/latest/platforms/espressif32.html#boards>`__
and use `this list <http://docs.platformio.org/en/latest/platforms/espressif8266.html#boards>`__
for ESP8266-based boards.
- **library_uri** (*Optional*, string): You can manually specify the
`version of esphomelib <https://github.com/OttoWinter/esphomelib/releases>`__ to
use here. Accepts all parameters of `platformio lib
install <http://docs.platformio.org/en/latest/userguide/lib/cmd_install.html#id2>`__.
Use ``https://github.com/OttoWinter/esphomelib.git`` for the latest
(unstable) build. Defaults to the latest stable version.
- **simplify** (*Optional*, boolean): Whether to simplify the
auto-generated code, i.e. whether to remove unused variables, use
``auto`` types and so on. Defaults to ``true``.
- **use_build_flags** (*Optional*, boolean): If esphomeyaml should manually set
build flags that specifically set what should be included in the binary. Most of
this is already done automatically by the linker but this option can help with
shrinking the firmware size while slowing down compilation. Defaults to ``true``.
.. _using_latest_arduino_framework:
Using the latest Arduino framework version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,10 +1,11 @@
Binary Fan
==========
The ``binary`` fan platform lets you represent any binary `ouput
component </esphomeyaml/components/output/index.html>`__ as a fan.
The ``binary`` fan platform lets you represent any binary :ref:`output` as a fan.
|image0|
.. figure:: images/fan-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -17,21 +18,20 @@ component </esphomeyaml/components/output/index.html>`__ as a fan.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **output** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
binary output component to use for this fan.
- **name** (**Required**, string): The name for this fan.
- **oscillation_output** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): The output to use
for the oscillation state of this fan. Default is empty.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__
and `Fan
Component </esphomeyaml/components/fan/index.html#base-fan-configuration>`__.
- **output** (**Required**, :ref:`config-id`): The id of the
binary output component to use for this fan.
- **name** (**Required**, string): The name for this fan.
- **oscillation_output** (*Optional*, :ref:`config-id`): The id of the
:ref:`output <output>` to use for the oscillation state of this fan. Default is empty.
- **id** (*Optional*, :ref:`config-id`): Manually specify
the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`
and :ref:`Fan Component <config-fan>`.
.. |image0| image:: /esphomeyaml/components/fan/fan.png
:class: align-center
:width: 80.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/output/gpio`
- :doc:`/esphomeyaml/components/fan/index`
- :doc:`API Reference </api/fan/index>`

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -6,23 +6,11 @@ the Home Assistant frontend. A fan can be switched ON or OFF, optionally
has a speed setting (``LOW``, ``MEDIUM``, ``HIGH``) and can have an
oscillate output.
|image0|
.. figure:: images/fan-ui.png
:align: center
:width: 70.0%
Currently supported fan platforms:
======================== ======================== ========================
|Binary Fan|_ |Speed Fan|_
------------------------ ------------------------ ------------------------
`Binary Fan`_ `Speed Fan`_
======================== ======================== ========================
.. |Binary Fan| image:: /esphomeyaml/images/fan.svg
:class: component-image
.. _Binary Fan: /esphomeyaml/components/fan/binary.html
.. |Speed Fan| image:: /esphomeyaml/images/fan.svg
:class: component-image
.. _Speed Fan: /esphomeyaml/components/fan/speed.html
.. _config-fan:
Base Fan Configuration
~~~~~~~~~~~~~~~~~~~~~~
@ -35,18 +23,75 @@ Base Fan Configuration
Configuration variables:
- **name** (**Required**, string): The name of the fan.
- **oscillation_state_topic** (*Optional*, string): The topic to
publish fan oscillaiton state changes to.
- **oscillation_command_topic** (*Optional*, string): The topic to
receive oscillation commands on.
- **speed_state_topic** (*Optional*, string): The topic to publish fan
speed state changes to.
- **speed_command_topic** (*Optional*, string): The topic to receive
speedcommands on.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the fan.
- **oscillation_state_topic** (*Optional*, string): The topic to
publish fan oscillaiton state changes to.
- **oscillation_command_topic** (*Optional*, string): The topic to
receive oscillation commands on.
- **speed_state_topic** (*Optional*, string): The topic to publish fan
speed state changes to.
- **speed_command_topic** (*Optional*, string): The topic to receive
speedcommands on.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. |image0| image:: /esphomeyaml/components/fan/fan.png
:class: align-center
:width: 70.0%
.. _fan-toggle_action:
``fan.toggle`` Action
^^^^^^^^^^^^^^^^^^^^^
Toggles the ON/OFF state of the fan with the given ID when executed.
.. code:: yaml
on_...:
then:
- fan.toggle:
id: fan_1
.. _fan-turn_off_action:
``fan.turn_off`` Action
^^^^^^^^^^^^^^^^^^^^^^^
Turns the fan with the given ID off when executed.
.. code:: yaml
on_...:
then:
- fan.turn_off:
id: fan_1
.. _fan-turn_on_action:
``fan.turn_on`` Action
^^^^^^^^^^^^^^^^^^^^^^
Turns the fan with the given ID off when executed.
.. code:: yaml
on_...:
then:
- fan.turn_on:
id: cover_1
Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the light.
- **oscillating** (*Optional*, boolean, :ref:`templatable <config-templatable>`):
Set the oscillation state of the fan. Defaults to not affecting oscillation.
- **speed** (*Optional*, string, :ref:`templatable <config-templatable>`):
Set the speed setting of the fan. One of ``OFF``, ``LOW``, ``MEDIUM``, ``HIGH``.
If you template this value, return ``fan::FAN_SPEED_...``, for example ``fan::FAN_SPEED_HIGH``.
Full Fan Index
^^^^^^^^^^^^^^
- :doc:`API Reference </api/fan/index>`
.. toctree::
:maxdepth: 1
binary.rst
speed.rst

View File

@ -1,11 +1,12 @@
Speed Fan
=========
The ``speed`` fan platform lets you represent any float `ouput
component </esphomeyaml/components/output/index.html>`__ as a fan that
The ``speed`` fan platform lets you represent any float :ref:`output` as a fan that
supports speed settings.
|image0|
.. figure:: images/fan-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -18,30 +19,30 @@ supports speed settings.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **output** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
`float output component </esphomeyaml/components/output/index.html>`_ to use for this fan.
- **name** (**Required**, string): The name for this fan.
- **oscillation_output** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): The output to use
for the oscillation state of this fan. Default is empty.
- **speed** (*Optional*): Set the float values for each speed setting:
- **output** (**Required**, :ref:`config-id`): The id of the
:ref:`float output <output>` to use for this fan.
- **name** (**Required**, string): The name for this fan.
- **oscillation_output** (*Optional*, :ref:`config-id`): The id of the
:ref:`output <output>` to use for the oscillation state of this fan. Default is empty.
- **speed** (*Optional*): Set the float values for each speed setting:
- **low** (*Required*, float): Set the value for the low speed
setting. Must be in range 0 to 1. Defaults to 0.33.
- **medium** (*Required*, float): Set the value for the medium speed
setting. Must be in range 0 to 1. Defaults to 0.66.
- **high** (*Required*, float): Set the value for the high speed
setting. Must be in range 0 to 1. Defaults to 1.
- **low** (*Required*, float): Set the value for the low speed
setting. Must be in range 0 to 1. Defaults to 0.33.
- **medium** (*Required*, float): Set the value for the medium speed
setting. Must be in range 0 to 1. Defaults to 0.66.
- **high** (*Required*, float): Set the value for the high speed
setting. Must be in range 0 to 1. Defaults to 1.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__
and `Fan
Component </esphomeyaml/components/fan/index.html#base-fan-configuration>`__.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`
and :ref:`Fan Component <config-fan>`.
.. |image0| image:: /esphomeyaml/components/fan/fan.png
:class: align-center
:width: 80.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/fan/index`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`API Reference </api/fan/index>`

View File

@ -1,74 +1,10 @@
.. _i2c:
I²C Bus
=======
This component sets up the i²c bus for your ESP32 or ESP8266. Its used
for several other components:
======================= ======================= =======================
|PCA9685 PWM|_ |ADS1115|_ |BMP085|_
----------------------- ----------------------- -----------------------
`PCA9685 PWM`_ `ADS1115`_ `BMP085`_
----------------------- ----------------------- -----------------------
|HDC1080|_ |HTU21D|_ |MPU6050|_
----------------------- ----------------------- -----------------------
`HDC1080`_ `HTU21D`_ `MPU6050`_
----------------------- ----------------------- -----------------------
|BH1750|_ |BME280|_ |BME680|_
----------------------- ----------------------- -----------------------
`BH1750`_ `BME280`_ `BME680`_
----------------------- ----------------------- -----------------------
|TSL2561|_ |SHT3X-D|_
----------------------- ----------------------- -----------------------
`TSL2561`_ `SHT3X-D`_
======================= ======================= =======================
.. |PCA9685 PWM| image:: /esphomeyaml/images/pca9685.jpg
:class: component-image
.. _PCA9685 PWM: /esphomeyaml/components/output/pca9685.html
.. |ADS1115| image:: /esphomeyaml/images/ads1115.jpg
:class: component-image
.. _ADS1115: /esphomeyaml/components/sensor/ads1115.html
.. |BMP085| image:: /esphomeyaml/images/bmp180.jpg
:class: component-image
.. _BMP085: /esphomeyaml/components/sensor/bmp085.html
.. |HDC1080| image:: /esphomeyaml/images/HDC1080.jpg
:class: component-image
.. _HDC1080: /esphomeyaml/components/sensor/hdc1080.html
.. |HTU21D| image:: /esphomeyaml/images/htu21d.jpg
:class: component-image
.. _HTU21D: /esphomeyaml/components/sensor/htu21d.html
.. |MPU6050| image:: /esphomeyaml/images/mpu6050.jpg
:class: component-image
.. _MPU6050: /esphomeyaml/components/sensor/mpu6050.html
.. |BH1750| image:: /esphomeyaml/images/bh1750.jpg
:class: component-image
.. _BH1750: /esphomeyaml/components/sensor/bh1750.html
.. |BME280| image:: /esphomeyaml/images/bme280.jpg
:class: component-image
.. _BME280: /esphomeyaml/components/sensor/bme280.html
.. |BME680| image:: /esphomeyaml/images/bme680.jpg
:class: component-image
.. _BME680: /esphomeyaml/components/sensor/bme680.html
.. |TSL2561| image:: /esphomeyaml/images/tsl2561.jpg
:class: component-image
.. _TSL2561: /esphomeyaml/components/sensor/tsl2561.html
.. |SHT3X-D| image:: /esphomeyaml/images/sht3xd.jpg
:class: component-image
.. _SHT3X-D: /esphomeyaml/components/sensor/sht3xd.html
In order for those components to work correctly, you need to define the
i²c bus in your configuration.
This component sets up the i²c bus for your ESP32 or ESP8266. In order for those components
to work correctly, you need to define the i²c bus in your configuration.
.. code:: yaml
@ -81,23 +17,24 @@ i²c bus in your configuration.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **sda** (*Optional*, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin for the data line of the i²c bus.
Defaults to the default of your board (usually GPIO21 for ESP32 and
GPIO4 for ESP8266).
- **sdc** (*Optional*, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin for the clock line of the i²c bus.
Defaults to the default of your board (usually GPIO22 for ESP32 and
GPIO5 for ESP8266).
- **scan** (*Optional*, boolean): If esphomelib should do a search of the i2c address space on startup.
Note that this can slow down startup and is only recommended for when setting up new sensors. Defaults to
``False``.
- **frequency** (*Optional*, float): Set the frequency
the i²c bus should operate on. Defaults to “100kHz”.
- **receive_timeout** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Advanced: Set a timeout
for operations on the i2c bus. Defaults to 100ms.
- **sda** (*Optional*, :ref:`config-pin`): The pin for the data line of the i²c bus.
Defaults to the default of your board (usually GPIO21 for ESP32 and GPIO4 for ESP8266).
- **sdc** (*Optional*, :ref:`config-pin`): The pin for the clock line of the i²c bus.
Defaults to the default of your board (usually GPIO22 for ESP32 and
GPIO5 for ESP8266).
- **scan** (*Optional*, boolean): If esphomelib should do a search of the i2c address space on startup.
Note that this can slow down startup and is only recommended for when setting up new sensors. Defaults to
``False``.
- **frequency** (*Optional*, float): Set the frequency the i²c bus should operate on. Defaults to “100kHz”.
- **receive_timeout** (*Optional*, :ref:`config-time`): Advanced: Set a timeout
for operations on the i2c bus. Defaults to 100ms.
.. note::
If you're using the ESP32 and i2c frequently is showing errors in the logs, try with the latest
version of the Arduino framework. See
`using the latest arduino framework version </esphomeyaml/components/esphomeyaml.html#using-the-latest-arduino-framework-version>`__
for information on how to do this.
version of the Arduino framework. See :ref:`using_latest_arduino_framework` for information on how to do this.
See Also
--------
- :doc:`API Reference </api/core/i2c>`

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,29 @@
Components
==========
.. toctree::
binary_sensor/index
cover/index
fan/index
light/index
output/index
sensor/index
switch/index
ads1115
dallas
debug
deep_sleep
esp32_ble
esp32_touch
esphomeyaml
i2c
ir_transmitter
logger
mqtt
ota
pca9685
pcf8574
power_supply
web_server
wifi

View File

@ -3,8 +3,8 @@ IR Transmitter Component
The IR transmitter component lets you send infrared messages to control devices in your home.
First, you need to setup a global hub that specifies which pin your IR
led is connected to. Afterwards you can create `individual
switches </esphomeyaml/components/switch/ir_transmitter.html>`__ that
led is connected to. Afterwards you can create :doc:`individual
switches </esphomeyaml/components/switch/ir_transmitter>` that
each send a pre-defined IR code to a device.
.. note::
@ -29,15 +29,17 @@ each send a pre-defined IR code to a device.
command: 0x100BCBD
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
------------------------
- **pin** (**Required**,
`pin </esphomeyaml/configuration-types.html#pin>`__): The pin of the
IR LED.
- **pin** (**Required**, :ref:`config-pin`): The pin of the IR LED.
- **carrier_duty_percent** (*Optional*, int): The duty percentage of
the carrier. 50 for example means that the LED will be on 50% of the
time. Must be in range from 1 to 100. Defaults to 50.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
- **id** (*Optional*, :ref:`config-id`): Manually specify
the ID used for code generation. Use this if you have multiple IR
transmitters.
See Also
--------
- :doc:`API Reference </api/switch/ir-transmitter>`

View File

@ -1,11 +1,12 @@
Binary Light
============
The ``binary`` light platform creates a simple light from an `output
component </esphomeyaml/components/output/index.html>`__ and can only be
turned ON or OFF.
The ``binary`` light platform creates a simple ON/OFF-only light from a
:ref:`binary output component <output>`.
|image0|
.. figure:: images/binary-ui.png
:align: center
:width: 40.0%
.. code:: yaml
@ -18,18 +19,17 @@ turned ON or OFF.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the light.
- **output** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
binary `output
component </esphomeyaml/components/output/index.html>`__ to use for
this light.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the light.
- **output** (**Required**, :ref:`config-id`): The id of the
binary :ref:`output` to use for this light.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. |image0| image:: /esphomeyaml/components/light/binary-light.png
:class: align-center
:width: 80.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/light/index`
- :doc:`/esphomeyaml/components/output/gpio`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/light/index>`

View File

@ -2,13 +2,14 @@ FastLED Clockless Light
=======================
The ``fastled_clockless`` light platform allows you to create RGB lights
in esphomelib for a `number of supported chipsets <#supported-chipsets>`__.
in esphomelib for a :ref:`number of supported chipsets <fastled_clockless-chipsets>`.
Clockless FastLED lights differ from the
`FastLED SPI lights </esphomeyaml/components/light/fastled_spi.html>`__ in that they only have
a single data wire to connect, and not separate data and clock wires.
:doc:`fastled_spi` in that they only have a single data wire to connect, and not separate data and clock wires.
|image0|
.. figure:: images/fastled_clockless-ui.png
:align: center
:width: 60.0%
.. code:: yaml
@ -24,59 +25,58 @@ a single data wire to connect, and not separate data and clock wires.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the light.
- **chipset** (**Required**, string): Set a chipset to use.
See `Supported Chipset <#supported-chipsets>`__ for options.
- **pin** (**Required**, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin for
the data line of the FastLED light.
- **num_leds** (**Required**, int): The number of LEDs attached.
- **rgb_order** (*Optional*, string): The order of the RGB channels. Use this if your
light doesn't seem to map the RGB light channels correctly. For example if your light
shows up green when you set a red color through the frontend. Valid values are ``RGB``,
``RBG``, ``GRB``, ``GBR``, ``BRG`` and ``BGR``. Defaults to ``RGB``.
- **max_refresh_rate** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__):
A time interval used to limit the number of commands a light can handle per second. For example
16ms will limit the light to a refresh rate of about 60Hz. Defaults to the default value for the used chipset.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the
light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the light.
- **chipset** (**Required**, string): Set a chipset to use.
See :ref:`fastled_clockless-chipsets` for options.
- **pin** (**Required**, :ref:`config-pin`): The pin for the data line of the FastLED light.
- **num_leds** (**Required**, int): The number of LEDs attached.
- **rgb_order** (*Optional*, string): The order of the RGB channels. Use this if your
light doesn't seem to map the RGB light channels correctly. For example if your light
shows up green when you set a red color through the frontend. Valid values are ``RGB``,
``RBG``, ``GRB``, ``GBR``, ``BRG`` and ``BGR``. Defaults to ``RGB``.
- **max_refresh_rate** (*Optional*, :ref:`config-time`):
A time interval used to limit the number of commands a light can handle per second. For example
16ms will limit the light to a refresh rate of about 60Hz. Defaults to the default value for the used chipset.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the
light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*, :ref:`config-time`): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **power_supply** (*Optional*, :ref:`config-id`): The :doc:`/esphomeyaml/components/power_supply` to connect to
this light. When the light is turned on, the power supply will automatically be switched on too.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. _fastled_clockless-chipsets:
Supported Chipsets
~~~~~~~~~~~~~~~~~~
- ``NEOPIXEL``
- ``WS2811``
- ``WS2811_400`` (``WS2811`` with a clock rate of 400kHz)
- ``WS2812B``
- ``WS2812``
- ``WS2813``
- ``WS2852``
- ``APA104``
- ``APA106``
- ``GW6205``
- ``GW6205_400`` (``GW6205`` with a clock rate of 400kHz)
- ``LPD1886``
- ``LPD1886_8BIT`` (``LPD1886`` with 8-bit color channel values)
- ``PL9823``
- ``SK6812``
- ``SK6822``
- ``TM1803``
- ``TM1804``
- ``TM1809``
- ``TM1829``
- ``UCS1903B``
- ``UCS1903``
- ``UCS1904``
- ``UCS2903``
- ``NEOPIXEL``
- ``WS2811``
- ``WS2811_400`` (``WS2811`` with a clock rate of 400kHz)
- ``WS2812B``
- ``WS2812``
- ``WS2813``
- ``WS2852``
- ``APA104``
- ``APA106``
- ``GW6205``
- ``GW6205_400`` (``GW6205`` with a clock rate of 400kHz)
- ``LPD1886``
- ``LPD1886_8BIT`` (``LPD1886`` with 8-bit color channel values)
- ``PL9823``
- ``SK6812``
- ``SK6822``
- ``TM1803``
- ``TM1804``
- ``TM1809``
- ``TM1829``
- ``UCS1903B``
- ``UCS1903``
- ``UCS1904``
- ``UCS2903``
Light Effects
~~~~~~~~~~~~~
@ -86,12 +86,14 @@ and supported out-of-the box. Creating custom effects is, however, quite easy wi
See the `fastled example <https://github.com/OttoWinter/esphomelib/blob/master/examples/fastled.cpp>`__
in the esphomelib repository for a simple example.
|image1|
.. |image0| image:: /esphomeyaml/components/light/fastled_clockless.png
:class: align-center
:width: 60.0%
.. |image1| image:: /esphomeyaml/components/light/fastled_effect.png
:class: align-center
.. figure:: images/fastled_effect.png
:align: center
:width: 30.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/light/index`
- :doc:`/esphomeyaml/components/light/fastled_spi`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/light/fastled>`

View File

@ -2,14 +2,15 @@ FastLED SPI Light
=================
The ``fastled_spi`` light platform allows you to create RGB lights
in esphomelib for a `number of supported chipsets <#supported-chipsets>`__.
in esphomelib for a :ref:`number of supported chipsets <fastled_spi-chipsets>`.
SPI FastLED lights differ from the
`FastLED Clockless lights </esphomeyaml/components/light/fastled_clockless.html>`__ in that they require
two pins to be connected, one for a data and one for a clock signal whereas the clockless lights
only need a single pin.
:doc:`fastled_clockless` in that they require two pins to be connected, one for a data and one for a clock signal
whereas the clockless lights only need a single pin.
|image0|
.. figure:: images/fastled_spi-ui.png
:align: center
:width: 60.0%
.. code:: yaml
@ -26,45 +27,40 @@ only need a single pin.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the light.
- **chipset** (**Required**, string): Set a chipset to use.
See `Supported Chipset <#supported-chipsets>`__ for options.
- **data_pin** (**Required**, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin for
the data line of the FastLED light.
- **clock_pin** (**Required**, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin for
the clock line of the FastLED light.
- **num_leds** (**Required**, int): The number of LEDs attached.
- **rgb_order** (*Optional*, string): The order of the RGB channels. Use this if your
light doesn't seem to map the RGB light channels correctly. For example if your light
shows up green when you set a red color through the frontend. Valid values are ``RGB``,
``RBG``, ``GRB``, ``GBR``, ``BRG`` and ``BGR``. Defaults to ``RGB``.
- **max_refresh_rate** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__):
A time interval used to limit the number of commands a light can handle per second. For example
16ms will limit the light to a refresh rate of about 60Hz. Defaults to the default value for the used chipset.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the
light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the light.
- **chipset** (**Required**, string): Set a chipset to use. See :ref:`fastled_spi-chipsets` for options.
- **data_pin** (**Required**, :ref:`config-pin`): The pin for the data line of the FastLED light.
- **clock_pin** (**Required**, :ref:`config-pin`): The pin for the clock line of the FastLED light.
- **num_leds** (**Required**, int): The number of LEDs attached.
- **rgb_order** (*Optional*, string): The order of the RGB channels. Use this if your
light doesn't seem to map the RGB light channels correctly. For example if your light
shows up green when you set a red color through the frontend. Valid values are ``RGB``,
``RBG``, ``GRB``, ``GBR``, ``BRG`` and ``BGR``. Defaults to ``RGB``.
- **max_refresh_rate** (*Optional*, :ref:`config-time`):
A time interval used to limit the number of commands a light can handle per second. For example
16ms will limit the light to a refresh rate of about 60Hz. Defaults to the default value for the used chipset.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*, :ref:`config-time`): The length of
the transition if no transition parameter is provided by Home Assistant. Defaults to ``1s``.
- **power_supply** (*Optional*, :ref:`config-id`): The :doc:`/esphomeyaml/components/power_supply` to connect to
this light. When the light is turned on, the power supply will automatically be switched on too.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. _fastled_spi-chipsets:
Supported Chipsets
~~~~~~~~~~~~~~~~~~
- ``APA102``
- ``DOTSTAR``
- ``LPD8806``
- ``P9813``
- ``SK9822``
- ``SM16716``
- ``WS2801``
- ``WS2803``
- ``APA102``
- ``DOTSTAR``
- ``LPD8806``
- ``P9813``
- ``SK9822``
- ``SM16716``
- ``WS2801``
- ``WS2803``
Light Effects
~~~~~~~~~~~~~
@ -74,12 +70,14 @@ and supported out-of-the box. Creating custom effects is, however, quite easy wi
See the `fastled example <https://github.com/OttoWinter/esphomelib/blob/master/examples/fastled.cpp>`__
in the esphomelib repository for a simple example.
|image1|
.. |image0| image:: /esphomeyaml/components/light/fastled_spi.png
:class: align-center
:width: 60.0%
.. |image1| image:: /esphomeyaml/components/light/fastled_effect.png
:class: align-center
.. figure:: images/fastled_effect.png
:align: center
:width: 30.0%
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/light/index`
- :doc:`/esphomeyaml/components/light/fastled_clockless`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/light/fastled>`

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -5,37 +5,104 @@ The ``light`` domain in esphomeyaml lets you create lights that will
automatically be shown in Home Assistants frontend and have many
features such as RGB colors, transitions, flashing and effects.
|image0|
.. _light-toggle_action:
Currently supported light platforms:
``light.toggle`` Action
^^^^^^^^^^^^^^^^^^^^^^^
======================== ======================== ========================
|Binary Light|_ |Monochromatic Light|_ |RGB Light|_
------------------------ ------------------------ ------------------------
`Binary Light`_ `Monochromatic Light`_ `RGB Light`_
------------------------ ------------------------ ------------------------
|RGBW Light|_
------------------------ ------------------------ ------------------------
`RGBW Light`_
======================== ======================== ========================
This action toggles a light with the given ID when executed.
.. code:: yaml
.. |Binary Light| image:: /esphomeyaml/images/lightbulb.svg
:class: component-image
.. _Binary Light: /esphomeyaml/components/light/binary.html
on_...:
then:
- light.toggle:
id: light_1
.. |Monochromatic Light| image:: /esphomeyaml/images/brightness-medium.svg
:class: component-image
.. _Monochromatic Light: /esphomeyaml/components/light/monochromatic.html
Configuration options:
.. |RGB Light| image:: /esphomeyaml/images/rgb.png
:class: component-image
.. _RGB Light: /esphomeyaml/components/light/rgb.html
- **id** (**Required**, :ref:`config-id`): The ID of the light.
- **transition_length** (*Optional*, :ref:`config-time`, :ref:`templatable <config-templatable>`): The length of the transition
if the light supports it.
.. |RGBW Light| image:: /esphomeyaml/images/rgbw.png
:class: component-image
.. _RGBW Light: /esphomeyaml/components/light/rgbw.html
.. _light-turn_on_action:
.. |image0| image:: /esphomeyaml/components/light/light-rgb.png
:class: align-center
:width: 30.0%
``light.turn_on`` Action
^^^^^^^^^^^^^^^^^^^^^^^^
This action turns a light with the given ID on when executed.
.. code:: yaml
on_...:
then:
- light.turn_on:
id: light_1
brightness: 100%
red: 100%
green: 100%
blue: 1.0
# Templated
- light.turn_on:
id: light_1
brightness: !lambda >-
// output value must be in range 0 - 1.0
return id(some_sensor).value / 100.0;
Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the light.
- **transition_length** (*Optional*, :ref:`config-time`, :ref:`templatable <config-templatable>`): The length of the transition
if the light supports it.
- **brightness** (*Optional*, percentage, :ref:`templatable <config-templatable>`): The brightness of the light. Must be in range
``0%`` to ``100%`` or ``0.0`` to ``1.0``. Defaults to not changing brightness.
- **red** (*Optional*, percentage, :ref:`templatable <config-templatable>`): The red channel of the light. Must be in range
``0%`` to ``100%`` or ``0.0`` to ``1.0``. Defaults to not changing red.
- **green** (*Optional*, percentage, :ref:`templatable <config-templatable>`): The green channel of the light. Must be in range
``0%`` to ``100%`` or ``0.0`` to ``1.0``. Defaults to not changing green channel.
- **blue** (*Optional*, percentage, :ref:`templatable <config-templatable>`): The blue channel of the light. Must be in range
``0%`` to ``100%`` or ``0.0`` to ``1.0``. Defaults to not changing blue channel.
- **white** (*Optional*, percentage, :ref:`templatable <config-templatable>`): The white channel value of RGBW lights. Must be in range
``0%`` to ``100%`` or ``0.0`` to ``1.0``. Defaults to not changing white value.
- **flash_length** (*Optional*, :ref:`config-time`, :ref:`templatable <config-templatable>`): If set, will flash the given color
for this period of time and then go back to the previous state.
- **effect** (*Optional*, string, :ref:`templatable <config-templatable>`): If set, will attempt to
start an effect with the given name.
.. _light-turn_off_action:
``light.turn_off`` Action
^^^^^^^^^^^^^^^^^^^^^^^^^
This action turns a light with the given ID off when executed.
.. code:: yaml
on_...:
then:
- light.turn_off:
id: light_1
Configuration options:
- **id** (**Required**, :ref:`config-id`): The ID of the light.
- **transition_length** (*Optional*, :ref:`config-time`, :ref:`templatable <config-templatable>`): The length of the transition
if the light supports it.
This action turns a switch with the given ID off when executed.
See Also
^^^^^^^^
- :doc:`API Reference </api/light/index>`
.. toctree::
:maxdepth: 1
binary.rst
monochromatic.rst
rgb.rst
rgbw.rst
fastled_clockless.rst
fastled_spi.rst

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@ -1,11 +1,18 @@
Monochromatic Light
===================
The ``monochromatic`` light platform creates a simple light
brightness-only from an `output
component </esphomeyaml/components/output/index.html>`__.
The ``monochromatic`` light platform creates a simple brightness-only light from an
:ref:`float output component <output>`.
|image0|
.. figure:: images/monochromatic-strip.jpg
:align: center
:width: 75.0%
Example of a brightness-only LED strip that can be used with this component.
.. figure:: images/kitchen-lights.png
:align: center
:width: 40.0%
.. code:: yaml
@ -18,24 +25,36 @@ component </esphomeyaml/components/output/index.html>`__.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the light.
- **output** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for this light.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the
light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the light.
- **output** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for this light.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*, :ref:`config-time`): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. |image0| image:: /esphomeyaml/components/light/kitchen-lights.png
:class: align-center
:width: 80.0%
.. note::
The ``monochromatic`` light platform only works with ``float``
:ref:`outputs <output>` that can output any light intensity percentage like the
:doc:`ESP32 LEDC </esphomeyaml/components/output/ledc>` or
:doc:`ESP8266 PWM </esphomeyaml/components/output/esp8266_pwm>` components and does **not** work with output
platforms like the :doc:`/esphomeyaml/components/output/gpio`.
See Also
^^^^^^^^
.. figure:: images/monochromatic_detail.jpg
:align: center
:width: 75.0%
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/light/index`
- :doc:`/esphomeyaml/components/light/binary`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`API Reference </api/light/index>`

View File

@ -1,11 +1,18 @@
RGB Light
=========
The ``rgb`` light platform creates an RGB light from 3 `output
components </esphomeyaml/components/output/index.html>`__ (one for each
color channel).
The ``rgb`` light platform creates an RGB light from 3 :ref:`float output components <output>`
(one for each color channel).
|image0|
.. figure:: images/rgb-strip.jpg
:align: center
:width: 75.0%
Example of an RGB LED strip that can be used with this component.
.. figure:: images/rgb-ui.png
:align: center
:width: 40.0%
.. code:: yaml
@ -20,32 +27,36 @@ color channel).
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the light.
- **red** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the red channel.
- **green** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the green channel.
- **blue** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the blue channel.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the
light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the light.
- **red** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the red channel.
- **green** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the green channel.
- **blue** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the blue channel.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*, :ref:`config-time`): The length of
the transition if no transition parameter is provided by Home Assistant. Defaults to ``1s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. |image0| image:: /esphomeyaml/components/light/rgb-light.png
:class: align-center
:width: 40.0%
.. note::
The RGB light platform only works with ``float`` :ref:`outputs <output>` that
can output any light intensity percentage like the :doc:`ESP32 LEDC </esphomeyaml/components/output/ledc>` or
:doc:`ESP8266 PWM </esphomeyaml/components/output/esp8266_pwm>` components and does **not** work with output
platforms like the :doc:`/esphomeyaml/components/output/gpio`.
See Also
^^^^^^^^
.. figure:: images/rgb-detail.jpg
:align: center
:width: 75.0%
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/light/index`
- :doc:`/esphomeyaml/components/light/rgbw`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`API Reference </api/light/index>`

View File

@ -1,15 +1,13 @@
RGBW Light
==========
The ``rgbw`` light platform creates an RGBW light from 4 `output
components </esphomeyaml/components/output/index.html>`__ (one for each
channel).
The ``rgbw`` light platform creates an RGBW light from 4 :ref:`float output components <output>` (one for each channel).
.. code:: yaml
# Example configuration entry
light:
- platform: rgb
- platform: rgbw
name: "Livingroom Lights"
red: output_component1
green: output_component2
@ -19,32 +17,33 @@ channel).
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **name** (**Required**, string): The name of the light.
- **red** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the red channel.
- **green** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the green channel.
- **blue** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the blue channel.
- **white** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
float `output component </esphomeyaml/components/output/index.html>`__
to use for the white channel.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the
light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The length of
the transition if no transition parameter is provided by Home
Assistant. Defaults to ``1s``.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name of the light.
- **red** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the red channel.
- **green** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the green channel.
- **blue** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the blue channel.
- **white** (**Required**, :ref:`config-id`): The id of the float :ref:`output` to use for the white channel.
- **gamma_correct** (*Optional*, float): The `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ for the light. Defaults to ``2.8``.
- **default_transition_length** (*Optional*, :ref:`config-time`): The length of
the transition if no transition parameter is provided by Home Assistant. Defaults to ``1s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. note::
The RGBW light platform only works with ``float`` :ref:`outputs <output>` that
can output any light intensity percentage like the :doc:`ESP32 LEDC </esphomeyaml/components/output/ledc>` or
:doc:`ESP8266 PWM </esphomeyaml/components/output/esp8266_pwm>` components and does **not** work with output
platforms like the :doc:`/esphomeyaml/components/output/gpio`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/light/index`
- :doc:`/esphomeyaml/components/light/rgb`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/pca9685`
- :doc:`API Reference </api/light/index>`

View File

@ -26,11 +26,11 @@ Configuration variables:
- **level** (*Optional*, string): The global log level. Any log message
with a lower severity will not be shown. Defaults to DEBUG.
- **logs** (*Optional*, mapping): Manually set the log level for a
specific component or tag. See `Manual Log Levels for more
information <#manual-tag-specific-log-levels>`__.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
specific component or tag. See :ref:`Manual Log Levels for more
information <logger-manual_tag_specific_levels>`.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
.. _logger-log_levels:
Log Levels
~~~~~~~~~~
@ -45,6 +45,8 @@ Possible log levels are (sorted by severity):
- ``VERBOSE``
- ``VERY_VERBOSE``
.. _logger-manual_tag_specific_levels:
Manual Tag-Specific Log Levels
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -57,7 +59,7 @@ client spams too much. In the following example, wed first see that the
tag of the MQTT client is ``mqtt.client`` (before the first colon) and
the tag for MQTT components is ``mqtt.component``.
|image0|
.. figure:: images/logger-manual_log_level.png
Next, we can manually set the log levels in the configuration like this:
@ -75,5 +77,7 @@ purge all ``DEBUG`` log statements from the binary in order to conserve
space. This however means that you cannot set tag-specific log levels
that have a lower severity than the global log level.
.. |image0| image:: /esphomeyaml/components/logger-manual-log-level.png
See Also
--------
- :doc:`API Reference </api/core/log>`

View File

@ -18,42 +18,42 @@ Assistant configuration.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **broker** (**Required**, string): The host of your MQTT broker.
- **port** (*Optional*, int): The port to connect to. Defaults to 1883.
- **username** (*Optional*, string): The username to use for
authentication. Empty (the default) means no authentication.
- **password** (*Optional*, string): The password to use for
authentication. Empty (the default) means no authentication.
- **client_id** (*Optional*, string): The client id to use for opening
connections. See `Defaults <#defaults>`__ for more information.
- **discovery** (*Optional*, boolean): If Home Assistant automatic
discovery should be enabled. Defaults to ``True``.
- **discovery_retain** (*Optional*, boolean): Whether to retain MQTT
discovery messages so that entities are added automatically on Home
Assistant restart. Defaults to ``True``.
- **discovery_prefix** (*Optional*, string): The prefix to use for Home
Assistants MQTT discovery. Should not contain trailing slash.
Defaults to ``homeassistant``.
- **topic_prefix** (*Optional*, string): The prefix used for all MQTT
messages. Should not contain trailing slash. Defaults to
``<APP_NAME>``.
- **log_topic** (*Optional*, `MQTTMessage <#mqttmessage>`__) The topic to send MQTT log
messages to.
- **birth_message** (*Optional*, `MQTTMessage <#mqttmessage>`__): The message to send when
a connection to the broker is established. See `Last Will And Birth
Messages <#last-will-and-birth-messages>`__ for more information.
- **will_message** (*Optional*, `MQTTMessage <#mqttmessage>`__): The message to send when
the MQTT connection is dropped. See `Last Will And Birth
Messages <#last-will-and-birth-messages>`__ for more information.
- **ssl_fingerprints** (*Optional*, list): Only on ESP8266. A list of SHA1 hashes used
for verifying SSL connections. See `SSL Fingerprints <#ssl-fingerprints>`__
for more information.
- **keepalive** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): The time
to keep the MQTT socket alive, decreasing this can help with overall stability due to more
WiFi traffic with more pings. Defaults to 15 seconds.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- **broker** (**Required**, string): The host of your MQTT broker.
- **port** (*Optional*, int): The port to connect to. Defaults to 1883.
- **username** (*Optional*, string): The username to use for
authentication. Empty (the default) means no authentication.
- **password** (*Optional*, string): The password to use for
authentication. Empty (the default) means no authentication.
- **client_id** (*Optional*, string): The client id to use for opening
connections. See :ref:`mqtt-defaults` for more information.
- **discovery** (*Optional*, boolean): If Home Assistant automatic
discovery should be enabled. Defaults to ``True``.
- **discovery_retain** (*Optional*, boolean): Whether to retain MQTT
discovery messages so that entities are added automatically on Home
Assistant restart. Defaults to ``True``.
- **discovery_prefix** (*Optional*, string): The prefix to use for Home
Assistants MQTT discovery. Should not contain trailing slash.
Defaults to ``homeassistant``.
- **topic_prefix** (*Optional*, string): The prefix used for all MQTT
messages. Should not contain trailing slash. Defaults to
``<APP_NAME>``.
- **log_topic** (*Optional*, :ref:`mqtt-message`) The topic to send MQTT log
messages to.
- **birth_message** (*Optional*, :ref:`mqtt-message`): The message to send when
a connection to the broker is established. See :ref:`mqtt-last_will_birth` for more information.
- **will_message** (*Optional*, :ref:`mqtt-message`): The message to send when
the MQTT connection is dropped. See :ref:`mqtt-last_will_birth` for more information.
- **ssl_fingerprints** (*Optional*, list): Only on ESP8266. A list of SHA1 hashes used
for verifying SSL connections. See :ref:`mqtt-ssl_fingerprints`
for more information.
- **keepalive** (*Optional*, :ref:`config-time`): The time
to keep the MQTT socket alive, decreasing this can help with overall stability due to more
WiFi traffic with more pings. Defaults to 15 seconds.
- **on_message** (*Optional*, :ref:`Automation <automation>`): An action to be
performed when a message on a specific MQTT topic is received. See :ref:`mqtt-on_message`.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
.. _mqtt-message:
MQTTMessage
~~~~~~~~~~~
@ -126,6 +126,8 @@ This will remove all retained messages with the topic
``<DISCOVERY_PREFIX>/+/NODE_NAME/#``. If you want to purge on another
topic, simply add ``--topic <your_topic>`` to the command.
.. _mqtt-defaults:
Defaults
~~~~~~~~
@ -141,6 +143,8 @@ configuration. That way, you can use your existing wildcards like
``home/+/#`` together with esphomelib. All other features of esphomelib
(like availabilty) should still work correctly.
.. _mqtt-last_will_birth:
Last Will And Birth Messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -150,7 +154,9 @@ and birth message feature of MQTT to achieve availabilty reporting for
Home Assistant. If the node is not connected to MQTT, Home Assistant
will show all its entities as unavailable (a feature 😉).
|image0|
.. figure:: /esphomeyaml/components/images/mqtt-availability.png
:align: center
:width: 50.0%
By default, esphomelib will send a retained MQTT message to
``<TOPIC_PREFIX>/status`` with payload ``online``, and will tell the
@ -171,13 +177,15 @@ You can change these messages by overriding the ``birth_message`` and
topic: myavailability/topic
payload: offline
- **birth_message** (*Optional*, `MQTTMessage <#mqttmessage>`__)
- **will_message** (*Optional*, `MQTTMessage <#mqttmessage>`__)
- **birth_message** (*Optional*, :ref:`mqtt-message`)
- **will_message** (*Optional*, :ref:`mqtt-message`)
If the birth message and last will message have empty topics or topics
that are different from each other, availabilty reporting will be
disabled.
.. _mqtt-ssl_fingerprints:
SSL Fingerprints
~~~~~~~~~~~~~~~~
@ -204,6 +212,8 @@ then run the ``mqtt-fingerprint`` script of esphomeyaml to get the certificate:
ssl_fingerprints:
- a502ff13999f8b398ef1834f1123650b3236fc07
.. _config-mqtt-component:
MQTT Component Base Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -233,7 +243,7 @@ Configuration variables:
discovery for a component. Defaults to the global default.
- **availabilty** (*Optional*): Manually set what should be sent to
Home Assistant for showing entity availabilty. Default derived from
`global birth/last will message <#last-will-and-birth-messages>`__.
:ref:`global birth/last will message <mqtt-last_will_birth>`.
- **state_topic** (*Optional*, string): The topic to publish state
updates to. Defaults to
``<TOPIC_PREFIX>/<COMPONENT_TYPE>/<COMPONENT_NAME>/state``
@ -243,6 +253,88 @@ Configuration variables:
``<TOPIC_PREFIX>/<COMPONENT_TYPE>/<COMPONENT_NAME>/command``
(non-alphanumeric characters from the name are removed).
.. |image0| image:: /esphomeyaml/components/mqtt-availability.png
:class: align-center
:width: 50.0%
.. _mqtt-on_message:
on_message
^^^^^^^^^^
With this configuration option you can write complex automations whenever an MQTT
message on a specific topic is received.
.. code:: yaml
mqtt:
# ...
on_message:
topic: my/custom/topic
qos: 0
then:
- switch.turn_on:
id: some_switch
Configuration variables:
- **topic** (**Required**, string): The MQTT topic to subscribe to and listen for MQTT
messages on. Every time a message with **this exact topic** is received, the automation will trigger.
.. note::
Currently the topic does not support MQTT wildcards like ``+`` or ``#``.
- **qos** (*Optional*, integer): The MQTT Quality of Service to subscribe to the topic with. Defaults
to 0.
.. note::
You can even specify multiple ``on_message`` triggers by using a YAML list:
.. code:: yaml
mqtt:
on_message:
- topic: some/topic
then:
- # ...
- topic: some/other/topic
then:
- # ...
.. _mqtt-publish_action:
``mqtt.publish`` Action
^^^^^^^^^^^^^^^^^^^^^^^
Publish an MQTT message on a topic using this action in automations.
.. code:: yaml
on_...:
then:
- mqtt.publish:
topic: some/topic
payload: "Something happened!"
# Templated:
- mqtt.publish:
topic: !lambda >-
if (id(reed_switch).value) return "topic1";
else return "topic2";
payload: !lambda >-
return id(reed_switch).value ? "YES" : "NO";
Configuration options:
- **topic** (*Required*, string, :ref:`templatable <config-templatable>`):
The MQTT topic to publish the message.
- **payload** (*Required*, string, :ref:`templatable <config-templatable>`): The message content.
- **qos** (*Optional*, int, :ref:`templatable <config-templatable>`): The `Quality of
Service <https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels>`__
level of the topic. Defaults to 0.
- **retain** (*Optional*, boolean, :ref:`templatable <config-templatable>`): If the published message should
have a retain flag on or not. Defaults to ``False``.
See Also
^^^^^^^^
- :doc:`API Reference </api/core/mqtt>`

View File

@ -33,6 +33,9 @@ Configuration variables:
- **password** (*Optional*, string): The password to use for updates.
- **port** (*Optional*, int): The port to use for OTA updates. Defaults
to ``3232`` for the ESP32 and ``8266`` for the ESP8266.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
See Also
--------
- :doc:`API Reference </api/core/ota>`

View File

@ -3,20 +3,16 @@ ESP8266 Software PWM Output
The ESP8266 Software PWM platform allows you to use a software PWM on
the pins GPIO0-GPIO16 on your ESP8266. As this is only a software PWM
and not a hardware PWM (like the `ESP32 LEDC
PWM </esphomeyaml/components/output/ledc.html>`__) and has a few
and not a hardware PWM (like the :doc:`ESP32 LEDC PWM <ledc>`) and has a few
limitations.
- There can be a noticeable amount of flickering with increased WiFi
activity.
- The output range only goes up to about 80%.
- Its mostly fixed to a frequency of 1kHz, you can `increase this a
bit manually </api/output/esp8266-pwm.html#example-usage>`__ in code
though.
- There can be a noticeable amount of flickering with increased WiFi activity.
- The output range only goes up to about 80%.
- Its mostly fixed to a frequency of 1kHz, you can :ref:`increase this a
bit manually <esp8266_pwm-example_usage>` in code though.
If you need a stable PWM signal, its definitely recommended to use the
successor of the ESP8266, the ESP32, and its `LEDC
peripheral </esphomeyaml/components/output/ledc.html>`__ instead.
successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM <ledc>` instead.
.. code:: yaml
@ -29,11 +25,16 @@ peripheral </esphomeyaml/components/output/ledc.html>`__ instead.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**, `Pin
Schema </esphomeyaml/configuration-types.html#pin-schema>`__): The
pin to use PWM on.
- **id** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id to use for
this output component.
- All other options from
`Output </esphomeyaml/components/output/index.html#base-output-configuration>`__.
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin to use PWM on.
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- All other options from :ref:`Output <config-output>`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/light/monochromatic`
- :doc:`/esphomeyaml/components/fan/speed`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/output/esp8266-pwm>`

View File

@ -3,7 +3,7 @@ GPIO Output
The GPIO output component is quite simple: It exposes a single GPIO pin
as an output component. Note that output components are **not** switches and
will not show up in Home Assistant. See `GPIO Switch </esphomeyaml/components/switch/gpio.html>`__.
will not show up in Home Assistant. See :doc:`GPIO Switch <gpio>`.
.. code:: yaml
@ -11,16 +11,29 @@ will not show up in Home Assistant. See `GPIO Switch </esphomeyaml/components/sw
output:
- platform: gpio
pin: D1
id: gpio-d1
id: gpio_d1
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**, `Pin
Schema </esphomeyaml/configuration-types.html#pin-schema>`__): The
pin to use PWM on.
- **id** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id to use for
this output component.
- All other options from
`Output </esphomeyaml/components/output/index.html#base-output-configuration>`__.
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin to use PWM on.
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- All other options from :ref:`Output <config-output>`.
.. warning::
This is an **output component** and will not visible from the frontend. Output components are intermediary
components that can be attached to for example lights. To have a GPIO pin in the Home Assistant frontend, please
see the :doc:`/esphomeyaml/components/switch/gpio`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/switch/gpio`
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/light/binary`
- :doc:`/esphomeyaml/components/fan/binary`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/output/gpio-binary>`

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 KiB

View File

@ -6,32 +6,7 @@ esphomelib. These are grouped into two categories: ``binary`` outputs
(that can only be ON/OFF) and ``float`` outputs (like PWM, can output
any rational value between 0 and 1).
======================== ======================== ========================
|ESP8266 Software PWM|_ |GPIO Output|_ |ESP32 LEDC|_
------------------------ ------------------------ ------------------------
`ESP8266 Software PWM`_ `GPIO Output`_ `ESP32 LEDC`_
------------------------ ------------------------ ------------------------
|PCA9685|_
------------------------ ------------------------ ------------------------
`PCA9685`_
======================== ======================== ========================
.. |ESP8266 Software PWM| image:: /esphomeyaml/images/pwm.png
:class: component-image
.. _ESP8266 Software PWM: /esphomeyaml/components/output/esp8266_pwm.html
.. |GPIO Output| image:: /esphomeyaml/images/pin.svg
:class: component-image
.. _GPIO Output: /esphomeyaml/components/output/gpio.html
.. |ESP32 LEDC| image:: /esphomeyaml/images/pwm.png
:class: component-image
.. _ESP32 LEDC: /esphomeyaml/components/output/ledc.html
.. |PCA9685| image:: /esphomeyaml/images/pca9685.jpg
:class: component-image
.. _PCA9685: /esphomeyaml/components/output/pca9685.html
.. _config-output:
Base Output Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~
@ -50,13 +25,33 @@ Each output platform extends this configuration schema.
Configuration variables:
- **id** (**Required**, `id </esphomeyaml/configuration-types.html#id>`__): The id to use for this output component.
- **power_supply** (*Optional*, `id </esphomeyaml/configuration-types.html#id>`__): The `power
supply </esphomeyaml/components/power_supply.html>`__ to connect to
this output. When the output is enabled, the power supply will
automatically be switched on too.
- **inverted** (*Optional*, boolean): If the output should be treated
as inverted. Defaults to ``False``.
- **max_power** (*Optional*, float): Only for float outputs. Sets the
maximum output value of this output platform. Each value will be
multiplied by this. Must be in range from 0 to 1. Defaults to 1.
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **power_supply** (*Optional*, :ref:`config-id`): The :doc:`power
supply </esphomeyaml/components/power_supply>` to connect to
this output. When the output is enabled, the power supply will
automatically be switched on too.
- **inverted** (*Optional*, boolean): If the output should be treated
as inverted. Defaults to ``False``.
- **max_power** (*Optional*, float): Only for float outputs. Sets the
maximum output value of this output platform. Each value will be
multiplied by this. Must be in range from 0 to 1. Defaults to 1.
Full Output Index
^^^^^^^^^^^^^^^^^
- :doc:`API Reference </api/output/index>`
- :doc:`/esphomeyaml/components/switch/output`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`/esphomeyaml/components/light/binary`
- :doc:`/esphomeyaml/components/light/monochromatic`
- :doc:`/esphomeyaml/components/light/rgb`
- :doc:`/esphomeyaml/components/fan/binary`
- :doc:`/esphomeyaml/components/fan/speed`
.. toctree::
:maxdepth: 1
esp8266_pwm.rst
gpio.rst
ledc.rst
pca9685.rst

View File

@ -11,24 +11,28 @@ of the ESP32 as an output component.
output:
- platform: ledc
pin: 19
id: gpio-d1
id: gpio_19
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**,
`pin </esphomeyaml/configuration-types.html#pin>`__): The pin to use
LEDC on. Can only be GPIO0-GPIO33.
- **id** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id to use for
this output component.
- **frequency** (*Optional*, float): At which frequency to run the LEDC
channels timer. Two LEDC channels always share the same timer and
therefore also the same frequency. Defaults to 1000Hz.
- **bit_depth** (*Optional*, int): The bit depth to use for the LEDC
channel. Defaults to 12.
- **channel** (*Optional*, int): Manually set the `LEDC
channel <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/ledc.html#configure-channel>`__
to use. Two adjacent channels share the same timer.
- All other options from
`Output </esphomeyaml/components/output/index.html#base-output-configuration>`__.
- **pin** (**Required**, :ref:`config-pin`): The pin to use LEDC on. Can only be GPIO0-GPIO33.
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **frequency** (*Optional*, float): At which frequency to run the LEDC
channels timer. Two LEDC channels always share the same timer and
therefore also the same frequency. Defaults to 1000Hz.
- **bit_depth** (*Optional*, int): The bit depth to use for the LEDC channel. Defaults to 12.
- **channel** (*Optional*, int): Manually set the `LEDC
channel <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/ledc.html#configure-channel>`__
to use. Two adjacent channels share the same timer. Defaults to an automatic selection.
- All other options from :ref:`Output <config-output>`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/light/monochromatic`
- :doc:`/esphomeyaml/components/fan/speed`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/output/ledc>`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

View File

@ -2,38 +2,46 @@ PCA9685 PWM Output
==================
The PCA9685 output component exposes a PCA9685 PWM channel of a global
`PCA9685 hub </esphomeyaml/components/pca9685.html>`__ as a float
:doc:`PCA9685 hub </esphomeyaml/components/pca9685>` as a float
output.
.. figure:: /esphomeyaml/components/output/pca9685-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/pca9685-full.jpg
:align: center
:width: 75.0%
PCA9685 16-Channel PWM Driver. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/815
PCA9685 16-Channel PWM Driver.
.. code:: yaml
# Example configuration entry
pca9685:
- id: 'pca9685_hub1'
frequency: 500
- frequency: 500
# Individual outputs
output:
- platform: pca9685
id: 'pca9685_output1'
pca9685_id: 'pca9685_hub1'
channel: 0
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **id** (**Required**, `id </esphomeyaml/configuration-types.html#id>`__): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the PCA9685 of
this output component. Must be in range from 0 to 15.
- All other options from
`Output </esphomeyaml/components/output/index.html#base-output-configuration>`__.
- **pca9685_id** (*Optional* `id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID of the `PCA9685 hub </esphomeyaml/components/pca9685.html`__. Use this if you have multiple PCA9685s you want to use at the same time.
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the PCA9685 of
this output component. Must be in range from 0 to 15.
- **pca9685_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:doc:`PCA9685 hub </esphomeyaml/components/pca9685>`.
Use this if you have multiple PCA9685s you want to use at the same time.
- All other options from :ref:`Output <config-output>`.
See Also
^^^^^^^^
- :doc:`/esphomeyaml/components/pca9685`
- :doc:`/esphomeyaml/components/output/index`
- :doc:`/esphomeyaml/components/output/esp8266_pwm`
- :doc:`/esphomeyaml/components/output/ledc`
- :doc:`/esphomeyaml/components/light/monochromatic`
- :doc:`/esphomeyaml/components/fan/speed`
- :doc:`/esphomeyaml/components/power_supply`
- :doc:`API Reference </api/output/pca9685>`

View File

@ -4,11 +4,11 @@ PCA9685 PWM Component
The PCA9685 component represents a PCA9685 12-bit PWM driver
(`datasheet <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/ledc.html#configure-channel>`__,
`adafruit <https://www.adafruit.com/product/815>`__) in esphomelib. It
uses `I²C Bus </esphomeyaml/components/i2c.html>`__ for communication.
uses :ref:`I²C Bus <i2c>` for communication.
To use the channels of this components, you first need to setup the
global ``pca9685`` hub and give it an id, and then define the
`individual output channels </esphomeyaml/components/output/pca9685>`__.
:doc:`individual output channels </esphomeyaml/components/output/pca9685>`.
.. code:: yaml
@ -28,10 +28,16 @@ Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **id** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id to use for
:ref:`config-id`): The id to use for
this pca9685 component.
- **frequency** (**Required**, float): The frequency to let the
component drive all PWM outputs at. Must be in range from 24Hz to
1526Hz.
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x00``.
See Also
--------
- :doc:`output/pca9685`
- :doc:`API Reference </api/output/pca9685>`

View File

@ -4,23 +4,23 @@ PCF8574 I/O Expander
The PCF8574 component allows you to use PCF8574 or PCF8575 I/O expanders
(`datasheet <http://www.ti.com/lit/ds/symlink/pcf8574.pdf>`__,
`Sparkfun`_) in esphomeyaml. It
uses `I²C Bus </esphomeyaml/components/i2c.html>`__ for communication.
uses :ref:`I²C Bus <i2c>` for communication.
Once configured, you can use any of the 8 pins (PCF8574) or 16 pins (PCF8575) as
pins for your projects. Within esphomelib they emulate a real internal GPIO pin
and can therefore be used with many of esphomelib's components such as the GPIO
binary sensor or GPIO switch.
Any option accepting a `Pin Schema`_ can theoretically be used, but some more
Any option accepting a :ref:`Pin Schema <config-pin_schema>` can theoretically be used, but some more
complicated components that do communication through this I/O expander will
not work.
.. figure:: /esphomeyaml/components/pcf8574-full.jpg
:align: center
:target: `Sparkfun`_
:width: 50.0%
.. figure:: images/pcf8574-full.jpg
:align: center
:target: `Sparkfun`_
:width: 50.0%
PCF8574 I/O Expander. Image by `Sparkfun`_.
PCF8574 I/O Expander. Image by `Sparkfun`_.
.. _Sparkfun: https://www.sparkfun.com/products/retired/8130
@ -47,12 +47,15 @@ not work.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **id** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id to use for
this PCF8574 component.
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x21``.
- **pcf8575** (*Optional*, boolean): Whether this is a 16-pin PCF8575. Defaults to
``False``.
- **id** (**Required**, :ref:`config-id`): The id to use for this PCF8574 component.
- **address** (*Optional*, int): The I²C address of the driver.
Defaults to ``0x21``.
- **pcf8575** (*Optional*, boolean): Whether this is a 16-pin PCF8575. Defaults to ``False``.
.. _Pin Schema: /esphomeyaml/configuration-types.html#pin-schema
See Also
--------
- :ref:`i2c`
- :doc:`switch/gpio`
- :doc:`binary_sensor/gpio`
- :doc:`API Reference </api/misc/pcf8574>`

View File

@ -6,7 +6,7 @@ certain outputs. For example, if youre using an `ATX power
supply <https://en.wikipedia.org/wiki/ATX>`__ to power your LED strips,
you usually dont want to have the power supply on all the time while
the output is not on. The power supply component can be attached to any
`Output Component </esphomeyaml/components/output/index.html>`__ and
:ref:`Output Component <output>` and
will automatically switch on if any of the outputs are on. Furthermore,
it also has a cooldown time that keeps the power supply on for a while
after the last ouput has been disabled.
@ -21,29 +21,28 @@ after the last ouput has been disabled.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **id** (**Required**,
`id </esphomeyaml/configuration-types.html#id>`__): The id of the
power supply so that it can be used by the outputs.
- **pin** (**Required**, `Pin
Schema </esphomeyaml/configuration-types.html#pin-schema>`__): The
GPIO pin to control the power supply on.
- **enable_time** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The time to
that the power supply needs for startup. The output component will
wait for this period of time after turning on the PSU and before
switching the output on. Defaults to ``20ms``.
- **keep_on_time** (*Optional*,
`time </esphomeyaml/configuration-types.html#time>`__): The time the
power supply should be kept enabled after the last output that used
it has been switch off. Defaults to ``10s``.
- **id** (**Required**, :ref:`config-id`): The id of the
power supply so that it can be used by the outputs.
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The
GPIO pin to control the power supply on.
- **enable_time** (*Optional*, :ref:`config-time`): The time to
that the power supply needs for startup. The output component will
wait for this period of time after turning on the PSU and before
switching the output on. Defaults to ``20ms``.
- **keep_on_time** (*Optional*, :ref:`config-time`): The time the
power supply should be kept enabled after the last output that used
it has been switch off. Defaults to ``10s``.
See the `output component base
configuration </esphomeyaml/components/output/index.html#base-output-configuration>`__
See the :ref:`output component base configuration <config-output>`
for information on how to apply the power supply for a specific output.
ATX Power Supplies
~~~~~~~~~~~~~~~~~~
.. figure:: images/power_supply-atx.jpg
:align: center
:width: 80.0%
The power supply component will default to pulling the specified GPIO
pin up when high power mode is needed. Most ATX power supplies however
operate with an active-low configuration. Therefore their output needs
@ -60,3 +59,9 @@ to be inverted.
Then simply connect the green control wire from the ATX power supply to
your specified pin. Its recommended to put a small resistor (about 1kΩ)
in between to protect the ESP board.
See Also
--------
- :doc:`output/index`
- :doc:`API Reference </api/core/power-supply>`

View File

@ -6,7 +6,9 @@ ADC in your device to measure a voltage on certain pins. On the ESP8266
only pin A0 (GPIO17) supports this. On the ESP32 pins GPIO32 through
GPIO39 can be used.
|image0|
.. figure:: images/adc-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -20,28 +22,21 @@ GPIO39 can be used.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**,
`pin </esphomeyaml/configuration-types.html#pin>`__): The pin to
measure the voltage on.
- **name** (**Required**, string): The name of the voltage sensor.
- **attenuation** (*Optional*): Only on ESP32. Specify the `ADC
attenuation <http://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/adc.html#_CPPv225adc1_config_channel_atten14adc1_channel_t11adc_atten_t>`__
to use. One of ``0db``, ``2.5db``, ``6db``, ``11db``. Defaults to
``0db``.
- **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>`__.
- **pin** (**Required**, :ref:`config-pin`): The pin to measure the voltage on.
- **name** (**Required**, string): The name of the voltage sensor.
- **attenuation** (*Optional*): Only on ESP32. Specify the ADC
attenuation to use. See :ref:`adc-esp32_attenuation`.
- **update_interval** (*Optional*, :ref:`config-time`): The interval
to check the sensor. Defaults to ``15s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
.. |image0| image:: /esphomeyaml/components/sensor/images/adc.png
:class: align-center
:width: 80.0%
.. note::
On the ESP8266, the voltage range is 0 to 1.0V - so to measure any higher voltage you need to scale the voltage
down using, for example, a voltage divider circuit.
.. _adc-esp32_attenuation:
ESP32 Attenuation
~~~~~~~~~~~~~~~~~
@ -49,9 +44,18 @@ ESP32 Attenuation
On the ESP32, the voltage measured with the ADC caps out at 1.1V by default as the sensing range
or the attenuation of the ADC is set to ``0db`` by default.
To measure voltages higher than 1.1V, set ``attenuation`` to one of the following values:
To measure voltages higher than 1.1V, set ``attenuation`` to one of the `following values
<http://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/adc.html#_CPPv225adc1_config_channel_atten14adc1_channel_t11adc_atten_t>`__:
- ``0db`` for a full-scale voltage of 1.1V (default)
- ``2.5db`` for a full-scale voltage of 1.5V
- ``6db`` for a full-scale voltage of 2.2V
- ``11db`` for a full-scale voltage of 3.9V
- ``0db`` for a full-scale voltage of 1.1V (default)
- ``2.5db`` for a full-scale voltage of 1.5V
- ``6db`` for a full-scale voltage of 2.2V
- ``11db`` for a full-scale voltage of 3.9V
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`ads1115`
- :doc:`max6675`
- :doc:`API Reference </api/sensor/adc-sensor>`

View File

@ -1,27 +1,30 @@
ADS1115 Sensor
==============
.. warning::
This integration currently doesn't seem to work with certain chips and I'm waiting for my own ADS1115 to arrive
to diagnose the issue. If you're experiencing issues too and want to help out, please set the
:ref:`log level <logger-log_levels>` to ``VERY_VERBOSE`` and send me some logs. Thanks!
The ``ads1115`` sensor allows you to use your ADS1115 sigma-delta ADC
sensors (`datasheet <http://www.ti.com/lit/ds/symlink/ads1115.pdf>`__,
`adafruit <https://www.adafruit.com/product/1085>`__) with esphomelib.
First, setup a `ADS1115 Hub </esphomeyaml/components/ads1115.html>`__ for your ADS1115 sensor and then use this
sensors (`datasheet <http://www.ti.com/lit/ds/symlink/ads1115.pdf>`__, `Adafruit`_) with esphomelib.
First, setup a :doc:`ADS1115 Hub </esphomeyaml/components/ads1115>` for your ADS1115 sensor and then use this
sensor platform to create individual sensors that will report the
voltage to Home Assistant.
.. figure:: /esphomeyaml/components/sensor/images/ads1115-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/ads1115-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
ADS1115 16-Bit ADC. Image by `Adafruit`_.
ADS1115 16-Bit ADC. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/1085
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/adc.png
:class: align-center
:width: 80.0%
.. figure:: images/adc-ui.png
:align: center
:width: 80.0%
.. code:: yaml
@ -40,10 +43,9 @@ Configuration variables:
want to measure voltage.
- **gain** (**Required**, float): The gain of this sensor.
- **name** (**Required**, string): The name for this sensor.
- **ads1115_id** (*Optional*, `id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID of the
`ADS1115 Hub </esphomeyaml/components/ads1115.html>`__ you want to use this sensor.
- **id** (*Optional*, `id </esphomeyaml/configuration-types.html#id>`__): Manually specify
the ID used for code generation.
- **ads1115_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:doc:`ADS1115 Hub </esphomeyaml/components/ads1115>` you want to use this sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
Multiplexer And Gain
~~~~~~~~~~~~~~~~~~~~
@ -68,3 +70,10 @@ Additionally, the ADS1115 has a Programmable Gain Amplifier (PGA) that can help
- ``0.512`` (measures up to 0.512V)
- ``0.256`` (measures up to 0.256V)
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`adc`
- :doc:`max6675`
- :doc:`API Reference </api/sensor/ads1115>`

View File

@ -1,23 +1,17 @@
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
ambient light sensor with esphomelib. The :ref:`I²C bus <i2c>` 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%
.. figure:: images/bh1750-full.jpg
:align: center
:target: `Aliexpress`_
:width: 50.0%
BH1750 Ambient Light Sensor. Images from `Aliexpress`_ and `mklec`_.
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
@ -33,16 +27,21 @@ your configuration for this sensor to work.
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>`__.
- **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*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``15s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code
generation.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`tsl2561`
- :doc:`API Reference </api/sensor/bh1750>`

View File

@ -1,23 +1,17 @@
BME280 Temperature+Pressure+Humidity 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 ``bme280`` sensor platform allows you to use your BME280
(`datasheet <https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf>`__,
`Adafruit`_) temperature, pressure and humidity sensors with esphomelib. The `I²C
bus </esphomeyaml/components/i2c.html>`__ is required to be set up in
your configuration for this sensor to work.
`Adafruit`_) temperature, pressure and humidity sensors with esphomelib. The :ref:`I²C <i2c>` is
required to be set up in your configuration for this sensor to work.
.. figure:: /esphomeyaml/components/sensor/images/bme280-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/bme280-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
BME280 Temperature, Pressure & Humidity Sensor. Image by `Adafruit`_.
BME280 Temperature, Pressure & Humidity Sensor. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/2652
@ -39,46 +33,40 @@ your configuration for this sensor to work.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **temperature** (**Required**): The information for the temperature.
sensor
- **temperature** (**Required**): The information for the temperature.
sensor
- **name** (**Required**, string): The name for the temperature
sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See `Oversampling Options <#oversampling-options>`__.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature
sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See :ref:`Oversampling Options <bme280-oversampling>`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **pressure** (**Required**): The information for the pressure sensor.
- **pressure** (**Required**): The information for the pressure sensor.
- **name** (**Required**, string): The name for the pressure sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See `Oversampling Options <#oversampling-options>`__.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the pressure sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See :ref:`Oversampling Options <bme280-oversampling>`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **humidity** (**Required**): The information for the pressure sensor.
- **humidity** (**Required**): The information for the pressure sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See `Oversampling Options <#oversampling-options>`__.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the humidity sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See :ref:`Oversampling Options <bme280-oversampling>`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **address** (*Optional*, int): Manually specify the i^2c address of
the sensor. Defaults to ``0x77``. Another address can be ``0x76``.
- **iir_filter** (*Optional*): Set up an Infinite Impulse Response filter to increase accuracy. One of
``OFF``, ``2x``, ``4x``, ``16x``. Defaults to ``OFF``.
- **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.
- **address** (*Optional*, int): Manually specify the i^2c address of
the sensor. Defaults to ``0x77``. Another address can be ``0x76``.
- **iir_filter** (*Optional*): Set up an Infinite Impulse Response filter to increase accuracy. One of
``OFF``, ``2x``, ``4x``, ``16x``. Defaults to ``OFF``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``15s``.
.. _bme280-oversampling:
Oversampling Options
~~~~~~~~~~~~~~~~~~~~
@ -92,3 +80,11 @@ configure this amount. Possible oversampling values:
- ``4x``
- ``8x``
- ``16x`` (default)
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`bme680`
- :doc:`bmp085`
- :doc:`API Reference </api/sensor/bme280>`

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -8,16 +8,15 @@ BME680 Temperature+Pressure+Humidity+Gas Sensor
The ``bme680`` sensor platform allows you to use your BME680
(`datasheet <https://cdn-shop.adafruit.com/product-files/3660/BME680.pdf>`__,
`Adafruit`_) temperature, pressure and humidity sensors with esphomelib. The `I²C
bus </esphomeyaml/components/i2c.html>`__ is required to be set up in
`Adafruit`_) temperature, pressure and humidity sensors with esphomelib. The :ref:`I²C <i2c>` is required to be set up in
your configuration for this sensor to work.
.. figure:: /esphomeyaml/components/sensor/images/bme680-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/bme680-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
BME680 Temperature, Pressure & Humidity Sensor. Image by `Adafruit`_.
BME680 Temperature, Pressure & Humidity Sensor. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/3660
@ -41,54 +40,44 @@ your configuration for this sensor to work.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **temperature** (**Required**): The information for the temperature.
sensor
- **temperature** (**Required**): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature
sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See `Oversampling Options <#oversampling-options>`__.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See :ref:`bme680-oversampling`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **pressure** (**Required**): The information for the pressure sensor.
- **pressure** (**Required**): The information for the pressure sensor.
- **name** (**Required**, string): The name for the pressure sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See `Oversampling Options <#oversampling-options>`__.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the pressure sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See :ref:`bme680-oversampling`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **humidity** (**Required**): The information for the pressure sensor.
- **humidity** (**Required**): The information for the pressure sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See `Oversampling Options <#oversampling-options>`__.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the humidity sensor.
- **oversampling** (*Optional*): The oversampling parameter for the temperature sensor.
See :ref:`bme680-oversampling`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **gas_resistance** (**Required**): The information for the gas sensor.
- **gas_resistance** (**Required**): The information for the gas sensor.
- **name** (**Required**, string): The name for the gas resistance sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the gas resistance sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **address** (*Optional*, int): Manually specify the i^2c address of
the sensor. Defaults to ``0x77``. Another address can be ``0x76``.
- **iir_filter** (*Optional*): Set up an Infinite Impulse Response filter to increase accuracy. One of
``OFF``, ``2x``, ``4x``, ``16x``. Defaults to ``OFF``.
- **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.
- **address** (*Optional*, int): Manually specify the i^2c address of
the sensor. Defaults to ``0x77``. Another address can be ``0x76``.
- **iir_filter** (*Optional*): Set up an Infinite Impulse Response filter to increase accuracy. One of
``OFF``, ``2x``, ``4x``, ``16x``. Defaults to ``OFF``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``15s``.
.. _bme680-oversampling:
Oversampling Options
~~~~~~~~~~~~~~~~~~~~
@ -102,3 +91,11 @@ configure this amount. Possible oversampling values:
- ``4x``
- ``8x``
- ``16x`` (default)
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`bme280`
- :doc:`bmp085`
- :doc:`API Reference </api/sensor/bme680>`

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -8,24 +8,18 @@ The BMP085 sensor platform allows you to use your BMP085
`adafruit <https://www.adafruit.com/product/1603>`__) and BMP280
(`datasheet <https://cdn-shop.adafruit.com/datasheets/BST-BMP280-DS001-11.pdf>`__,
`adafruit <https://www.adafruit.com/product/2651>`__) temperature and
pressure sensors with esphomelib. The `I²C
bus </esphomeyaml/components/i2c.html>`__ is required to be set up in
pressure sensors with esphomelib. The :ref:`I²C <i2c>` is required to be set up in
your configuration for this sensor to work.
.. figure:: /esphomeyaml/components/sensor/images/bmp180-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/bmp180-full.jpg
:align: center
:width: 50.0%
BMP180 Temperature & Pressure Sensor. Image by `Adafruit`_.
BMP180 Temperature & Pressure Sensor..
.. _Adafruit: https://www.adafruit.com/product/1603
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/temperature-pressure.png
:class: align-center
:width: 80.0%
.. figure:: images/temperature-pressure.png
:align: center
:width: 80.0%
.. code:: yaml
@ -41,27 +35,28 @@ your configuration for this sensor to work.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **temperature** (**Required**): The information for the temperature
sensor
- **temperature** (**Required**): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature
sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature
sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **pressure** (**Required**): The information for the pressure sensor
- **pressure** (**Required**): The information for the pressure sensor.
- **name** (**Required**, string): The name for the pressure sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the pressure sensor.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- **address** (*Optional*, int): Manually specify the i^2c address of
the sensor. Defaults to ``0x77``.
- **update_interval** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): The interval to check the
- **update_interval** (*Optional*, :ref:`config-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.
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`bme280`
- :doc:`bme680`
- :doc:`API Reference </api/sensor/bmp085>`

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,27 +1,22 @@
Dallas Temperature Sensor
=========================
The ``dallas`` sensor allows you to define sensors for you `dallas
sensor hub </esphomeyaml/components/dallas.html>`__.
The ``dallas`` sensor allows you to define sensors for you :doc:`dallas sensor hub </esphomeyaml/components/dallas>`.
To initialize a sensor, first supply the ``dallas_id`` attribute
pointing to the dallas hub. Then supply either ``address`` **or**
``index`` to identify the sensor.
To initialize a sensor, first supply either ``address`` **or** ``index`` to identify the sensor.
.. figure:: /esphomeyaml/components/sensor/images/ds18b20-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/ds18b20-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
DS18b20 One-Wire Temperature Sensor. Image by `Adafruit`_.
DS18b20 One-Wire Temperature Sensor. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/374
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/temperature.png
:class: align-center
:width: 80.0%
.. figure:: images/temperature.png
:align: center
:width: 80.0%
.. code:: yaml
@ -41,19 +36,19 @@ pointing to the dallas hub. Then supply either ``address`` **or**
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **dallas_id** (**Required**, `id </esphomeyaml/configuration-types.html#id>`__): The ID of the dallas hub.
- **address** (**Required**, int): The address of the sensor. Use either
this option or index.
- **index** (**Required**, int): The index of the sensor starting with 0.
So the first sensor will for example have index 0. `Its recommended
to use address instead <#getting-sensor-ids>`__.
- **resolution** (*Optional*, int): An optional resolution from 8 to
12. Higher means more accurate. Defaults to the default for most
sensors: 12.
- **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>`__.
- **address** (**Required**, int): The address of the sensor. Use either
this option or index.
- **index** (**Required**, int): The index of the sensor starting with 0.
So the first sensor will for example have index 0. :ref:`Its recommended
to use address instead <dallas-getting-ids>`.
- **resolution** (*Optional*, int): An optional resolution from 8 to
12. Higher means more accurate. Defaults to the maximum for most dallas temperature sensors: 12.
- **dallas_id** (*Optional*, :ref:`config-id`): The ID of the :doc:`dallas hub </esphomeyaml/components/dallas>`.
Use this if you have multiple dallas hubs.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
.. _dallas-getting-ids:
Getting Sensor IDs
~~~~~~~~~~~~~~~~~~
@ -62,14 +57,19 @@ It is highly recommended to use the ``address`` attribute for creating
dallas sensors, because if you have multiple sensors on a bus and the
automatic sensor discovery fails, all sensors indices will be shifted by
one. In order to get the address, simply start the firmware on your
device with a configured dallas hub and observe the log output (the `log
level </esphomeyaml/components/logger>`__ must be set to at least
device with a configured dallas hub and observe the log output (the :ref:`log
level <logger-log_levels>` must be set to at least
``debug``!). You will find something like this:
|image1|
.. figure:: images/dallas-log.png
Next, individually warm up or cool down the sensors and observe the log
output to determine which address points to which sensor.
.. |image1| image:: /esphomeyaml/components/sensor/images/dallas-log.png
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`/esphomeyaml/components/dallas`
- :doc:`max6675`
- :doc:`API Reference </api/sensor/dallas>`

View File

@ -12,7 +12,7 @@ The DHT Temperature+Humidity sensor allows you to use your DHT11
`sparkfun <https://cdn.sparkfun.com/datasheets/Sensors/Weather/RHT03.pdf>`__)
sensors with esphomelib.
.. figure:: /esphomeyaml/components/sensor/images/dht22-full.jpg
.. figure:: images/dht22-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
@ -21,10 +21,8 @@ sensors with esphomelib.
.. _Adafruit: https://www.adafruit.com/product/385
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/temperature-humidity.png
:class: align-center
.. figure:: images/temperature-humidity.png
:align: center
:width: 80.0%
.. code:: yaml
@ -42,35 +40,37 @@ sensors with esphomelib.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **pin** (**Required**, `pin </esphomeyaml/configuration-types.html#pin>`__): The pin where the DHT bus is connected.
- **temperature** (**Required**): The information for the temperature
sensor
- **pin** (**Required**, :ref:`config-pin`): The pin where the DHT bus is connected.
- **temperature** (**Required**): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature
sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **humidity** (**Required**): The information for the humidity sensor
- **humidity** (**Required**): The information for the humidity sensor
- **name** (**Required**, string): The name for the humidity sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **model** (*Optional*, int): Manually specify the DHT model, can be
one of ``AUTO_DETECT``, ``DHT11``, ``DHT22``, ``AM2303``, ``RHT03``
and helps with some connection issues. Defaults to ``AUTO_DETECT``.
- **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.
- **model** (*Optional*, int): Manually specify the DHT model, can be
one of ``AUTO_DETECT``, ``DHT11``, ``DHT22``, ``AM2303``, ``RHT03``
and helps with some connection issues. Defaults to ``AUTO_DETECT``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``15s``.
.. note::
If you're seeing lots of invalid temperature/humidity warnings in the logs, try manually setting the
DHT model with the ``model:`` configuration variable. Other problems could be wrong pull-up resistor values
on the DATA pin or too long cables.
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`dht12`
- :doc:`hdc1080`
- :doc:`htu21d`
- :doc:`sht3xd`
- :doc:`API Reference </api/sensor/dht>`

View File

@ -1,16 +1,11 @@
DHT12 Temperature+Humidity 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 DHT12 Temperature+Humidity sensor allows you to use your DHT12
The ``dht12`` Temperature+Humidity sensor allows you to use your DHT12
(`datasheet <http://www.robototehnika.ru/file/DHT12.pdf>`__,
`electrodragon`_) i2c-based sensor with esphomelib.
.. figure:: /esphomeyaml/components/sensor/images/dht12-full.jpg
.. figure:: images/dht12-full.jpg
:align: center
:target: `electrodragon`_
:width: 50.0%
@ -19,10 +14,8 @@ The DHT12 Temperature+Humidity sensor allows you to use your DHT12
.. _electrodragon: http://www.electrodragon.com/product/dht12/
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/temperature-humidity.png
:class: align-center
.. figure:: images/temperature-humidity.png
:align: center
:width: 80.0%
.. code:: yaml
@ -39,25 +32,26 @@ The DHT12 Temperature+Humidity sensor allows you to use your DHT12
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **temperature** (**Required**): The information for the temperature
sensor
- **temperature** (**Required**): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature
sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **humidity** (**Required**): The information for the humidity sensor
- **humidity** (**Required**): The information for the humidity sensor
- **name** (**Required**, string): The name for the humidity sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **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.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``15s``.
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`dht`
- :doc:`hdc1080`
- :doc:`htu21d`
- :doc:`sht3xd`
- :doc:`API Reference </api/sensor/dht12>`

View File

@ -4,23 +4,21 @@ HDC1080 Temperature+Humidity Sensor
The HDC1080 Temperature+Humidity sensor allows you to use your HDC1080
(`datasheet <http://www.ti.com/lit/ds/symlink/hdc1080.pdf>`__,
`adafruit <https://www.adafruit.com/product/2635>`__) sensors with
esphomelib. The `I²C bus </esphomeyaml/components/i2c.html>`__) is
esphomelib. The :ref:`I²C Bus <i2c>` is
required to be set up in your configuration for this sensor to work.
.. figure:: /esphomeyaml/components/sensor/images/hdc1080-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/hdc1080-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
HDC1080 Temperature & Humidity Sensor. Image by `Adafruit`_.
HDC1080 Temperature & Humidity Sensor. Image by `Adafruit`_.
.. _Adafruit: https://www.adafruit.com/product/2635
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/temperature-humidity.png
:class: align-center
:width: 80.0%
.. figure:: images/temperature-humidity.png
:align: center
:width: 80.0%
.. code:: yaml
@ -36,29 +34,30 @@ required to be set up in your configuration for this sensor to work.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **temperature** (**Required**): The information for the temperature
sensor
- **temperature** (**Required**): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature
sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **humidity** (**Required**): The information for the humidity sensor
- **humidity** (**Required**): The information for the humidity sensor
- **name** (**Required**, string): The name for the humidity sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **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.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``15s``.
Currently, the platform doesnt support activating the built-in heater,
as it seems to only be rarely of use. If you need it, please open an
issue.
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`dht`
- :doc:`dht12`
- :doc:`htu21d`
- :doc:`sht3xd`
- :doc:`API Reference </api/sensor/hdc1080>`

View File

@ -4,23 +4,21 @@ HTU21D Temperature+Humidity Sensor
The HTU21D Temperature+Humidity sensor allows you to use your HTU21D
(`datasheet <http://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Data+Sheet%7FHPC199_6%7FA6%7Fpdf%7FEnglish%7FENG_DS_HPC199_6_A6.pdf%7FCAT-HSC0004>`__,
`adafruit <https://www.adafruit.com/product/1899>`__) sensors with
esphomelib. The `I²C bus </esphomeyaml/components/i2c.html>`__ is
esphomelib. The :ref:`I²C Bus <i2c>` is
required to be set up in your configuration for this sensor to work.
.. figure:: /esphomeyaml/components/sensor/images/htu21d-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
.. figure:: images/htu21d-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
HTU21D Temperature & Humidity Sensor. Image by `Adafruit`_.
HTU21D Temperature & Humidity Sensor. Image by `Adafruit`_.
.. _Adafruit: https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity-sensor/overview
|image0|
.. |image0| image:: /esphomeyaml/components/sensor/images/temperature-humidity.png
:class: align-center
:width: 80.0%
.. figure:: images/temperature-humidity.png
:align: center
:width: 80.0%
.. code:: yaml
@ -36,25 +34,26 @@ required to be set up in your configuration for this sensor to work.
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **temperature** (**Required**): The information for the temperature
sensor
- **temperature** (**Required**): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature
sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **humidity** (**Required**): The information for the humidity sensor
- **humidity** (**Required**): The information for the humidity sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- All other options from
`Sensor </esphomeyaml/components/sensor/index.html#base-sensor-configuration>`__
and `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
- **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.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``15s``.
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`dht`
- :doc:`dht12`
- :doc:`hdc1080`
- :doc:`sht3xd`
- :doc:`API Reference </api/sensor/htu21d>`

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 KiB

After

Width:  |  Height:  |  Size: 615 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 935 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 1009 KiB

Some files were not shown because too many files have changed in this diff Show More