Integration Sensor
The integration sensor is a helper sensor that can integrate values from other sensors over
time. This can for example be useful to integrate the values of a water flow sensor (in m^3/s) over
time (result is in m^3).
This component can be considered a more-generic version of the Total Daily Energy.
# Example configuration entrysensor: - platform: integration name: "Total Daily Energy" sensor: my_flow_meter time_unit: min
# The sensor to integrate, can be any power sensor - platform: pulse_counter # ... id: my_flow_meterConfiguration variables
Section titled “Configuration variables”-
sensor (Required, ID): The ID of the sensor to integrate over time.
-
time_unit (Required, string): The time unit to integrate with, one of
ms,s,min,hord. -
integration_method (Optional, string): The integration method to use. One of
trapezoid,leftorright. Defaults totrapezoid. -
restore (Optional, boolean): Whether to store the intermediate result on the device so that the value can be restored upon power cycle or reboot. Warning: this option can wear out your flash. Defaults to
false. -
All other options from Sensor.
sensor.integration.reset Action
Section titled “sensor.integration.reset Action”This Action allows you to reset the value of the integration sensor to zero. For example this can be used to reset the integration sensor to zero at midnight with a time-based automation.
on_...: - sensor.integration.reset: my_integration_sensorsensor.integration.set_value Action
Section titled “sensor.integration.set_value Action”This Action allows you to set the integration sensor to a specific value. For example, it can be used to set the sensor to the battery capacity when it is fully charged.
on_...: - sensor.integration.set_value: id: my_integration_sensor value: 100Configuration options:
- id (Required, ID): The ID of the integration sensor.
- value (Required, float, templatable): The value to set the integration sensor to.