This step is optional and may not apply to you
If your overnight production is usually 0, You can skip this step and use sensor.envoy_SERIALNUMBER_lifetime_energy_production for solar production
the production lifetime sensor is the ONLY enphase sensor that work with energy dashboard by default as this number only increases in value and will never reduce in value much like a car odometer
The next thing i wanted to address and fix was the overnight production that seems to be common with Enphase Envoy.
In my case, i was seeing a steady 4W of production even when the sun was down which just defies logic.
This is the explanation given at https://community.enphase.com/s/question/0D52G00004Z9tYC/why-does-the-array-production-still-show-power-produced-on-each-panel-at-night-time-the-energy-tab-seems-to-work-ok
Naturally your system is not producing at night. The appearance of night time production is a result of what we call backfill. When the Envoy and the microinverters cannot talk for extended periods of time the microinverters try to hold a basic record of “I produced x much power from x date to x date”. When they can finally talk it tells the Envoy this and the system averages it over that period of time. This gives the appearance of production during the night but it is not really producing during the night. Without the communication between microinverter and Envoy you lose all the data that is collected in real time with things like temperature, AC voltage, DC voltage, and a host of other data including the proper production numbers for each interval.
Here is what I did to fix it in my configuration.yaml file.
- sensor:
name: Solar Power Corrected
state_class: measurement
icon: mdi:solar-panel
unit_of_measurement: W
device_class: power
state: >
{% set value = states('sensor.envoy_SERIALNUMBER_current_power_production') | int %}
{% if value <= 4 -%}
0
{% elif is_state('sun.sun','below_horizon') %}
0
{%- else -%}
{{ value }}
{%- endif %}
What does this do?
This replaces any values less than or equal to 4 with a 0 which I am fine with.
The next thing I had to do to get the engery dashboard to be able to select this is add the following non-template sensor.
- platform: integration
name: Solar Energy Corrected
source: sensor.solar_power_corrected
unit_prefix: k
unit_time: h
method: left
What does this do?
It takes the live immediate Power figure and converts it to an Energy over time figure so that the energy dashboard can use it.
Here is a screenshot showing all 3 Energy sensors I created in use.