How to sum total produced of my Enphase solar inverters

I have 10 Enphase inverters and each of them shows the power produced in Watts.
I want to sum those values to get me the total value.
I tried using the Helper Combine sum option. This works but the sum value is not updated when each individual inverter changes it’s power output.

My question is, how can I get the sum produced? I am not a expert in templates or scripts, so I hope you can lead me how to do.

Thanks, Fred

Create a template that sums the value of all inverter power output sensors.
I’m not a template guru but I think you could add some check on availability of the source sensors to avoid that the sums became unavailable if a single inverter doesn’t report the output value

I have no idea how such a template should look like.
Hope someone can guide me how to get it to work.

A very simple way to sum these is to use a group helper with a sum value.

If you are using an Enphase IQ Gateway, then be aware the summed value is available as a value. The Enphase Envoy core integration and most custom integration have that entity.

If you want to implement as a template consider something like:

- sensor
  - name: "envoy inverters summed power"
    unique_id: envoy_inverters_summed_power
    unit_of_measurement: "W"
    icon: mdi:solar-panel
    state: >
      {{ (
        states('sensor.envoy_inverter_122219012345') | float(0)
        + states('sensor.envoy_inverter_122219012346') |float(0) 
        + states('sensor.envoy_inverter_122219012347') |float(0) 
      ) }}
    availability: >
      {{ has_value('sensor.envoy_inverter_122219012345') and
         has_value('sensor.envoy_inverter_122219012346') and
         has_value('sensor.envoy_inverter_122219012347') }}

I tried the group helper and it basically calculates the sum but the data update interval is slow and not real-time when output power of the inverters changes. A calculation interval of 10 seconds is acceptable for me but I see no option to tweak this timing.
Have no idea a template produce a real-time summed rresult.
When using a template, is the code stored in the template.yaml file?

On the topic of real time updates, typically an individual Enphase inverter updates once every 5 minutes to the Envoy. And often not all inverters at the same moment in that 5 minutes. If you inspect the data of an inverter, that’s probably what you will find.

Then there’s the data collection interval, depending on your integration and settings. Can only speak for the core integration, by default it collects once a minute, so that’s the moment the data comes in and may trigger the group.

Your setting and configuration may be different of course, just describing the default setup and some items to consider.

The template can be in configuration.yaml or in a separate file like templates.yaml. I have the latter with

template: !include templates.yaml

in configuration.yaml and above example in the templates.yaml file.

If you want frequent calculations you can use a trigger with time_pattern template. The above example to trigger every 10 seconds would look like

- trigger
  - platform: time_pattern
    seconds: "/10"
  sensor
  - name: "envoy inverters summed power"
    unique_id: envoy_inverters_summed_power
    unit_of_measurement: "W"
    icon: mdi:solar-panel
    state: >
      {{ (
        states('sensor.envoy_inverter_122219012345') | float(0)
        + states('sensor.envoy_inverter_122219012346') |float(0) 
        + states('sensor.envoy_inverter_122219012347') |float(0) 
      ) }}
    availability: >
      {{ has_value('sensor.envoy_inverter_122219012345') and
         has_value('sensor.envoy_inverter_122219012346') and
         has_value('sensor.envoy_inverter_122219012347') }}

Depending on the integration you run, see if some entity like

sensor.envoy_-some-serial-no_current_power_production

exists. In multiple integrations this is summed power of all inverters.

Thanks for your helpful information!