File editor show that it’s all OK.
validation check say NOT ok
I did mess up somting … don’t know what
Because it is a template sensor. In configuration.yaml you have
template: !include template.yaml. Create the sensor correctly there.
The green checkmark on the editor only means that the YAML format structure is good. The editor has a built-in LINT tool that checks for syntax errors. It is very good about catching YAML formatting mistakes.
The editor doesn’t know anything about the functions internal to Home Assistant. The validation in the Home Assistant parser does. So if you leave something out that a component requires, the editor doesn’t know that, but the parser in Home Assistant does.