Hi everyone… I know this topic has been covered in other threads. I’ve tried following the other threads and reading the HomeAssistant documentation, but I can’t seem to update this switch with the new expected syntax.
Would anyone be so kind as to help me?
If you update to the latest version, you will get a repair notice. Don’t worry, the old things will still work in the new version. They will keep working for six months. But the repair notice shows the exact yaml you need, together with some instructions. Those instructions have improved in the latest maintenance release. The safest way is to use that, because manual conversions tend to miss important stuff (or contain typos).
If you do insist on manual conversion, which is a great way to learn, at least compare it to the converted template in the repair notice to see if you missed anything.
If you tried and failed, check the top post of the below mentioned thread. It contains common mistakes and solutions. If that too does not help, reach out in the same thread and we will help you fix whatever error you get.
Where did you put the new yaml exactly? In configuration.yaml or some other file? The problem is not in the yaml but in where/how it was placed. What is the right way depends on what you already had in there.
Again, use the version from the repair, as you’ve seen manual conversions do contain mistakes.
ps. No need to hide the unique id with xxx - it is not secret. It does need to remain the same. If it was XXXX, keep it but use something more unique in the future.
The old one was below switch but it now belongs below template, so it can not remain in exactly the same place. If you already had a template: line then you must place it below that, and remove the template: line from the suggested yaml. That is because you can only have one template: line in the file. You also need to match the indenting of the new template and the existing ones. Indentation is important in yaml.