The way sensors.yaml is typically configured, everything in the file is assigned a top level configuration key of sensor… then you use the platform property to designate the type of sensor you are setting up. The “modern” template sensor format requires a top level key of template. You may already have a template.yaml file in you config folder, otherwise you need to set one up following the guidelines in the link @pedolsky provided.
Thank you. I didn’t realise that “template :” is an top level section. After using your suggestion, it works!
I don’t think that YAML & I will be best friends one time , same with Jinja.
just use it for a bit and it makes sense and I think it’s WAY easier than the tedious “click, click, scroll, click…etc…ad nauseam” of the UI.
Jinja is not as easy because there is just so much you can do with it. Figuring out all the filters/methods is the hard part. And that’s why it’s almost a necessity to learn to be able to do the slick advanced stuff. But it’s not too bad either when you use it for a bit.
If you simply want all your sensors in one file you can also do this pretty easily with packages. Just make a package called sensors like this:
template:
# put all template sensors here
sensor:
# put all other sensors here
mqtt:
# put all Mqtt sensors here
# (just to show the pattern applies to anything, idk if you use Mqtt)
...