Deprecation of legacy template entities in 2025.12

TLDR: Legacy template entities (alarm_control_panel, binary_sensor, cover, fan, light, lock, sensor, switch, vacuum, weather) are being deprecated in 2025.12. Legacy template entities will no longer work after 2026.6. I wanted to avoid the deprecation, however it’s apparent that it’s not possible due to future plans.


Do not use AI to migrate. AI will screw up the yaml. Use the tools provided in this post, if you use AI you are on your own.


The Deprecation

Please use this thread to ask questions and address concerns about the upcoming deprecation of legacy template entities.

The Future

You may have noticed an increased number of template integration changes over the past 12 months. That’s because I took over the integration and have been updating it. These updates have a few main objectives:

  1. Consistent entity behavior across domains within the template integration
  2. Future plans for template blueprints in the UI
  3. New (planned) template domains. E.g. climate, media_player, etc.
  4. Future plans to allow yaml based template entities to be assigned to devices

The Reasoning

Unfortunately, I’ve ran into many issues related to supporting legacy yaml syntax. Deprecating legacy template entities was not my first choice. After spending months trying to work around the issues, it’s clear that they need to be deprecated in order to move the integration into the future.

A few versions ago modern template syntax gained the ability to assign a default_entity_id through yaml. Modern syntax can now provide a full configuration that is equivalent to the legacy syntax, meaning the feature parity is 1 to 1.

The Migration

A repair will appear if you are using legacy template entities in 2025.12. The repair will offer a migration guide.

If you’re having trouble with the repair migration guide, please check out the migration guides in the documentation.

This custom integration is a migration helper if you have 100s of legacy templates. Please understand that this will generate the bare minimum migration path and it requires minor edits to configuration.yaml. The custom integration will traverse current legacy template issues and generate a series of files inside config\migrated_templates folder.

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

E.g. This legacy template definition:

sensor:
  - platform: template
    sensors:
      my_jam:
        friendly_name: Current ISO Timestamp
        device_class: timestamp
        unique_id: my_jam_timestamp
        value_template: "{{ now().isoformat() }}"

Will produce this repair

COMMON ISSUES

Bad migration example1: Too many template sections

Please keep in mind, I can only account for so many situations in the repair. If you have multiple templates, make sure you match the indentation of your existing template: field and do not include more than 1 template: field.

I.e. if you already have this in configuraiton.yaml

template:
- triggers:
  - trigger: state
    entity_id: sensor.foo
  sensor:
  - name: abc
    state: "{{ 'something' }}"

Good merge

template:
- triggers:
  - trigger: state
    entity_id: sensor.foo
  sensor:
  - name: abc
    state: "{{ 'something' }}"

# MIGRATED ENTITY 
- sensor:
  - default_entity_id: sensor.my_jam
    state: '{{ 1==1 }}'
    name: my_jam

Bad merge

template:
- triggers:
  - trigger: state
    entity_id: sensor.foo
  sensor:
  - name: abc
    state: "{{ 'something' }}"

template: # <--- THIS IS WRONG DO NOT HAVE MORE THAN 1 template:
# MIGRATED ENTITY 
- sensor:
  - default_entity_id: sensor.my_jam
    state: '{{ 1==1 }}'
    name: my_jam

Bad migration example 2: Incorrect indentation

Also, make sure your indentation is correct.

I.e. if you have:

template:
  - triggers:
      - trigger: state
        entity_id: sensor.foo
    sensor:
      - name: abc
        state: "{{ 'something' }}"

You’d line up the migrated template entity with your current indents.

Good merge

template:
  - triggers:
      - trigger: state
        entity_id: sensor.foo
    sensor:
      - name: abc
        state: "{{ 'something' }}"
# MIGRATED ENTITY 
  - sensor:
      - default_entity_id: sensor.my_jam
        state: '{{ 1==1 }}'
        name: my_jam

Bad merge

template:
  - triggers:
      - trigger: state
        entity_id: sensor.foo
    sensor:
      - name: abc
        state: "{{ 'something' }}"


# MIGRATED ENTITY 
- sensor:
  - default_entity_id: sensor.my_jam
    state: '{{ 1==1 }}'
    name: my_jam

62 Likes

14 repairs :frowning:

35 for me :angry:

I’m just using template.yaml. Didn’t saw any issues here.

1 Like

yes, those are modern templates.

4 Likes

Still on HAOS 2025.10.4, just starting playing around with templates. I have a couple of 3rd party mushroom card templates, not sure how/if they will be affected.

Moving forward & learning how to use templates, would you recommend using template.yaml since it uses modern templates? I’m pretty comfortable in yaml.

The deprecation only affects template entities, specifically the legacy yaml. It does not affect templates themselves.

Moving forward you’ll have to use the template: key because that is the only thing that will be supported.

4 Likes

As mentioned in my last post, just getting started with templates.This may be off-topic in this post, so if it’s deleted, I’ll understand. I can create a new topic.

But, just to clarify are you saying that you create all of you templates in templates.yaml?

Not even sure if I’m asking the question correctly lol, but I’m good a looking up what I need to know. Just trying to understand, looking for the best path forward as I explore using tempates.

Great summary and impressive detail in the repairs. :+1:

9 Likes

This is not required. You can just put all your YAML templates under template: in your configuration.yaml file. However if you would like to use a seperate file or multiple files then please have a read of this: Splitting up the configuration - Home Assistant

And when I say “all” this does not include

Those are a completely separate thing, frontend custom card templates.

The only templates you have to worry about are these:

1 Like

Rookie numbers :slight_smile:

I spent hours transferring all my template sensors over to the new format when it was released. Currently I have 116 sensors and 36 binary sensors. Some are new since then, other have been removed but it would have been in that ballpark.

Unfortunately template switches were not available at the time and I forgot all about them until now. I only had 5 to do.

3 Likes

I’m close. I have 141 total. TBH, I thought it was going to be way more than that.

My motto is always if it’s not broken don’t fix it. I guess now it’ll be broken so I have to fix it. :smile:

10 Likes

Not all of them, some are created using helpers and some are put in template.yaml. You can use separate file for that if you include this in configuration.yaml like this

template: !include template.yaml

You have to create that file and put your templates there. I use this because i find it easier to maintain.

2 Likes

Great comms in this. Thanks for your work…

2 Likes

You have a couple of typo’s copied over, but otherwise a very good explainer. Sometimes to move forward you need to make hard choices. Thanks for doing so in the most graceful way possible.

1 Like

Got a repair item about the custom template media_player integration. Don’t think that supports the modern syntax yet right?

1 Like
1 Like

You mean like this…?

And Petro has made the repair automatically include that for you in the generated template definition for each entity.

2 Likes

No, none of that is true. Read the post please

2 Likes