Deprecation of legacy template entities in 2025.12

It’s a first time I used this Action and this is what I got

indenting is off now, entity id should be indented more, like in your cover. Same as what Petro showed here:

And of course you’d want to try open and close rather than stop.


I edited the template sensor as suggested but got this error complaining about missing “platform” while the instruction told me to take that out. So what is this?

It was a wrong code maping
Yes, it’s responding to actions OPEN, CLOSE and STOP

This usually means you put the new version in the old place, under sensors. It should be under templates. If you have a templates.yaml file already the new yaml should be placed there, but with the top template: line removed and the indenting mattching what is already there.

1 Like

The new configurations do not go in the sensor.yaml or binary_sensor.yaml files

They need to be placed in configuration.yaml or a properly split file under the template integration.

1 Like

I do have 6 months to correct my 197 templates, right?

Then there is absolutely no reason why the same actions would not work in the template cover. I too have about a dozen of these template covers.

Thanks!

Once I got the indenting right, I found the suggestion(s) for the repair to work pretty well.

All done! Thanks again!

2 Likes

Wait. The only thing that may be it: remove the - before target. It looks like the docs suggest you can only have one action, not a list.

:man_shrugging:
IDK, but this is what I am dealing with now

Did you see my latest “wait” post?

No, it allows a list or a single. Docs be wrong

Ahh yes, further doc examples show multiple actions.

Yes

What’s the proper way to split things into subfiles under the template: grouping?

I tried to do just !include switch_templates.yaml but that errors out. I believe you’re expected to do it like somekey: !include filename.yaml but then that breaks the structure where all the child templates should be directly under template:

The best option by far is to put them all into a single templates folder, which resides in your config folder.

Then use this in configuration.yaml:

# configuration.yaml
template: !include_dir_merge_list templates

Then make files inside the template folder with any name and the .yaml file extension.

Then inside the file, add your configurations from the repair but omit the template: line.

Sorry, Yes I did

- cover:
  - open_cover:
     target:
        entity_id:
        - cover.shades_curtain
     action: cover.close_cover
    close_cover:
     target:
        entity_id:
        - cover.shades_curtain
     action: cover.open_cover
    stop_cover:
     target:
        entity_id:
        - cover.shades_curtain
     action: cover.stop_cover
    default_entity_id: cover.shades_curtain
    icon: |-
      {% set s = states('cover.shades_curtain') %} 
      {% if s == 'open' %}
         mdi:curtains-closed
      {% else %}
         mdi:curtains
      {% endif %}
    name: Shades Reversed
    unique_id: c0223bcb-32c6-430e-a2c1-3545f8031796
    state: |-
      {% set s = states('cover.shades_curtain') %} 
      {% if s == 'open' %}
        closed
      {% elif s == 'closed' %}
        open
      {% elif s == 'opening' %}
        closing
      {% elif s == 'closing' %}
        opening
      {% else %}
        unknown
      {% endif %}

No changes

I finally see the error. The template is trying to operate itself. The default entity id for your reversed cover is the same cover as the one you are trying to reverse.

You probably meant:

default_entity_id: cover.shades_revesed
1 Like

Sorry, it’s not

    stop_cover:
    - target:
        entity_id:
        - cover.shades_curtain
      action: cover.stop_cover
    default_entity_id: cover.shades_reversed

I was playing with code and try to edit entity, but in wrong place.
Still nothing

- cover:
  - open_cover:
     target:
        entity_id:
        - cover.shades_curtain
     action: cover.close_cover
    close_cover:
     target:
        entity_id:
        - cover.shades_curtain
     action: cover.open_cover
    stop_cover:
     target:
        entity_id:
        - cover.shades_curtain
     action: cover.stop_cover
    default_entity_id: cover.shades_reversed
    icon: |-
      {% set s = states('cover.shades_curtain') %} 
      {% if s == 'open' %}
         mdi:curtains-closed
      {% else %}
         mdi:curtains
      {% endif %}
    name: Shades Reversed
    unique_id: c0223bcb-32c6-430e-a2c1-3545f8031796
    state: |-
      {% set s = states('cover.shades_curtain') %} 
      {% if s == 'open' %}
        closed
      {% elif s == 'closed' %}
        open
      {% elif s == 'opening' %}
        closing
      {% elif s == 'closing' %}
        opening
      {% else %}
        unknown
      {% endif %}