I have compared with my Electricity provider smart meter data daily totals for usage and solar feedin, using the templates energy_import_daily and energy_export_daily.
It’s better than I expected, it’s about 1% different so that’s pretty good!, given there would also be Shelly measurement accuracy in play.
I presume it is faster as it doesn’t have to lookup the same sensors multiple times. Also reduces errors when entering yaml as it is simpler/ shorter as you don’t need to duplicate sensors entries.
But as with most things there are many ways to achieve the same outcome.
Use Energy Import Daily for Grid Consumption and Energy Export Daily for Returned to grid.
You need to supply your own daily solar generation data from your inverter for Solar Production.
i’m having trouble with getting the integrations up and running.
I copied the above sensor: section into my sensors.yaml (which is referenced in configuration.yaml) and the utility_meter: section directly into my configuration.yaml. I also changed the shelly 3em entities according to my config, of course.
Now while i’m seeing all the new entities successfully created, the energy_*_sum integrations are not updated - even though the “Power *” templates are showing the correct values.
Looks ok, does it work as expected?
I also have two solar inverters and I have a template that adds the two together so I can see my total solar generation.
# Template sensor for values of energy Solar generation (solar_power > 0)
power_solargen:
friendly_name: "Power Solar Generation"
unit_of_measurement: 'W'
value_template: >-
{% if (states('sensor.pv_power')|float(0) + states('sensor.pv_power_2')|float(0)) > 0 %}
{{ (states('sensor.pv_power')|float(0) + states('sensor.pv_power_2')|float(0)) }}
{% else %}
{{ 0 }}
{% endif %}