diff --git a/source/_integrations/trend.markdown b/source/_integrations/trend.markdown index 83ffcda9d65..dbac93eacea 100644 --- a/source/_integrations/trend.markdown +++ b/source/_integrations/trend.markdown @@ -87,8 +87,7 @@ sensors: If the optional `sample_duration` and `max_samples` parameters are specified then multiple samples can be stored and used to detect long-term trends. -Each time the state changes, a new sample is stored along with the sample time. -Samples older than `sample_duration` seconds will be discarded. +Each time the state changes, a new sample is stored along with the sample time. Samples older than `sample_duration` seconds will be discarded. The `max_samples` parameter must be large enough to store sensor updates over the requested duration. If you want to trend over two hours and your sensor updates every 120s then then `max_samples` must be at least 60, i.e., 7200/120 = 60. A trend line is then fitted to the available samples, and the gradient of this line is compared to `min_gradient` to determine the state of the trend sensor. @@ -124,12 +123,14 @@ binary_sensor: temp_falling: entity_id: sensor.outside_temperature sample_duration: 7200 + max_samples: 120 min_gradient: -0.0008 device_class: cold temp_rising: entity_id: sensor.outside_temperature sample_duration: 7200 + max_samples: 120 min_gradient: 0.0008 device_class: heat ```