That is not a Template sensor, it is a Riemann Sum Integral sensor, but you’re missing the platform information. Like many other sensors, Riemann sum sensors cannot be configured under the “template” top-level key, it should be configured under “sensor”.