I have been trying to add a few template sensors. In the sample below the first sensor is available, the others not.
When I load the individual state templates in the tester, they all work fine.
Would anyone have an idea what I am missing?
template:
- sensor:
- name: "Total Electricity Consumption"
unique_id: total_electricity_consumption
state: >
{{ (states('sensor.energy_consumption_tarif_1') | float(0)) + (states('sensor.energy_consumption_tarif_2') | float(0)) }}
unit_of_measurement: "kWh"
- name: "Total Electricity Production"
unique_id: total_electicity_production
state: >
{{ (states('sensor.energy_production_tarif_1') | float(0)) + (states('sensor.energy_production_tarif_2') | float(0)) }}
unit_of_measurement: "kWh"
- name: "Electricity Consumption Today"
unique_id: daily_electricity_consumption
state: >
{{ (states('sensor.dsmr_daily_electricity_tarif_1') | float(0) + states('sensor.dsmr_daily_electricity_tarif_2') | float(0) ) | round(3) }}
unit_of_measurement: "kWh"
- name: "Electricity Production Today"
unique_id: daily_electicity_production
state: >
{{ (states('sensor.dsmr_daily_electricity_production_tarif_1') | float(0) - states('sensor.dsmr_daily_electricity_production_tarif_2') | float(0) ) | round(3) }}
unit_of_measurement: "kWh"