Duty Cycle Sensor

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.

# Example configuration entry
  - platform: duty_cycle
    pin: D0
    name: Duty Cycle Sensor

Configuration variables:

  • pin (Optional, Pin Schema): The pin to observe for the duty cycle.
  • update_interval (Optional, Time): The interval to check the sensor. Defaults to 15s. See update_interval gotchas.
  • id (Optional, ID): Set the ID of this sensor for use in lambdas.
  • All other options from Sensor and MQTT Component.