History stats - bug with retrieved values

Hello,

My Home Assistant version : 0.116.2

I have been using the history_stats function for two weeks, to retrieve two values from a sensor (if value = 4 and if value = 5).
It worked fine until a few days when I started to observe slightly reduced values:
image
My problem is still at 4:12 (and a few seconds)

I changed my function in sensor.yaml yesterday to no longer have a start = 0, but the problem is still present. My function:

  - platform: history_stats
    name: Ravelli_temps_allumage_4
    entity_id: sensor.ravelli_etat
    state: '4'
    type: time
    start: '{{ now().replace(year=(states("input_number.input_annee_debut_hiver") | int), month=10, day=1, hour=0, minute=0, second=0) }}'
    end: '{{ now().replace(year=(states("input_number.input_annee_fin_hiver") | int), month=5, day=1, hour=0, minute=0, second=0) }}'

  - platform: history_stats
    name: Ravelli_temps_allumage_5
    entity_id: sensor.ravelli_etat
    state: '5'
    type: time
    start: '{{ now().replace(year=(states("input_number.input_annee_debut_hiver") | int), month=10, day=1, hour=0, minute=0, second=0) }}'
    end: '{{ now().replace(year=(states("input_number.input_annee_fin_hiver") | int), month=5, day=1, hour=0, minute=0, second=0) }}'

input_number.input_annee_debut_hiver = 2020
input_number.input_annee_fin_hiver = 2021

I take your suggestions to help me.
I have seen track debuts with recorder or by logging into home-assistant_v2.db.