SolarEdge integration - negative values of produced energy


I have configured Energy Tab in HA using SolarEdge integration and at beginning graph of produced energy from PV was looking fine… today (second day in a row) I see negative value of produced solar energy… (at beginning of day) here some screenshots:

For produced energy I’m using - “sensor.solaredge_lifetime_energy” entity where I have found today that strange gap:

Anyone have working workaround or fix for that situations?

I took a look at my history of sensor.solaredge_lifetime_energy and I can see gaps, likely because it went unavailable, but don’t see it going to zero, so indeed it is very strange to see this in your case.

Anyway, I don’t use the lifetime_energy sensor. I make use of sensor.solaredge_production_energy sensor so maybe give it a try. If it also goes to 0 any time other than midnight, then it may not work either.

For sensor.solaredge_production_energy I see even more gaps than for lifetime_energy but it’s not reporting 0 as lifetime_energy more something like ‘unavailable’ state ?

@wmaker Can u check if you also have gaps like that? I’m wondering if using sensor.solaredge_production_energy where ‘unavailable’ state is reported instead of 0 will fix my main issue of negative produced energy…

I do have gaps, usually at night. Using this sensor should fix your issue. If not, let me know, I have another suggestion.

@wmaker Changed to “sensor.solaredge_production_energy” but still sometimes I can see production as -0.01 kWh which looks weird…

any other ideas what can be wrong? :wink:

Very strange :frowning:
Anyway, I actually use a template sensor. I don’t know if it will help you as my template sensor is mostly trying to avoid unavailable situations (it also converts Wh to kWh). Here it is if you want to try it out:

  - sensor:
      - name: "SolarEdge Production Energy Template" #solaredge_production_energy_template:
       #state: '{{(states("sensor.solaredge_production_energy") | float / 1000) | round(3)}}'
        state: >-
          {% if is_number(states("sensor.solaredge_production_energy"))  %}
            {{(states("sensor.solaredge_production_energy") | float / 1000) | round(3)}}
          {%- else -%}
            {{ states("sensor.solaredge_production_energy") }}
          {%- endif %}
        unique_id: "solaredge_production_energy_template"
        unit_of_measurement: 'kWh'
        icon: mdi:solar-power
        device_class: 'energy'
        state_class: 'total_increasing'  

1 Like

Small negative values are normal around mornings and evenings. The solar system is trying to generate energy but has to little sun to produce enough to counter the energy use of the system itself. (the convertor and optimisers also need energy to work) So when the system knows there isn’t enough energy it shuts itself down. It depends maybe on the system how efficient this decision is.