When using self referencing in Template Sensors, the error log fills with self referencing errors:
For Example, a template sensor produces a list:
{{[solar_generation, grid_import, grid_export, battery_in, battery_out, grid_to_battery, battery_to_grid, solar_to_grid, solar_to_battery, solar_to_house, battery_to_house, grid_to_house, total_to_house]}}
Attributes are then set self referencing the template list:
solar_generation: >
{{(this.attributes.power_flow)[0]}}
grid_import: >
{{(this.attributes.power_flow)[1]}}
grid_export: >
{{(this.attributes.power_flow)[2]}}
battery_in: >
{{(this.attributes.power_flow)[3]}}
battery_out: >
{{(this.attributes.power_flow)[4]}}
grid_to_battery: >
{{(this.attributes.power_flow)[5]}}
battery_to_grid: >
{{(this.attributes.power_flow)[6]}}
solar_to_grid: >
{{(this.attributes.power_flow)[7]}}
solar_to_battery: >
{{(this.attributes.power_flow)[8]}}
solar_to_house: >
{{(this.attributes.power_flow)[9]}}
battery_to_house: >
{{(this.attributes.power_flow)[10]}}
grid_to_house: >
{{(this.attributes.power_flow)[11]}}
total_to_house: >
{{(this.attributes.power_flow)[12]}}
But the log is filled with errors:
The sensor and all the attributes work as expected.
Thank you.