Statistic Sensor: Max Value

I have a heating thermostat and I would like to determine, from it’s set point if the heating has been on over the last 24 hours. I configured a statistics sensor as below but it does not behave as I would expect it to. E.g. the heating was on until 22:00 last night (on 20) and it’s now 12:00 the next day so I would expect this sensor to have the value of 20. But it doesn’t - it’s set to 18, the value we turn it down to at night. What am I missing?

platform: statistics
    name: "Hall_Thermostat_Max_24_Hours"
    entity_id: sensor.hall_thermostat_set_point
    state_characteristic: value_max
      hours: 24