Trend with Xiaomi Thermometer

I’m trying to have a sensor using Xiaomi Thermometer with BTHome firmware but it seems I do not find the proper values.

My idea is to have the trend displayed when the temp changes with 0.2 degrees in a period of 15minutes. The thermometer seems to refresh every 70 seconds.

This is how my settings looks like:

    min_gradient: 0.00108148148
    max_samples: 12.32876712328767
    sample_duration: 900

So i’m guessing the formula is (-0.2)/(12.32876712328767*15).

What am I doing wrong since it doesn’t seem to trigger properly?

When asking for help, please post the whole configuration that is in question. There may be other issues that we can’t see.

The value of max_samples has to be an integer, there’s no such thing as fractional samples. You need to set the value to a number that makes sense for the length of your duration as well as how often your sensor pushes updates… so it should be 13 or higher.

Sorry about that. Here is the complete sensor config:

  temp_rising_afara:
    entity_id: sensor.ble_temperature_afara
    min_gradient: -0.00102564102
    max_samples: 13
    sample_duration: 900
    device_class: heat
    friendly_name: Afara Temp Rising

With these values, it doesn’t trigger correctly.