Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misalignement of sensor values between python library and home assistant integration #332

Open
KenleyC opened this issue Nov 26, 2024 · 4 comments

Comments

@KenleyC
Copy link

KenleyC commented Nov 26, 2024

I have a GW5000-DNS-30 with a GM1000 smart meter. Running included Goodwe integration, I don't get any information about the consumption (or sale) of energy from the grid. So have installed v0.9.9.27 of this experimental version via HACS.

Home Assistant Core Version: 2024.8.2

I get the following sensor values when using the standalone goodwe python library:

No model name sent from the inverter.
Identified inverter:
        Model:    None
        SerialNr: 55XXXXXXXXXXXXX
        Firmware: 0.0.06

Sensors values:
        timestamp                     : Timestamp = 2024-11-27 10:00:43 
        vpv1                          : PV1 Voltage = 336.7 V
        ipv1                          : PV1 Current = 5.3 A
        ppv1                          : PV1 Power = 1785 W
        vpv2                          : PV2 Voltage = 173.3 V
        ipv2                          : PV2 Current = 5.7 A
        ppv2                          : PV2 Power = 988 W
        ppv                           : PV Power = 2773 W
        vline1                        : On-grid L1-L2 Voltage = 0 V
        vline2                        : On-grid L2-L3 Voltage = 0 V
        vline3                        : On-grid L3-L1 Voltage = 0 V
        vgrid1                        : On-grid L1 Voltage = 236.4 V
        vgrid2                        : On-grid L2 Voltage = 0 V
        vgrid3                        : On-grid L3 Voltage = 0 V
        igrid1                        : On-grid L1 Current = 11.5 A
        igrid2                        : On-grid L2 Current = 0 A
        igrid3                        : On-grid L3 Current = 0 A
        fgrid1                        : On-grid L1 Frequency = 49.9 Hz
        fgrid2                        : On-grid L2 Frequency = -0.01 Hz
        fgrid3                        : On-grid L3 Frequency = -0.01 Hz
        pgrid1                        : On-grid L1 Power = 2719 W
        pgrid2                        : On-grid L2 Power = 0 W
        pgrid3                        : On-grid L3 Power = 0 W
        total_inverter_power          : Total Power = 2643 W
        work_mode                     : Work Mode code = 1 
        work_mode_label               : Work Mode = Normal 
        error_codes                   : Error Codes = 0 
        warning_code                  : Warning code = 0 
        apparent_power                : Apparent Power = 2669 VA
        reactive_power                : Reactive Power = -412 var
        power_factor                  : Power Factor = 0.987 
        temperature                   : Inverter Temperature = 52.1 C
        e_day                         : Today's PV Generation = 3.9 kWh
        e_total                       : Total PV Generation = 14.2 kWh
        h_total                       : Hours Total = 9 h
        safety_country                : Safety Country code = XX 
        safety_country_label          : Safety Country = XXXXXXXX
        funbit                        : FunBit = 0 
        vbus                          : Bus Voltage = 372.2 V
        vnbus                         : NBus Voltage = 0 V
        derating_mode                 : Derating Mode code = 0 
        derating_mode_label           : Derating Mode =  
        active_power                  : Active Power = 1847 W

active_power accurately represents the net buy/sell of my home and aligns with the data in the SEMS platform.

However, in Home Assistant active_power seems to reflect total_inverter_power or ppv. I suspect this has something to do with lack of model name. Appears that Home Assistant treats this as a DT family inverter, so might be to do with how the returned information from the inverter is mapped & calculated into sensor values.

2024-11-26 20:54:40.327 DEBUG (MainThread) [goodwe] Connecting to DT family inverter at 192.168.1.43:8899.
2024-11-26 20:54:40.327 DEBUG (MainThread) [goodwe.protocol] Creating lock instance for current event loop.
2024-11-26 20:54:40.330 DEBUG (MainThread) [goodwe.protocol] Sending: READ 40 registers from 30001 (7f03753100280409)
2024-11-26 20:54:40.380 DEBUG (MainThread) [goodwe.protocol] Received: aa557f035000000000000135353030304453433234364c32373538ffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000061b6a0034000800001dc1
2024-11-26 20:54:40.380 DEBUG (MainThread) [goodwe] Connected to inverter None, S/N:55000DSC246L2758.
2024-11-26 20:54:40.381 DEBUG (MainThread) [goodwe.protocol] Sending: READ 73 registers from 30100 (7f0375940049d5c2)
2024-11-26 20:54:40.416 DEBUG (MainThread) [goodwe.protocol] Received: aa557f0392180b1a143627000000000000000000000000ffffffffffffffffffffffffffffffffffff093cffffffff0000ffffffff138effffffff0000000000000000000000000000000000000000000000060000ffff0131012e000000400000006700000005002cffffffffffffffffffffffffffffffffffffffffffffffff000000fdffffffffffff012e1379157c0000ffff00640db5
2024-11-26 20:54:40.418 DEBUG (MainThread) [custom_components.goodwe.coordinator] Finished fetching GoodWe data in 0.037 seconds (success: True)

@KonnectSalon
Copy link

KonnectSalon commented Nov 30, 2024

I can confirm the above is a problem and would be nice to have this fixed.

I ended up using Modbus to resolve this on my end

Replace xxx.xxx.xxx.xxx with the IP address and add to your configuration.yaml

modbus:
  - name: modbus_hub
    type: tcp
    host: xxx.xxx.xxx.xxx
    port: 502
    sensors:
      - name: grid_meter
        address: 30195
        scan_interval: 5
        unit_of_measurement: Wh
        device_class: energy
        state_class: measurement

@KonnectSalon
Copy link

No model name sent from the inverter.
Identified inverter:
Model: None
SerialNr: 55XXXXXXXXXXXXX
Firmware: 0.0.06

Just a helpful FYI that may help you in the future - Contact goodwe for the latest firmware as you seem to be one version behind

@KenleyC
Copy link
Author

KenleyC commented Dec 2, 2024

I can confirm the above is a problem and would be nice to have this fixed.

I ended up using Modbus to resolve this on my end

Replace xxx.xxx.xxx.xxx with the IP address and add to your configuration.yaml

modbus:
  - name: modbus_hub
    type: tcp
    host: xxx.xxx.xxx.xxx
    port: 502
    sensors:
      - name: grid_meter
        address: 30195
        scan_interval: 5
        unit_of_measurement: Wh
        device_class: energy
        state_class: measurement

Thanks for that! I'm able to read the data as expected. I'll get in touch with Goodwe to update my inverter firmware as well.

@KenleyC KenleyC closed this as completed Dec 2, 2024
@KenleyC KenleyC reopened this Dec 2, 2024
@KonnectSalon
Copy link

Thanks for that! I'm able to read the data as expected. I'll get in touch with Goodwe to update my inverter firmware as well.

Amazing... so many hours spent on this... Glad it was helpful to someone else :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants