Pulse Meter Sensor - prevent data lost on power lost

Hello, I’d like to measure the pulses of my gas meter. There I use the the “pulse_meter” sensor. Now I would like to prevent that the counter is reset due to a power loss. Is there a possibly to do so?

sensor:
  - platform: pulse_meter
    pin: D2
    name: 'Gas_m3_Energy'
    unit_of_measurement: 'm3'
    device_class: energy
    state_class: measurement
    accuracy_decimals: 3
    id: pulse_meter_m3
    filters:
      - multiply: 0.01 # 0.01 perPulse
    total:
      name: "Gas_m3_Total_Energy"
      unit_of_measurement: "m3"
      device_class: energy
      state_class: measurement
      accuracy_decimals: 3
      filters:
        - multiply: 0.01 # 0.01 perPulse