Enphase Errors

Any ideas why this happens whenever the enphase gateway is restarted or the integration is reloaded? It really messes up the metrics and graphs.

I’ve seen this happening a few times as well - something like once every 3-6 weeks - but haven’t found a solution yet.

The graph, e.g. for the ‘energy_production_today’, then looks like this:

I tried to correct it by deleting the values from the Outliers from the Developer Tools - Statistics option for both entities, but it doesn’t seem to work reliably.

Sorry, got no solution for you - but saying: you’re not alone :frowning_face:

It is because the sensor goes to 0 instead of unavailable. Do you use some template sensor in the dashboard, or is it straight from the integration. For the latter, file a bug in Github for the integration? For the first, post your template.

The sensor should be at 0 because my daily production doesn’t start until 7AM-ish - it’s the 14,956.3kWh at 1AM that’s out of line :hushed:

It is called “today” so I’d expect it to reset at midnight and increase during the day. And then suddenly produce 4000kWh at 1:40 at night? The production will count the whole 4000kWh at that moment.

Before that, at 1:25, it suddenly went from 0 to 10000kWh produced in an instant. every jump from 0 to a high value is production counted at that time. So that is another 10000 production counted right there.

It should either drop to 0 and gradually increase, or come back at a same or higher value after unavailability. The increase should reflect whe production of the missing period. So 10.000 gointg to 0 and then slowly counting up to lets say 50 is fine. Or 10.000 and then then unavailable, and then 10.050 is also fine. That would be 50 produced during unavailability. But a 0 value in between that means 10.050 extra.

Straight from the integration.

It resets to 0 every day. But when the system reconnects to the gateway it reads all production and consumption since the system went live 4 years ago. Thats why it is 40+ mwh.

That would warrant a bug report. Do you have a total production counters too? If that works ok it is easy to create a proper dayly counter. And you can put it straight into the energy dashboard.

Yes it does. It has a a lot of sensors available to it.


You can use a Utility meter if you want to calculate daily/weekly/monthly values, but you can feed the total straight into the dashboard. If you want kWh instead of MWh you can use a template sensor to multiply it by 1000. But if you do make a template sensor, make sure to do it in yaml and not through the GUI, because you need to set an availability template to make sure it does not go to 0 and you’ll need to set a state class and device class. You’d need something like this in template.yaml:

- sensor:
    - name: "Energy Production"
      unique_id: sensor.energy_production
      availability: "{{ is_number(states('sensor.envoy_production')) }}"
      state_class: total_increasing
      device_class: energy
      unit_of_measurement: kWh
      state: "{{ states('sensor.envoy_production') | float(0) * 1000 }}"

This is a know issue with Enphase, today’s (and last 7 days) values may show unexpected 0 or spikes, or reset to zero upto 15 min after midnight. Recommendation is to use the lifetime value with an utility meter as @Edwin_D already shared.