Problems with the deprecation messages

I am working to get rid of the deprecation messages. I try to convert my sensors 1-by-1 and put them in a separate templates.yaml, in mu configuration.yam;, I put the include. So far so good
But now I see that some sensors stay 'unavailable’in edv.tools->States
I can get around it by giving it a diffeent name
Example:

  • sensor:
    • unit_of_measurement: W
      default_entity_id: sensor.grid_power_production
      name: Grid power production
      state: ‘{{ (states(“sensor.dsmr_reading_electricity_currently_returned”) | float(0) * 1000) | int }}’
      ==
  • sensor:
    • unit_of_measurement: W
      default_entity_id: sensor.grid_powerk_production
      name: Grid powerK production
      state: ‘{{ (states(“sensor.dsmr_reading_electricity_currently_returned”) | float(0) * 1000) | int }}’
      ==
      I have thes both in my templates.yaml. The 1st says 'unavailable; , the 2nd works fine
      What am I doing wrong?

Please post over here: Deprecation of legacy template entities in 2025.12

Though make sure you format your post correctly this time.