This means that everything inside the sensors.yaml file is part of the Template integration.
template: !include sensors.yaml
The Statistics integration is not part of the Template integration so that’s why it complained when you put the configuration for a Statistics sensor into the configuration for Template entities.
Look in your configuration.yaml file for a sensor: key. It may also have an !include statement redirecting it to a file. That’s where you should put the configuration for the Statistics sensor.
I do not have the sensor key inside the configuration.yaml file, the only one I have is inside the template integration.
Can I add another sensor: key in configuration.yaml even if I already have it inside template?
Thank you!
However, you are already using the sensors.yaml file for the Template integration.
template: !include sensors.yaml
So you will need to create and use a different file name. For example:
sensor: !include other_sensors.yaml
Or you can rename the file you’re currently using for the Template integration, like template_sensors.yaml, and use sensors.yaml for all other types of sensor integrations. It’s your choice.
Packages is great if you want to be able to configure entities from multiple integrations in the same file, bundling entities in the way that makes sense to you and your needs.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.