Help for Trend Binary Sensor

Hi everyone, I probably don’t understand how it works, but I created a binary sensor that should notify me when a temperature sensor starts to drop. I’d like the binary sensor to test the temperature every 5 minutes and notify me of a drop every 0.5 degrees Celsius.

This is what I set up, but I’m sure I did it wrong.
Could you help me? Thanks.

How often does your sensor post new values? You need to know that in order to set the number of sample to store. If the sensor only posts new values every 30 seconds, then 10 stored values for a 300 second span is probably fine, but it’s usually better to err on the side of setting it to store a few extra samples, since they will be culled by the max age if necessary. If you don’t know or can’t find out how often if happens, set the stored values higher.

Where did that rate come from? A half-degree drop over 300 seconds is −0.001666667 degree/sec.

Hello @Didgeridrew , thank you for reply.
To be honest, I needed to create a trigger that would activate when the temperature read by a sensor dropped compared to the previous reading, so I was thinking of combining the temperature sensor’s status change with a trend sensor that would indicate whether the temperature change was decreasing or not. The only thing I didn’t think of was the complexity of the settings, perhaps because I didn’t understand them. In any case, my need is to know, when the trigger is activated by a temperature change, whether the trend of the change is decreasing or not. I don’t know how much time can pass between one change and the next, but certainly no less than 10 minutes. However, I would need the trend of change to be available when the changing temperature trigger is activated. Thanks

If you are only interested in comparing the new value to it’s previous value, you just need a State trigger with a Template condition. The previous value (from_state) is part of the available trigger data for State triggers.

triggers:
  - trigger: state
    entity_id: sensor.example_temperature
    to: ~
conditions:
  - alias: New temperature is at least 0.5 degrees lower than the previous temp.
    condition: template
    value_template: |
      {{ trigger.to_state.state|float <= trigger.from_state.state|float - 0.5 }}

Hello @Didgeridrew ,
thanks for your reply.
I wasn’t aware of the trigger’s ability to retain its previous value. If I had known about it earlier, I would have saved myself a lot of trouble with the Trend sensor. Thank you for the excellent suggestion.
Happy New Year.