mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
* Cleanup as per issue #10648 Added clarification for max samples and adjusted examples. * ✏️ Tweak Co-authored-by: Franck Nijhof <frenck@frenck.dev>
This commit is contained in:
parent
cde549a176
commit
1e4b95d451
@ -87,8 +87,7 @@ sensors:
|
|||||||
If the optional `sample_duration` and `max_samples` parameters are specified
|
If the optional `sample_duration` and `max_samples` parameters are specified
|
||||||
then multiple samples can be stored and used to detect long-term trends.
|
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.
|
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.
|
||||||
Samples older than `sample_duration` seconds will be discarded.
|
|
||||||
|
|
||||||
A trend line is then fitted to the available samples, and the gradient of this
|
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.
|
line is compared to `min_gradient` to determine the state of the trend sensor.
|
||||||
@ -124,12 +123,14 @@ binary_sensor:
|
|||||||
temp_falling:
|
temp_falling:
|
||||||
entity_id: sensor.outside_temperature
|
entity_id: sensor.outside_temperature
|
||||||
sample_duration: 7200
|
sample_duration: 7200
|
||||||
|
max_samples: 120
|
||||||
min_gradient: -0.0008
|
min_gradient: -0.0008
|
||||||
device_class: cold
|
device_class: cold
|
||||||
|
|
||||||
temp_rising:
|
temp_rising:
|
||||||
entity_id: sensor.outside_temperature
|
entity_id: sensor.outside_temperature
|
||||||
sample_duration: 7200
|
sample_duration: 7200
|
||||||
|
max_samples: 120
|
||||||
min_gradient: 0.0008
|
min_gradient: 0.0008
|
||||||
device_class: heat
|
device_class: heat
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user