djansen1987 / SAJeSolar

SAJ eSolar Portal Sensors
GNU General Public License v3.0
21 stars 13 forks source link

Incorrect Reporting of totalGridPower and totalLoadPower in SAJ eSolar Integration #81

Open LowKey88 opened 3 months ago

LowKey88 commented 3 months ago

While debugging the SAJ eSolar custom component, I noticed that the totalGridPower and totalLoadPower metrics are consistently reported as 0.0, which seems incorrect. This issue occurs in the context of fetching data for my solar energy system.

Upon closer inspection through the web interface (via Inspect Element), the actual values for these metrics are shown correctly (e.g., totalGridPower: 2507.0, totalLoadPower: 2507.0 on 2024-03-24 01:40:00). It appears that the integration may not be parsing or handling the data correctly from the API response.

Debug logs show the following for these metrics:

2024-03-24 01:46:05.657 DEBUG (MainThread) [custom_components.saj_esolar.sensor] Device: totalGridPower State: 0.0
2024-03-24 01:46:05.657 DEBUG (MainThread) [custom_components.saj_esolar.sensor] Device: totalLoadPower State: 0.0

However, the API response clearly provides non-zero values:

"totalGridPower": 2507.0,
"totalLoadPower": 2507.0,
...

After upgrading my inverter from the R5 series to the R6 series (R6-20K-T2-32), I continued using the same SAJ Sec Module (M5370G2025XXXXXX). It's possible that this hardware change might be influencing how data is reported or interpreted by the integration, leading to the observed discrepancies in totalGridPower and totalLoadPower metrics.

Including this information will help developers to better understand the potential impact of hardware changes on the integration's functionality.

djansen1987 commented 2 months ago

In the debug log in HA also the complete json is printed. Do you see the values in the json or are they also 0.0 there. If so, it could be that they have changed their api. Could you also provide the API url where you have found the corrent information?