Sensor using history stats doesn't store its own history

I have this sensor setup using history stats, which basically returns a value between 0 and 100%. It works fine, but it doesn’t show any history.

image


  - platform: history_stats
    name: Duty Cycle Pompa di Calore
    entity_id: sensor.pompa_di_calore_on
    state: "1"
    type: ratio
    start: "{{ now() - timedelta(hours=24) }}"
    duration:
      hours: 24

I even included it in the recorder

recorder:
  purge_keep_days: 10
  db_url: mysql://xxxxxx
  exclude:
     entities:
       - input_number.amp_limit
  include:
    entities:
      - sensor.duty_cycle_pompa_di_calore