what should they look like in the new format?
The documents provided so far only show very simple templates
I have been unable so far to get these working in a new
template.yaml file
The repairs provide a configuration you can copy and paste for each template entity you have. Take a minute to read the deprecation thread to see where you need to place the new configuration and how you might need to modify it depending on how you have your config set up:
You have 6 months before you need to get this done and Petro is working on a more extensive migration guide. If, after reading the thread linked above, you are still unsure as to how to proceed, you may want to wait until the migration guide is available.
Where did you put this? If it is inside a file templates.yaml then you need to remove the top line with template: and reduce the indenting one step to match what is already there.
And modern template sensors have a state not a value_template; and no friendly_name.
If that’s genuinely your code as in the YAML rather than just re-pasted from above where the forum had already munged it, you also need to fix all the “smart” quotes.
If you’re struggling with YAML, use the UI template helpers instead. I used to be a staunch YAML user, eschewing the UI as a n00b tool, but I’ve started using it now for most things.
So I replaced all my binary sensors in binary_sensors.yaml file with the repairs copied from the corresponding legacy_template_depredated messages. Upon reboot I got the following error messages: Preformatted text
Logger: annotatedyaml.constructors
Source: util/yaml/loader.py:65
First occurred: 8:35:11 AM (7 occurrences)
Last logged: 8:35:11 AM
Logger: homeassistant.config
Source: config.py:939
First occurred: 8:35:10 AM (1 occurrence)
Last logged: 8:35:10 AM
Invalid config for ‘binary_sensor’ at configuration.yaml, line 205: required key ‘platform’ not provided, please check the docs at Binary sensor - Home Assistant Preformatted text So following the suggestion from Didgeridrew did not work. Presumably if I removed all the “template:” lines except for the first one of the errors would disappear but the templat integration would still fail to load.
That is where you go wrong. The new ones belong in templates.yaml if you have that. If you put them there, the template: line above the migrated suggestion must be removed. Also, when placing it in an existing templates.yaml, make sure the indenting matches the other template entities in there.