esphome-docs/esphomeyaml/components/sensor/duty_cycle.rst

44 lines
1.3 KiB
ReStructuredText
Raw Normal View History

2018-06-13 22:38:49 +02:00
Duty Cycle Sensor
=================
2018-11-14 22:12:27 +01:00
.. seo::
:description: Instructions for setting up duty cycle sensors in esphomelib
:image: percent.svg
2018-06-13 22:38:49 +02:00
The duty cycle sensor allows you to measure for what percentage of time a signal
on a GPIO pin is HIGH or LOW.
For example, you can measure if a status LED of a pool controller is permanently active
(indicating that the pump is on) or blinking.
.. figure:: images/duty_cycle-ui.png
:align: center
:width: 80.0%
.. code:: yaml
# Example configuration entry
sensor:
- platform: duty_cycle
pin: D0
name: Duty Cycle Sensor
Configuration variables:
------------------------
- **pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The pin to observe for the duty
cycle.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``15s``.
See :ref:`sensor-default_filter`.
- **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>`.
2018-10-12 16:33:22 +02:00
See Also
--------
- :ref:`sensor-filters`
- :doc:`API Reference </api/sensor/duty_cycle>`
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/sensor/duty_cycle.rst>`__
2018-10-12 16:33:22 +02:00
.. disqus::