Loss template history after update the docker image

Hello,
I create a template to report the energy consummation from entity power and work flawless but after update Docker HA image loss the data history to this template.

there is a way to prevent it?

sensor:
  - platform: integration
    source: sensor.presa_tostapane_power
    name: "presa_tostapane_energia"
    unit_prefix: k
    round: 3

customize:
  sensor.presa_tostapane_energia:
    friendly_name: "Energia Tostapane"
    icon: mdi:counter
    last_reset: '1970-01-01T00:00:00+00:00'
    device_class: energy
    state_class: total_increasing
    unit_of_measurement: kWh

anyone help me to resolve this behaviour?

Those aren’t templates. That’s an integration sensor. Most likely, the entity_id changed. Look on you system for entity’s with similiar names.

Sorry for wrong. The problem is name of entity?