Deprecation of legacy template entities in 2025.12

I have a hundred of errors, and started to fix the syntax. I was checking the configuration in the “Developer Tools”, but for some reason it started a endless spinning, not being able to check if there is a mistake. So, I will wait for a more clear instructions what to do for the next updates.

My configuration uses “sensor: !include_dir_merge_list sensor/” for example, and under “sensor” folder there a lot of files that are affected. Can I leave a “template:” under each of them? I also have a file called template.yaml (“template: !include template.yaml”) which I would like to avoid to move all templates to this file for a sake of organization. Thanks for your help.

I wonder when the automatic transfer button will appear? Transferring 155+ sensors manually is awesome!

You have a history of not reading and overreacting and it’s not going to work on me anymore. Either ask for help by posting your configuration, logs, and a question without complaining or leave the thread and find help elsewhere.

7 Likes

Never.

Home assistant does not change your yaml. Ever.

Even if a YAML integration is imported into the GUI it is still up to you to delete the old config.

This is a good thing.

This does not preclude someone making a third party tool to do it though I guess.

1 Like

You’d have to put each definition in the template section in configuration.yaml. Or you can split it into a separate file like your sensor file. You cannot keep it in the sensor file. That will be clarified a bit better after I update the repair message.

Examples:

old sensor —

nightstate:
friendly_name: Night State
value_template: “{% if is_state(‘sun.sun’, ‘below_horizon’) %}1{% else %}0{% endif %}”

---------------------- new broken desaster -----------------

  • unique_id: “2024120801”
    name: “day_night”
    icon_template: ‘{% if is_state(“sun.sun”, “above_horizon”) %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}’
    state: ‘{% if is_state(“sun.sun”, “above_horizon”) %}Op{% else %}Onder{% endif %}’
    attributes:
    friendly_name: Day/Night

even tried day_night as unique id to no avail!
BROKE!

------ olod working switch ---------------

  • platform: template
    switches:
    versterkers_on_off:
    friendly_name: “Versterkers”
    value_template: “{{ is_state(‘switch.p1_01_switch1’, ‘on’) }}”
    turn_on:
    - service: switch.turn_on
    entity_id: switch.p1_01_switch1
    - delay: 4
    - service: switch.turn_on
    entity_id: switch.p1_01_switch2
    turn_off:
    - service: switch.turn_off
    entity_id: switch.p1_01_switch2
    - delay: 5
    - service: switch.turn_off
    entity_id: switch.p1_01_switch1

--------------- New broken version --------

  • switch:
    • turn_on:
      • entity_id:
        • switch.p1_01_switch1
          action: switch.turn_on
      • delay: 0:00:04
      • entity_id:
        • switch.p1_01_switch2
          action: switch.turn_on
          turn_off:
      • entity_id:
        • switch.p1_01_switch2
          action: switch.turn_off
      • delay: 0:00:05
      • entity_id:
        • switch.p1_01_switch1
          action: switch.turn_off

      default_entity_id: switch.versterkers_on_off

      name: Versterkers
      state: “{{ is_state(‘switch.p1_01_switch1’, ‘on’) }}”

Can you please format it properly for the forums with backticks or the code button.

All are now in the Template folder, it does nothing it gave me all broken sensors and switches.

Have my setup since 5 years in different folders never had a problem with those.

Yes, some functions were transferred and had to be removed from yaml. This is more convenient than doing it manually. I would like to have this functionality.

Sorry no and please do not egg me more I am super annoyed, I had to use a notepad to only show what has happened, even without proper formatting can you maybe tell what is wrong?

I don’t care if you’re annoyed. If you can’t help us help you, then why are you here?

This is looking like gpio all over again with you.

old------

#- platform: template
#  switches:
#    versterkers_on_off:
#      friendly_name: "Versterkers"
#      value_template: "{{ is_state('switch.p1_01_switch1', 'on') }}"
#      turn_on:
#        - service: switch.turn_on
#          entity_id: switch.p1_01_switch1
#        - delay: 4
#        - service: switch.turn_on
#          entity_id: switch.p1_01_switch2
#      turn_off:
#        - service: switch.turn_off
#          entity_id: switch.p1_01_switch2
#        - delay: 5
#        - service: switch.turn_off
#          entity_id: switch.p1_01_switch1

new ---------------

  - switch:
      - turn_on:
          - entity_id:
              - switch.p1_01_switch1
            action: switch.turn_on
          - delay: 0:00:04
          - entity_id:
              - switch.p1_01_switch2
            action: switch.turn_on
        turn_off:
          - entity_id:
              - switch.p1_01_switch2
            action: switch.turn_off
          - delay: 0:00:05
          - entity_id:
              - switch.p1_01_switch1
            action: switch.turn_off
        #        default_entity_id: switch.versterkers_on_off
        name: Versterkers
    state: "{{ is_state('switch.p1_01_switch1', 'on') }}"


old --------

nightstate:
friendly_name: Night State
value_template: “{% if is_state(‘sun.sun’, ‘below_horizon’) %}1{% else %}0{% endif %}”

new---------

  - unique_id: "2024120801"
    name: "day_night"
    icon_template: '{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'
    state: '{% if is_state("sun.sun", "above_horizon") %}Op{% else %}Onder{% endif %}'
    attributes:
      friendly_name: Day/Night

None of the new working, they do not appear in home assistant States!

1 Like

Is that switch in the template section or did you leave it in the switch section?

I did put the switch in the template section yes in templates.yaml. Sorry for the sensor day/night in between the pre-formatted text did not work?

Please post your entire config then. Do you have more than 1 template section?

No just one templates.yaml with all template sensors in it, the old sensor who were there all the time before the update still work, the new not a single one, justy placed 14 of those from sensors.yaml to templates.yaml with the new code first with the given new code as ha gave me, those did not work then I did a rewrite they got accepted, but not a single one works any more. Bricking more then half of my home assistant.

That new day night sensor has icon_template which is not a valid option, did you copy paste that from the repair? The repair would not show icon_template.

no I placed it back when it did not work anyway!

So the line icon_template can not be used anymore?

Well, I suggest you revert to a backup because you messed up your config and you’re unwilling to show the whole thing.

It’s now just icon, which you would have seen in the repair.

Seriously, it’s all just copy paste. Nothing more. If you’re doing anything outside copy paste, you’re doing it wrong. :man_shrugging: