[SOLVED] Templates.yaml - Invalid config for [sensor]: required key not provided @ data['platform']

Hello,
For some time I have this message that appears when I run a configuration check:
Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 11). Please check the docs at Sensor - Home Assistant
Line 11 of my configuation.yaml file points to templates.yaml
I checked the content and I don’t see what could be the problem.
Do you have an idea ?

2023-07-28_14h44_37


Link to templates.yaml : https://justpaste.it/ami71

Thank you.

it’s actually pointing to the sensor file, the error even says invalid config for [sensor], so you should be looking at your sensor.yaml file for a dashed item that does not have platform: ...

Line numbers in your file start counting at 1. Line number indexes in error messages start counting at 0. So remember to add 1 to the line number the error message is pointing to.

Ok, so it actually points to the sensors.yaml file.
Here is its contents:

The very first line does not belong there (the command line integration). Delete it.

The commented out binary sensor does not belong there either.

Indeed, I switched the 1st command line in the configuration.yaml and everything seems OK now, thank you!

1 Like