Hello All!
I have 3 template sensors for calculating my energy consumption / solar production that are working aboslutely OK except when I reboot my HA when they spike. This causes the utility meters associated to also spike and mess everything up. What can I do?
This is what I have under sensor / platform template:
energy_consumed:
value_template: "{{ ((states('sensor.energy_consumed_phase_1') | float + states('sensor.energy_consumed_phase_2') | float + states('sensor.energy_consumed_phase_3') | float) /1000) | round(1) }}"
unit_of_measurement: "kWh"
device_class: power
energy_returned:
value_template: "{{ ((states('sensor.energy_returned_phase_1') | float + states('sensor.energy_returned_phase_1') | float + states('sensor.energy_returned_phase_1') | float) /1000) | round(1) }}"
unit_of_measurement: "kWh"
device_class: power
production_difference:
value_template: "{{ (states('sensor.energy_returned') | float - states('sensor.energy_consumed') | float) | round(1) }}"
unit_of_measurement: "kWh"
device_class: power
I tried to recreate one of those sensor in the “new way” and only trigger it every 5 minutes but it doesn’t seem to work:
template:
- trigger:
- platform: time_pattern
minutes: 5
sensor:
- name: energy_consumed_2
state: "{{ ((states('sensor.energy_consumed_phase_1') | float + states('sensor.energy_consumed_phase_2') | float + states('sensor.energy_consumed_phase_3') | float) /1000) | round(1) }}"
unit_of_measurement: "kWh"
device_class: power
What am I doing wrong? How can I solve this issue?
Thanks!