-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Add template migration examples #42149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: current
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
There's something wrong with the syntax, because CI is failing and the deploy preview hasn’t been built |
|
I'll take a look |
|
Use the raw and endraw around your yaml examples. |
|
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? |
c0ffeeca7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I didn't merge it because I don't know if this is for this PR or for a new one #42149 (comment) |
zweckj
left a comment
There was a problem hiding this 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| sensor: | |
| # configuration.yaml | |
| sensor: |
| ``` | ||
| {% endraw %} | ||
|
|
||
| Make sure to keep all the other platforms in the sensor section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| sensor: | |
| # configuration.yaml | |
| sensor: |
| ``` | ||
| {% endraw %} | ||
|
|
||
| Make sure to keep all the other platforms in the sensor section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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: |
either is fine. If you guys are fine with my suggestions, we can merge this one and do it in a follow up |
frenck
left a comment
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note handling needed.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
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. |
Proposed change
Add template migration examples and guides to documentation.
Type of change
currentbranch).currentbranch).nextbranch).nextbranch).Additional information
Checklist
currentbranch.nextbranch.