I was hoping something like the min_max integration had a sum feature, where you just provide it with a list of entities.
Is there a way to make the platform template a bit easier to read, i want to sum the value of about 20-30 entities, and having them all on a single line makes it more prone to mistakes. Are there any ways of formatting it for easier reading?
So sticking that in the the template sensor would return 60. Which is fine for a small number, but if i want to add up 20-30 sensors, then it could lead to typos/errors.
Ok, should have read whole sentences and not only the title…
You can count sensors by using {{states.sensor | count}}. This way gives you the sum of all sensors. The output can be filtered. You mentioned „individual sensors“. What sensors do you want to be counted?
I basically have a number of smart plugs that i’ve pulled out the power consumption. So i have sensor.smartplug1_watts, sensor.smartplug2_watts and so on.
I currently have a template sensor like in the OP where i just add the sensors together, but it’s a long list and if i need to edit/add to it then i’m more prone to making a typo.
I guess by the time i’ve filtered out {{states.sensor | count}} it’ll be of similar length to just defining them as per above.