How to create template sensor that has its own attributes

Have you checked the template documentation? attribute_templates is not a valid key. You define attributes under the attributes variable which should be on the same level as state (not indented beneath it).

The linked documentation includes examples of template attributes at the bottom of the page.

1 Like