Invalid config for [template]: invalid template (TemplateSyntaxError: unexpected ')') for dictionary value @ data['sensor'][1]['state']. Got "{{ states('sensor.energy_year_fronius')|float / 1000) | round(0)}}". (See /config/configuration.yaml, line 345).
This is my yaml code
template:
- sensor:
- name: "Fronius Day Energy kWh"
unit_of_measurement: "kWh"
state: "{{ (states('sensor.energy_day_fronius')|float / 1000) | round(0)}}"
- name: "Fronius Yearly Energy kWh"
unit_of_measurement: "kWh"
state: "{{ (states('sensor.energy_year_fronius')|float / 1000) | round(0)}}"
- name: "Fronius Total Energy MWh"
unit_of_measurement: "MWh"
state: "{{ (states('sensor.energy_total_fronius')|float / 1000000) | round(0)}}"
template:
- sensor:
- name: "Fronius Day Energy kWh"
unit_of_measurement: "kWh"
state: "{{ (states('sensor.energy_day_fronius')|float / 1000) | round(0)}}"
- name: "Fronius Yearly Energy kWh"
unit_of_measurement: "kWh"
state: "{{ (states('sensor.energy_year_fronius')|float / 1000) | round(0)}}"
- name: "Fronius Total Energy MWh"
unit_of_measurement: "MWh"
state: "{{ (states('sensor.energy_total_fronius')|float / 1000000) | round(0)}}"
error message
Invalid config for [template]: invalid template (TemplateSyntaxError: unexpected ')') for dictionary value @ data['sensor'][1]['state']. Got "{{ states('sensor.energy_year_fronius')|float / 1000) | round(0)}}". (See /config/configuration.yaml, line 345).
Hey sorry, so i updated this based on the error, then i went and check config, no issues. I ahve tested in Deveoper Tools, No issues
I then did YAML configuration reloading just for Template Entities and then when it gives me an error
Logger: homeassistant.config
Source: config.py:454
First occurred: 08:52:31 (1 occurrences)
Last logged: 08:52:31
Invalid config for [template]: invalid template (TemplateSyntaxError: unexpected ')') for dictionary value @ data['sensor'][1]['state']. Got "{{ states('sensor.energy_year_fronius')|float / 1000) | round(0)}}". (See /config/configuration.yaml, line 345).