I’m running into the exact same issue.
With the _TOTAL number you can easily use the utility_meter to generate hourly/daily/weekly/monthly data. Now I have to use a template to sum _t1 and _t2 into entities and use those in the utility_meter config.
Would like to find out IF sensor.energy_consumption_total should be populated and why it is not.
@bbccdd I suspect the energy meter does not supply the wifi module with the total consumption, only with the total consumption per tariff. The fact that the integration does not calculatate any values that have not been supplied by the meter is would arguably out of scope.
My template sensor has an availability template to make the sensor jump to Unavailable reliably when the sensor is offline.
- platform: template
sensors:
dsmr_reading_electricity_consumed_total:
friendly_name: "DSMR All Tariff Grid Usage"
unit_of_measurement: "kWh"
device_class: energy
value_template: >
{% set tarif1 = states('sensor.energy_consumption_tarif_1') | float(0) %}
{% set tarif2 = states('sensor.energy_consumption_tarif_2') | float(0) %}
{{ tarif1 + tarif2 }}
availability_template: >
{% set tarif1 = states('sensor.energy_consumption_tarif_1') | float(-1) %}
{% set tarif2 = states('sensor.energy_consumption_tarif_2') | float(-1) %}
{{ [tarif1, tarif2] | min >= 0 }}
float in the availability section checks the states of two and returns -1 if either of them fails to be converted to a float (in other words, isn’t a number).The [tarif1, tarif2] | min > 0 line checks if the smallest number of either of the sensors is equal to or greater than 0. If they are it returns True and the sensor will be available. If not, one of the sensors has an issue and it will return False, letting the sensor jump to Unavailable.
The availability sensor is recommended since these numbers are going into your long term statistics. You don’t want any inaccurate calculations where one of the sensors is reporting correctly while the other one is being converted to 0 by float(0).
The unit_of_measurement: "kWh" and device_class: energy are necessary for long term statistics and to be able to include the template sensor into your energy dashboard.