That is another way to solve it.The problem with your template was that it is and old style template sensor definition. New style you should define the sensor under the top level template: and not sensor:
That is another way to solve it.The problem with your template was that it is and old style template sensor definition. New style you should define the sensor under the top level template: and not sensor: