Skip to content

Conversation

@Petro31
Copy link
Contributor

@Petro31 Petro31 commented Dec 4, 2025

Proposed change

Add template migration examples and guides to documentation.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

@Petro31 Petro31 requested a review from a team as a code owner December 4, 2025 18:11
@home-assistant home-assistant bot added the current This PR goes into the current branch label Dec 4, 2025
@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 9ae7d4e
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/6932d85ec5d64e000856fb93
😎 Deploy Preview https://deploy-preview-42149--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zweckj
Copy link
Member

zweckj commented Dec 4, 2025

There's something wrong with the syntax, because CI is failing and the deploy preview hasn’t been built

@Petro31
Copy link
Contributor Author

Petro31 commented Dec 4, 2025

I'll take a look

silamon
silamon previously approved these changes Dec 5, 2025
@silamon
Copy link
Contributor

silamon commented Dec 5, 2025

Use the raw and endraw around your yaml examples.

@zweckj
Copy link
Member

zweckj commented Dec 5, 2025

Does it make sense to add a block about file inclusions and splitting them in the new structure/folder structure (similar to what you wrote in the forums?

Copy link
Contributor

@c0ffeeca7 c0ffeeca7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! Thank you, @Petro31, @zweckj, and @silamon 👍

c0ffeeca7
c0ffeeca7 previously approved these changes Dec 5, 2025
@c0ffeeca7
Copy link
Contributor

I didn't merge it because I don't know if this is for this PR or for a new one #42149 (comment)

Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding some comments so it's a bit more clear which file is which

Make sure to keep all the other platforms in the sensor section.

```yaml
sensor:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sensor:
# configuration.yaml
sensor:

```
{% endraw %}

Make sure to keep all the other platforms in the sensor section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Make sure to keep all the other platforms in the sensor section.
Make sure to keep all the other platforms in the sensor section. Your `configuration.yaml` file would look like this after the change:


{% raw %}
```yaml
sensor:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sensor:
# configuration.yaml
sensor:

```
{% endraw %}

Make sure to keep all the other platforms in the sensor section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Make sure to keep all the other platforms in the sensor section.
Make sure to keep all the other platforms in the sensor section. Your `configuration.yaml` file would look like this after the change:

```

{% endraw %}
Make sure to keep all the other platforms in the sensor file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Make sure to keep all the other platforms in the sensor file.
Make sure to keep all the other platforms in the sensor file. Your `sensors.yaml` file would look like this after the change:

@zweckj
Copy link
Member

zweckj commented Dec 5, 2025

I didn't merge it because I don't know if this is for this PR or for a new one #42149 (comment)

either is fine. If you guys are fine with my suggestions, we can merge this one and do it in a follow up

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some patters to look at. Let's make sure it is a clear step by step process.

Some of my comments can be applied on more places, let's ensure that comments are applied consistently.

../Frenck

                       

Blogging my personal ramblings at frenck.dev


## Legacy template deprecation migration guide

Legacy template entities are deprecated and will be removed in Home Assistant 2026.6.0. The deprecated template entities will produce a repair that guides you through the migration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Legacy template entities are deprecated and will be removed in Home Assistant 2026.6.0. The deprecated template entities will produce a repair that guides you through the migration.
Legacy template entities are deprecated and will be removed in Home Assistant 2026.6.0. The deprecated template entities will produce a repair that guides you through the migration.


This example covers how to migrate a legacy template sensor into modern syntax.

Take the example configuration.yaml file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Take the example configuration.yaml file
Take the example `configuration.yaml` file


1. Remove the `sensor` template definition from the `configuration.yaml` `sensor:` section.

Delete the following yaml from configuration.yaml file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Delete the following yaml from configuration.yaml file.
Delete the following YAML from the `configuration.yaml` file.


2. Add the modern syntax provided by the repair.

The repair would provide the following yaml.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The repair would provide the following yaml.
The repair would provide the following YAML.

```
{% endraw %}

This yaml should be added to the `template:` section inside configuration.yaml.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This yaml should be added to the `template:` section inside configuration.yaml.
This YAML should be added to the `template:` section inside `configuration.yaml`.


1. Remove the `sensor` template definition from the `configuration.yaml` `sensor:` section.

Delete the following yaml from configuration.yaml file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Delete the following yaml from configuration.yaml file.
Delete the following YAML from the `configuration.yaml` file.


**Note**: In this example, configuration.yaml already had a `template:` section. When copying the yaml, make sure to avoid adding double `template:` sections.

3. Restart Home Assistant or reload template entities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's explain how to do that.

```
{% endraw %}

**Note**: In this example, configuration.yaml already had a `template:` section. When copying the yaml, make sure to avoid adding double `template:` sections.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note handling needed.

@home-assistant home-assistant bot marked this pull request as draft December 5, 2025 09:22
@home-assistant
Copy link

home-assistant bot commented Dec 5, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@zweckj
Copy link
Member

zweckj commented Dec 5, 2025

For the notes to work properly you might need to change indent. Not 100% sure about this though

@Petro31 Petro31 marked this pull request as ready for review December 5, 2025 12:47
@home-assistant home-assistant bot requested a review from frenck December 5, 2025 12:47
@Petro31
Copy link
Contributor Author

Petro31 commented Dec 5, 2025

For the notes to work properly you might need to change indent. Not 100% sure about this though

I ended up removing the notes because they always broke numbering system, indented or not. They are now just part of the steps as a regular sentence.

The preview looks good too and it makes sense as a non-note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

current This PR goes into the current branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants