Hi to all,
I’ve configured a sensor template to calculate the net consumption of the outlet line circuit, using the following code, but the sensors is “unavailable”
- platform: template
sensors:
outlet_net_energy:
unique_id: f48b4cd2-bc87-460b-9f57-f464250fe194
entity_id:
- sensor.power_meter_em1_total_active_energy
- sensor.lavatrice_energy
- sensor.frigo_energy
- sensor.forno_energy
value_template: >-
{% set outlet_total = states.sensor.power_meter_em1_total_active_energy.state|float %}
{% set forno = states.sensor.lavatrice_energy.state|float %}
{% set frigo = states.sensor.frigo_energy.state| float %}
{% set lavatrice = states.sensor.forno_energy.state| float %}
{{ (outlet_total - forno - frigo - lavatrice) }}
Can someone can help me to figure out what’s the problem?