History Stats - time decimal error

Hi, I am using history stats to track the time a pump runs, issue is the history stat is rounding to only two decimals so 4m30sec which is 0.075h is shown as 0.08h

sensor:

  - platform: history_stats
    name: chlorinator_on_today_new
    entity_id: switch.pentair_chlor
    state: "on"
    type: time
    start: "{{ now().replace(hour=00, minute=00, second=00) }}"
    end: "{{ now() }}"
  - platform: template
    sensors:
      chlorinator_on_today_hrs_new:
        value_template: >
          {{ timedelta(hours=states('sensor.chlorinator_on_today_new') | float(0)) }}

Due to this, the hr:mm:ss I show from the template (timedelta) is showing 0.8h as hh:mm:ss which is 4m48sec

Any help would be appreciated

See here for a potential solution:

Thanks, for a chart/graph I think your suggestion would work. I use the sensor to display in a card as a numeric value of time, in this case, it’s the sensor entity that needs to be shown, which I don’t think the custom history will fix.