Hi,
I’ve very frustrating issue (or it’s lack of my knowledge) - I can’t calculate total value from three sensors (3 phases). I need to calculate total imported power as one value. I tried to use template as below:
- sensor:
- name: Total energy import
unit_of_measurement: "kWh"
device_class: energy
state: >
{% set state = (
(states('sensor.sdm630_energy_total_0') | float(0)) +
(states('sensor.sdm630_energy_total_1') | float(0)) +
(states('sensor.sdm630_energy_total_2_2') | float(0))
)
%}
But the result of calculation is still 0 (zero):
Of course, particular variables for phases are available and visible:
type: vertical-stack
cards:
- type: entities
entities:
- entity: sensor.sdm630_energy_total_0
- entity: sensor.sdm630_energy_total_1
- entity: sensor.sdm630_energy_total_2_2
- entity: sensor.total_energy_import
title: Imported Energy
state_color: false
show_header_toggle: true
Where the problem is? I used similar method in older HA version using value_template directive but in new HA this is not usable…
I’m using Home Assistant Core 2023.1.7, Frontend 20230110.0 - latest
Best Regards,
pancio