suaveolent / hoymiles-wifi

Library to communicate with Hoymiles DTUs and HMS-XXXXW-2T microinverters via protobuf.
MIT License
54 stars 11 forks source link

Wrong or missing consumption data? 🤔 #41

Open sergiou87 opened 1 week ago

sergiou87 commented 1 week ago

Not sure if I'm missing something here, but the info about my meter provided by the S-Miles Enduser app doesn't match the output of hoymiles-wifi:

App vs ha-hoymiles-wifi: Image

hoymiles-wifi output:

$ hoymiles-wifi --host 192.168.0.19 get-real-data-new --as-json
{
  "deviceSerialNumber": "******",
  "timestamp": 1732109181,
  "activePower": 4,
  "firmwareVersion": 1,
  "meterData": [
    {
      "deviceType": 1,
      "serialNumber": "******",
      "phaseTotalPower": 261,
      "phaseAPower": 261,
      "powerFactorTotal": 983,
      "energyTotalPower": 1959,
      "energyPhaseA": 1959,
      "energyTotalConsumed": 1972,
      "energyPhaseAConsumed": 1972,
      "faultCode": 1,
      "voltagePhaseA": 23170,
      "currentPhaseA": 1149,
      "powerFactorPhaseA": 983
    }
  ],
...
suaveolent commented 1 week ago

Can you update to main branch? There are some conversion erros in the 0.3.2 release, since I don't have a meter and had to guess the units. main branch (or next release) should adresses it.

sergiou87 commented 1 week ago

If I had to guess, I'd say things got worse:

Image Image

  "meterData": [
    {
      "deviceType": 1,
      "serialNumber": "*****",
      "phaseTotalPower": 72,
      "phaseAPower": 72,
      "powerFactorTotal": 846,
      "energyTotalPower": 2200,
      "energyPhaseA": 2200,
      "energyTotalConsumed": 1972,
      "energyPhaseAConsumed": 1972,
      "faultCode": 1,
      "voltagePhaseA": 22980,
      "currentPhaseA": 385,
      "powerFactorPhaseA": 846
    }
  ],
suaveolent commented 1 week ago

Huh. That's weird. Is there anything in the logs? Seems like the data cannot be read any more from the meter.

sergiou87 commented 1 week ago

The only error I found in logs is:

2024-11-21 00:40:44.893 ERROR (MainThread) [homeassistant.components.number] Platform hoymiles_wifi does not generate unique IDs. ID hoymiles_01JD51YA72BP8G7Q41EWD4XJQ9_limit_power_mypower already exists - ignoring number.inverter_power_limit

But looking at the data presented in Home Assistant, it seems to be able to get the data, right? Since some of those numbers come from meter_data.

Right now I'm not at home but I can dig a bit more when I'm back. I'm still curious about how can I get the current consumption from the meter_data struct, since I don't see any number that is similar to what S-Miles Enduser presents 🤔

suaveolent commented 1 week ago

I thinks the consumption is calculated via inverter power and meter power. No direct value from meter.