Virtual LP Gas Meter Energy Integration Midnight Reset Issue

I created a simple virtual LP Gas meter and used it as a source for the Energy Integration.
It works well but there is an issue at midnight when the run time values are reset on which the propane usage is dependent.
The time is supposed to get reset to zero at 12:00 midnight but it actually occurs 10 to 15 seconds after that.
What this does in the Energy Integration is it uses the last saved values and applies them to the 12:00 to 1:00AM time period which creates a usage that did not occur.
Somehow the runtime/propane usage needs to be set to zero just before and slightly past midnight so the Energy Integration will not register this incorrect usage.
I thought about using a multiplier of zero that is applied to the propane usage calculation but it would need to be applied from 11:59PM to 12:01AM after which the actual variables would be cleared by the normal process.
This seems a bit kludgy but I am not sure how to implement this and maybe there is a much cleaner approach.

Here is the main portion of the code.

# Upstairs Use 'HVAC action' state attribute in the history stats sensors 
  - platform: template
    sensors:
      hvac_upstairs_action:
        friendly_name: "HVAC Upstairs Action"
        value_template: "{{ state_attr('climate.upstairs_hall','hvac_action') }}"

# Upstairs Heating Run Time Today
  - platform: history_stats
    name: Upstairs Heating time today
    entity_id: sensor.hvac_upstairs_action
    state: 'heating'
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"

# Amount of "Propane used today" sensor, m³hr, burn rate x time where burn rate is 1.113m³ per furnace
# HA only displays in m³ but because the imperial units is set it converts to ft³ so it must convert back
# because of imperial vs metric limit in the Energy Integration this needs to output m³/35.3
  - platform: template
    sensors:
      hvac_propane_used_today:
        friendly_name: "HVAC Propane Used Today"
        unit_of_measurement: "m³"
        value_template:  {{ ((states("sensor.upstairs_heating_time_today") | float(0)) * 1.113 / 35.3) | round(5) }} 

Thank you.