Template error; Which template to look for template.py:

Hi all,
Suddenly I’m getting a template error

Logger: homeassistant.helpers.template
Source: helpers/template.py:1706
First occurred: 10:55:29 (6 occurrences)
Last logged: 11:06:17

Template variable warning: 'dict object' has no attribute 'Period' when rendering '{{ value_json["ENERGY"]["Period"] }}'

Since I have a lot of Pow sensors using this template, it is very difficult to find the one thats at fault
Is there a way to find the specific template 1706 somewhere. I have a docker implementation of Home assistant running on a Synology NAS

Not sure, but i think the ‘1706’ is the line number in template.py.
I assume one of your Pow sensors sends wrong or no data.

OK, and where to find template.py? May be I can get a hunch there which template is in error

That won’t help, your error is in a template. But more importantly, if it’s been working for a long time, then it’s your source that is now the problem. That error is telling you that it expects the word period inside ENERGY object. This is most likely coming from MQTT discovery, something that creates MQTT sensors and that sensor/device is now no longer outputting {"ENERGY":{"Period": 7}}. Looking at the python file is fruitless because that’s reads the code, and outputs the error.

So if you run any exterior xyz2MQTT addon or some other devices that use MQTT as the integration, look there.