I have a few questions about the Trend integration.
I understood it like this:
min_gradient=temperature difference/(minutes x 60)
So if I want a temperature difference of 0.01 °C to trigger within 6 minutes, that would be 0.01/3600=0.000027778
My configuration.yaml says the following:
template:
- sensor:
- Name: Attic 1 Temperature Trend
state: >
{% if is_state('attic_1_temp_rising','on') %}
rising
{% elif is_state('attic_1_temp_falling','on') %}
falling
{% else %}
steady
{% endif %}
icon: >
{% if is_state('attic_1_temp_rising','on') %}
mdi:thermometer-chevron-up
{% elif is_state('attic_1_temp_falling','on') %}
mdi:thermometer-chevron-down
{% else %}
mdi:thermometer-minus
{% endif %}
binary_sensor:
- platform: trend
sensors:
attic_1_temp_falling:
friendly_name: "Attic Thermometer 1 Trend"
entity_id: sensor.attic_thermometer_1_temperature
sample_duration: 360
max_samples: 10
min_samples: 2
min_gradient: -0.000027778
device_class: cold
attic_1_temp_rising:
friendly_name: "Attic Thermometer 1 Trend"
entity_id: sensor.attic_thermometer_1_temperature
sample_duration: 360
max_samples: 10
min_samples: 2
min_gradient: 0.000027778
device_class: heat
Nevertheless, it always remains steady.
As you can see, the temperature rises continuously.
Maybe the Trend integration is not suitable for my project.
For example, I don’t know how often my sensor updates.
I have 4 identical sensors and as you can see the update rate is different.
Unfortunately, I haven’t yet figured out how to log the interval so that I can see how often Temperature “last_updated” really occurs.
What I actually want is that after 2 consecutive temperature increases there is “rising” and after 2 consecutive temperature decreases there is “falling”.
I actually don’t care about the time period.
Nevertheless, I would like to understand how exactly the trend sensor behaves in detail if you only use short measuring spans (in the minute range)
Thank you!