OpenDTU MQTT Data Spike at Solar Production Start

Hi all, I’ve connected an OpenDTU to my Home Assistant via MQTT. The data reporting is generally accurate, except for a spike that occurs at the start of solar production, which doesn’t correlate with actual solar output (as shown in the first image). The second image illustrates that OpenDTU retains this erroneous value and continues to transmit it throughout the night until solar production recommences, as evidenced in the history log of the OpenDTU-reported value. I’m at a loss on how to solve this…
Regards

I have exactly same problem! Can anyone help?

I guess that data come from the integration… I think would be better to ask in their Github Issue buard.

Did you find a way to fix this issue?

I am seeing open DTU readings in HA for the total output for the day randomly with the sensor.

So the sensor will increment every hour correctly most of the time and then randomly there would be a reading of the total output so far for the day, instead of the last hour. So the I get massive increases in energy production.

This is just using MQTT, so not sure how it can be fixed.

Edit: Looks like it’s anytime 0 kwh is recorded. I wonder if there is a way to show unavailable instead of 0 for the sensor.

I also could up the reporting interval from 5 seconds to 10 maybe that would prevent any issues if openDTU is offline or if it comes back online there is enough time for boot up. Not sure if that was why, because I have been power cycling open recently testing reception to the inverters.

It seems this is an issue of the OpenDTU.

Every morning, when the inverter starts, OpenDTU reports few wrong numbers (either “0” or “null”). This totally messes up Home assistant’s statistics. Once it gets a valid number, it adds the entire “Yield Total” as if it was consumed in that very moment.

Surpricingly, the HMS “Yield Total” (so the same thing beying reported directly from a particular inverter, not OpenDTU), does not have this problem.

I was trying to fix this issue by “cleaning” the data and saving it separately.

Something like:

- sensor:
    - name: "OpenDTU Cleaned Total Yield"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      state: >
        {% set val = states('sensor.opendtu_fxxxx0_yield_total') | float(0) %}
        {% if val > 0 %}
          {{ val }}
        {% else %}
          {{ this.state }}
        {% endif %}

It should work (removing all values not greater than 0), but using inverter-level data (e.g., HMS-2000-4T YieldTotal) seems to be easier.