GithubHelp home page GithubHelp logo

goodwe's Introduction

GoodWe

PyPi Python Versions Build Status License

Library for connecting to GoodWe inverter over local network and retrieving runtime sensor values and configuration parameters.

It has been reported to work with GoodWe ET, EH, BT, BH, ES, EM, BP, DT, MS, D-NS, and XS families of inverters. It should work with other inverters as well, as long as they listen on UDP port 8899 and respond to one of supported communication protocols. In general, if you can connect to your inverter with the official mobile app (SolarGo/PvMaster) over Wi-Fi (not bluetooth), this library should work.

(If you can't communicate with the inverter despite your model is listed above, it is possible you have old ARM firmware version. You should ask manufacturer support to upgrade your ARM firmware (not just inverter firmware) to be able to communicate with the inverter via UDP.)

White-label (GoodWe manufactured) inverters may work as well, e.g. General Electric GEP (PSB, PSC) and GEH models are know to work properly.

Since v0.4.x the library also supports standard Modbus/TCP over port 502. This protocol is supported by the V2.0 version of LAN+WiFi communication dongle (model WLA0000-01-00P).

Usage

  1. Install this package pip install goodwe
  2. Write down your GoodWe inverter's IP address (or invoke goodwe.search_inverters())
  3. Connect to inverter and read all runtime data, example below
import asyncio
import goodwe


async def get_runtime_data():
    ip_address = '192.168.1.14'

    inverter = await goodwe.connect(ip_address)
    runtime_data = await inverter.read_runtime_data()

    for sensor in inverter.sensors():
        if sensor.id_ in runtime_data:
            print(f"{sensor.id_}: \t\t {sensor.name} = {runtime_data[sensor.id_]} {sensor.unit}")


asyncio.run(get_runtime_data())

References and useful links

goodwe's People

Contributors

adamb314 avatar adrivillab avatar boogiebart avatar jachym avatar janceuleers avatar kukulich avatar lyricnz avatar marcelblijleven avatar markif avatar mfaust78 avatar mletenay avatar onkelbeh avatar shannog avatar starkillerog avatar tijsvp avatar tyler-gei avatar ziporah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goodwe's Issues

Connect over modbus rtu

Hi,

first of all thank you very much for excellent python library.
I have just been wondering if it is possible to use your library with modbus over rs485/rtu and not over TCP/UDP?

Thank you for answer.

Tonas

Time sync

Hi,
is possible send some time sync command to Goodwe inverter? Applications Solar Go and PV Master synchronise the time immediately after connecting to the inverter (without entering the password).

I have a problem with the correct time in the inverter and I don't know how to synchronize it by machine. After a few weeks, I have a time difference of tens of minutes. Most of the time it's older in inverter.
My inverter is ET.

General Electric whitelabelled Goodwe's have different serial numbers

Hi there,

Thanks for a great repo!

I have a General Electric (rebranded) goodwe inverter, and the serial number format is different to normal Goodwe inverters.

As a result, this code in the DT inverter class does not work (my single phase, 3-pv-string inverter serial number does not contain either DSN or MSU:

if "DSN" in self.serial_number or "MSU" in self.serial_number:
            # this is single phase inverter, filter out all L2 and L3 sensors
            self._sensors = tuple(filter(self._is_not_3phase_sensor, self.__all_sensors))

        if "MSU" in self.serial_number:
            # this is 3 PV strings inverter, keep all sensors
            pass
        else:
            # this is only 2 PV strings inverter
            self._sensors = tuple(filter(self._is_not_pv3_sensor, self._sensors))
        pass

I don't know how to work out phase/pv string information from the general electric serial number, so in my case, I just cloned the repo and hard-coded these for my case.

How did you go about working this out for Goodwe?

Standby mode?

I´m using my Goodwe EM5048 with DIY battery.
I have an electricity tariff with cheap hours and expensive hours, in the VERY cheap ones I am interested in charging the battery and in the VERY expensive ones I am interested in discharging the battery. But there are some hours that are not cheap enough to upload and not expensive enough to download. I have tried setting ECO CHARGE/DISCHARGE to 0% but it charges/discharges uncontrollably. The closest thing to what I need is to put ecomode at 1% and it only draws 1A. but is there the possibility of a "standby mode" that the battery current stays at 0A?

Meaning

What does Battery SOC in back means?

Incorrect values for ES series?

Hello again, as I mentioned in a previous discussion your code greatly helps me move forward reading the values of the UDP messages using a C# application, I already had a few figured out (the easy ones) by just comparing the values but others were simply impossible for me to decipher until I stumbled upon your code. :-)

As a summary I have a ESA model inverter and the misunderstanding I was having was between the message to send, since tech support sent me a PDF document where they describe some values and the message to send as [01,01] (response [01,81]).

However looking at your code I saw you send [01,06] (response [01,86]) so the bytes obviously mean different things and thanks to your descriptions I changed my message so now I can get most of the stuff I need to replicate the chart seen in SEMS portal easily:

image

Where did you find the values for the response message and their meaning?
I'm asking because I'm having a slight discrepancy which I'm not sure how to figure out (or maybe I'm missing some calculation).

When I get to see the total PV generated (for example) during the inverter lifetime in response [01,86] as per your code it's read from bytes [59 .. 62]:

Energy4("e_total", 59, "Total PV Generation", Kind.PV),

But if I compare this value to what I see on SEMS they're slightly off:

image

Yes, I know some other values are off here due to the fact SEMS updates every 5 mins, but you get the point. ;-)

However, if I query the inverter telemetry for response [01,81] on bytes [54 .. 55] I do get the value shown in SEMS:

image

Do you know where can the disconnect be or what am I missing in the calculations? Same happens for today's generation, amount bought/sold today etc...

That's why I was asking also where you got those specs from or just by trial and error? :-)

Thanks again.
Kind regards.

pgridX value meaning

Does anybody know what value pgrid (or pgrid2, pgrid3) represents? I'm getting these values right now:

vgrid = 239.1 V
igrid = 1.9 A
pgrid = -406 W

vgrid2 = 238.9 V
igrid2 = 4.5 A
pgrid2 = 1073 W

vgrid3 = 236.1 V
igrid3 = 1.6 A
pgrid3 = -351 W

It surprises me, that the current is positive, while watts are negative (for L1 and L3). Also these values do not correlate what meter is sending (i.e. meter_active_power3 is now -1323 W).

Error message about 149 != 149 is confusing

As seen in #20 the following logs were emitted:

DEBUG:goodwe.protocol:Sending: aa55c07f0102000241
DEBUG:goodwe.protocol:Response has unexpected length: 149, expected 149.
DEBUG:goodwe.protocol:Received invalid response: aa557fc001868c0ec5000c000000000100020f019f0050010400360064006400001c001c6403000001097800180001138b0100000016ff02138d00020160000000000000048e0000016d0011003d00000f75ff0201003000000000010000febf100008000000160a160d0e25000000000000000000000000000000000000000000000000000004e7000004bf020000000000001128
DEBUG:goodwe.protocol:Sending: aa55c07f0102000241 - retry #1/3
DEBUG:goodwe.protocol:Received: aa557fc001824d3130313043475735303030532d42502331300000000000000000000000000039353030304250533232335730313336333630303431302d30343030312d3130093431302d30323033342d313502100e

This includes the nonsensical message "has unexpected length: 149, expected 149". Also, the response next to "invalid response" looks perfectly valid, it's the second one that is invalid??

Given that 149 is an odd number this can only come from the following code in goodwe/protocol.py

        if (
                len(data) <= 8
                or len(data) != data[6] + 9
                or (response_type and int(response_type, 16) != int.from_bytes(data[4:6], byteorder="big", signed=True))
        ):
            logger.debug("Response has unexpected length: %d, expected %d.", len(data), data[6] + 9)
            return False

It looks like the third condition in the "if" is not accurately described by the error message.

Immediate charge to Battery is missing

For GW3600S-BP and GW5000S-BP models (probably other models as well) it can be useful to charge the battery on command.

The PV master app contains the option 'Immediate charge to Battery' which is used to charge the battery immediately. GoodWe's description is 'Set for battery fast charging. It will only take effect once'. There is also a related option to stop charging: 'Charge cut-off SOC'. The battery charging will stop once the battery SOC reaches the Charge cut-off SOC.

It would be very helpful if this/these option(s) would be accessible from Home Assistant. It would allow people to charge the battery when there's no sun, but strong winds, thus a low hourly energy price.

Error fetching GoodWe data: ILLEGAL DATA ADDRESS

Hello,

I'm running an Goodwe gw15k-et Inverter connected via LAN.
Lan Module Firmware Version: V1.1.4
Inverter Firmware reportet in HA: 00300034003000360032002d / 02020-04-S01

I'm reciving an error in HA: Error fetching GoodWe data: ILLEGAL DATA ADDRESS

The Error is not present on every data fetch.

I alredy added

 logger:
  default: warning
  logs:
    custom_components.goodwe: debug
    goodwe: debug

but this didn't seem to get me more debug information.

e_day_imp returns no data

Hi,
I'm using the module in my custom made prometheus exporter, and it's great!
However, I found out, that the metric "e_day_imp" returns no data.

e_total: Total PV Generation = 1183.2 kWh
e_day: Today's PV Generation = 19.0 kWh
e_total_exp: Total Energy (export) = 1145.3 kWh
h_total: Hours Total = 3839 h
e_day_exp: Today Energy (export) = 8.1 kWh
e_total_imp: Total Energy (import) = 16.9 kWh
e_day_imp: Today Energy (import) = 0.0 kWh
e_load_total: Total Load = 3849.6 kWh
e_load_day: Today Load = 12.7 kWh

Is the code for this metric correct?

Also, the values somehow don't correspond to SemsPortal.
And it looks like the e_total_exp is switched with e_total_imp, because I have imported more power FROM grid, than sent into grid.

I'm using the GW10K-ET Inverter.

PPV negative value on ET inverter

Hi,

I have a GW3600-EH inverter and some months ago I started to get a -2 W read on the ppv sensor when there is no solar production.

I was debugging the code and the problem seems to be on this line

goodwe/goodwe/et.py

Lines 35 to 41 in 29de1c4

Calculated("ppv",
lambda data:
read_bytes4(data, 10) +
read_bytes4(data, 18) +
read_bytes4(data, 26) +
read_bytes4(data, 34),
"PV Power", "W", Kind.PV),

Although a filter to reject the ppv3 and ppv4 values is used, the ppv sensor gets populated using the Calculated class using a lambda function that pulls all the 4 current power.

The issue is that when accessing the ppv3 and ppv4 using the read_bytes4, the function returns a -1, therefore the sum will be 0+0+(-1)+(-1).

Could you help me to solve this issue? I don't know exactly how we could avoid reading this values?

Thanks!

GW20K-ET Some values are always 0

Hi,

thanks for your hard work!
I have an inverter GW20K-ET

meter_e_total_exp:               Meter Total Energy (export) = 0.0 kWh
meter_e_total_imp:               Meter Total Energy (import) = 0.0 kWh

The values, that are needed for Homeassistant Energy Dashboard are always 0 in the requests.
Sadly I do not really know how to analyse the datagram.
Solar-Go seems to successfully decode these values. So in theory, they are there .-)

I also have the issue that Semsportal is no longer available once HomeAssistant starts polling the inverter.
If there is a solution for that I would be thankful as well.

Thanks for your help...

Error in reading ECO mode data on GW6000ES20 (ESN version ARM v8)

Thanks for adding the ESN to also include eco mode v2! However it looks like the ESN version has a slightly different data encoding as it reports errors on the inverter_check.py on eco mode settings. I have been reversing the data with Solar Go and Wireshark, results below:

Goodwe GW6000ES20

  • Firmware: 04048-06-S06
  • ARM firmware: 02020-08-S01
  • Modbus version: 121
  • DSP1 version: 6
  • DSP2 version: 6
  • DSP svn version: 6606
  • Arm version: 8
  • ARM svn version: 362

`Self use mode / Advanced settings / Economic mode (ValueError: eco_mode_1: on_off value -7 out of range.)
ON-OFF switch
16:00 - 22:00 Discharge Power 20.0% Every day, every month, ON
47547: aa55f7030c10001600f97f00c800000fff20ca
16:00 - 22:00 Discharge Power 20.0% Every day, every month, OFF
47547: aa55f7030c10001600067f00c800000fff6fce

Charge power encoding
16:00 - 22:00 Charge Power 40.0% SOC 75% Every day, every month, ON
47547: aa55f7030c10001600f97ffe70004b0fffe519
Charge power = 4 byte encoding fe70 = -400 = Charge power 40.0%
Discharge power = 4 byte encoding 00C8 = 200 = Discharge power 20.0%

SOC encoding
16:00 - 22:00 Charge Power 20.0% SOC 50% Every day, every month, ON
47547: aa55f7030c10001600f97fff3800320fffd51f

Day of week coding 1byte - 7 bits = _SFTWTMS
16:00 - 22:00 Charge Power 20.0% SOC 75% Monday, Januari, ON
47549: aa55f70302f902b3c0
16:00 - 22:00 Charge Power 20.0% SOC 75% Tuesday, Wednesday, Thursday, Januari, ON
47549: aa55f70302f91c33c8

Month encoding 4 bytes = 0000DNOSAJJMAMFJ
16:00 - 22:00 Charge Power 20.0% SOC 75% Monday, Februari, ON
47547: aa55f7030c10001600f902ff38004b00026db0
16:00 - 22:00 Charge Power 20.0% SOC 75% Monday, March, ON
47547: aa55f7030c10001600f902ff38004b0004edb2

Peak shaving mode 00:00 - 13:08 import power 1.00 kW Reserved SOC for peakshaving 20%
47589: aa55f7030c00000d08fc7f006400140000a316
47602: aa55f703020001b191
Peak shaving mode off
47589: aa55f7030c00000d08037f000000000000ddde
47602: aa55f703020001b191

Deleted group sometimes as FF, sometimes 00 (ValueError: eco_mode_2: start_h value -1 out of range.)
aa55f7030cffffffff557f0000000100012af7
aa55f7030c0000000055000000000000002035
`

Install on Debian 12 Bookworm?

Bookworm is different, just to keep us on our toes:

pip3 install goodwe
error: externally-managed-environment
[... use apt install python3-xyz ...]

apt install python3-goodwe
E: Unable to locate package python3-goodwe

Is there some other incantation I should be using? Can I install it from the directory I 'git clone'ed?

Thanks!

values for GW5000S-BP don't seem to match up

Hi.. thanks for the great code.. I have been using this with the home assistant integrations and notice that the values for items don't seem to match with my inverter

the GW5000S-BP doesn't have any PV inputs.. its a battery only ac coupled inverter.

I see in the output that it says there is PV output, with no panels

hopefully some of all this helps to show and narrow down what might be going on. From what I can see I think is happening is that the battery is being linked as the PV

total PV generation isn't PV generation from the CT meter data.. not sure what it is

Sems shows that there is no PV
Screen Shot 2022-07-14 at 8 35 28 pm

Screen Shot 2022-07-14 at 8 35 47 pm

code sensor output..

*this on is while the battery is outputting before hitting its 30% remaining limit

vpv1: 		 PV1 Voltage = 376.9 V
ipv1: 		 PV1 Current = 3.5 A
ppv1: 		 PV1 Power = 1319 W
pv1_mode: 		 PV1 Mode code = 0 
pv1_mode_label: 		 PV1 Mode = PV panels not connected 
vpv2: 		 PV2 Voltage = 0.0 V
ipv2: 		 PV2 Current = 3.3 A
ppv2: 		 PV2 Power = 0 W
pv2_mode: 		 PV2 Mode code = 0 
pv2_mode_label: 		 PV2 Mode = PV panels not connected 
ppv: 		 PV Power = 1319 W
vbattery1: 		 Battery Voltage = 50.4 V
battery_status: 		 Battery Status = 80 
battery_temperature: 		 Battery Temperature = 19.8 C
ibattery1: 		 Battery Current = 41.1 A
pbattery1: 		 Battery Power = 2071 W
battery_charge_limit: 		 Battery Charge Limit = 55 A
battery_discharge_limit: 		 Battery Discharge Limit = 55 A
battery_error: 		 Battery Error Code = 0 
battery_soc: 		 Battery State of Charge = 38 %
battery_soh: 		 Battery State of Health = 100 %
battery_mode: 		 Battery Mode code = 2 
battery_mode_label: 		 Battery Mode = Discharge 
battery_warning: 		 Battery Warning = 0 
meter_status: 		 Meter Status code = 1 
vgrid: 		 On-grid Voltage = 242.1 V
igrid: 		 On-grid Current = 8.5 A
pgrid: 		 On-grid Export Power = 12 W
fgrid: 		 On-grid Frequency = 50.0 Hz
grid_mode: 		 Work Mode code = 1 
grid_mode_label: 		 Work Mode = Inverter On 
vload: 		 Back-up Voltage = 242.1 V
iload: 		 Back-up Current = 9.2 A
pload: 		 On-grid Power = 2123 W
fload: 		 Back-up Frequency = 50.0 Hz
load_mode: 		 Load Mode code = 1 
load_mode_label: 		 Load Mode = The inverter is connected to a load 
work_mode: 		 Energy Mode code = 2 
work_mode_label: 		 Energy Mode = Normal (On-Grid) 
temperature: 		 Inverter Temperature = 33.0 C
error_codes: 		 Error Codes = 0 
e_total: 		 Total PV Generation = 24.7 kWh
h_total: 		 Hours Total = 160 h
e_day: 		 Today's PV Generation = 3.5 kWh
e_load_day: 		 Today's Load = 32.2 kWh
e_load_total: 		 Total Load = 216.1 kWh
total_power: 		 Total Power = 2033 W
effective_work_mode: 		 Effective Work Mode code = 1 
effective_relay_control: 		 Effective Relay Control = 48 
grid_in_out: 		 On-grid Mode code = 0 
grid_in_out_label: 		 On-grid Mode = Idle 
pback_up: 		 Back-up Power = 2111 W
plant_power: 		 Plant Power = 4234 W
meter_power_factor: 		 Meter Power Factor = 0.001 
diagnose_result: 		 Diag Status Code = 64 
diagnose_result_label: 		 Diag Status = Discharge Driver On 
house_consumption: 		 House Consumption = 3378 W

*battery has hit its 30% remaining limit and stopped outputting power

vpv1: 		 PV1 Voltage = 375.0 V
ipv1: 		 PV1 Current = 0.0 A
ppv1: 		 PV1 Power = 0 W
pv1_mode: 		 PV1 Mode code = 0 
pv1_mode_label: 		 PV1 Mode = PV panels not connected 
vpv2: 		 PV2 Voltage = 0.0 V
ipv2: 		 PV2 Current = 0.1 A
ppv2: 		 PV2 Power = 0 W
pv2_mode: 		 PV2 Mode code = 0 
pv2_mode_label: 		 PV2 Mode = PV panels not connected 
ppv: 		 PV Power = 0 W
vbattery1: 		 Battery Voltage = 51.3 V
battery_status: 		 Battery Status = 80 
battery_temperature: 		 Battery Temperature = 20.7 C
ibattery1: 		 Battery Current = 0.0 A
pbattery1: 		 Battery Power = 0 W
battery_charge_limit: 		 Battery Charge Limit = 55 A
battery_discharge_limit: 		 Battery Discharge Limit = 55 A
battery_error: 		 Battery Error Code = 0 
battery_soc: 		 Battery State of Charge = 29 %
battery_soh: 		 Battery State of Health = 100 %
battery_mode: 		 Battery Mode code = 1 
battery_mode_label: 		 Battery Mode = Standby 
battery_warning: 		 Battery Warning = 0 
meter_status: 		 Meter Status code = 1 
vgrid: 		 On-grid Voltage = 240.4 V
igrid: 		 On-grid Current = 0.1 A
pgrid: 		 On-grid Export Power = -1489 W
fgrid: 		 On-grid Frequency = 49.96 Hz
grid_mode: 		 Work Mode code = 1 
grid_mode_label: 		 Work Mode = Inverter On 
vload: 		 Back-up Voltage = 240.4 V
iload: 		 Back-up Current = 6.8 A
pload: 		 On-grid Power = 1535 W
fload: 		 Back-up Frequency = 49.96 Hz
load_mode: 		 Load Mode code = 1 
load_mode_label: 		 Load Mode = The inverter is connected to a load 
work_mode: 		 Energy Mode code = 2 
work_mode_label: 		 Energy Mode = Normal (On-Grid) 
temperature: 		 Inverter Temperature = 30.3 C
error_codes: 		 Error Codes = 0 
e_total: 		 Total PV Generation = 25.2 kWh
h_total: 		 Hours Total = 161 h
e_day: 		 Today's PV Generation = 4.0 kWh
e_load_day: 		 Today's Load = 32.8 kWh
e_load_total: 		 Total Load = 216.7 kWh
total_power: 		 Total Power = -20 W
effective_work_mode: 		 Effective Work Mode code = 1 
effective_relay_control: 		 Effective Relay Control = 48 
grid_in_out: 		 On-grid Mode code = 2 
grid_in_out_label: 		 On-grid Mode = Importing 
pback_up: 		 Back-up Power = 1502 W
plant_power: 		 Plant Power = 3037 W
meter_power_factor: 		 Meter Power Factor = 0.001 
diagnose_result: 		 Diag Status Code = 524290 
diagnose_result_label: 		 Diag Status = Battery SOC low, Self-use off 
house_consumption: 		 House Consumption = 1489 W

HomeKit support?

Any chance anybody has tried getting HomeKit (GoodWe power monitor) to work? I have a MS inverter, which works great with the integration, just hoping to get HomeKit running locally as well, the SEMS version has quite a few issues with it.

I did the discovery broadcast on 255.255.255.255 port 48899 and I get responses from both my inverter and the HomeKit, so it seams to use the same communication as the inverters. I don't have time at the moment to dig into it properly, but responding to the broadcast seams promising that it could work.

I tried just adding it as if it was an inverter, but that fails, but im not sure on the inner workings of the integration, or if maybe I just have an old ARM firmware, though the device is new, and was only installed a week ago

GM1000 and/or GM3000 Modbus Map?

Hello. I was wondering if you had some information about the modbus maps used in the meters GM1000 or GM3000 (which in turn are the same as HK1000 and HK3000 I suppose).

Thanks!

Received invalid response on GW10K-BT, FW: 02041-22-S00

Hello,

Connecting to my GW10K-BT inverter is possible, and identifies the following:
Identified inverter

  • Model: GW10K-BT
  • SerialNr: XXXXXXXXXXXX
  • Version: 04029-06-S11
  • Firmware: 02041-22-S00

The inverter firmware was updated on 16/8 by goodwe support, so it should be the latest.

When I run read_runtime_data() something goes wrong.
Below you can find the log after the call is made.
Changing the amount of retries to 10000, will give a correct result after a random amount of tries.

2022-08-22 22:18:12,952 - goodwe.protocol - DEBUG - Sending: f703891c007d7ae7
2022-08-22 22:18:12,980 - goodwe.modbus - DEBUG - Response is too short: 54, expected 257.
2022-08-22 22:18:12,981 - goodwe.protocol - DEBUG - Received invalid response: aa55f703fa16081616113800000000000000000000000000000000000000000000000000000000000000000000000008a80010138800
2022-08-22 22:18:12,985 - goodwe.protocol - DEBUG - Sending: f703891c007d7ae7 - retry #1/3
2022-08-22 22:18:13,014 - goodwe.modbus - DEBUG - Response is too short: 42, expected 257.
2022-08-22 22:18:13,015 - goodwe.protocol - DEBUG - Received invalid response: aa55f703fa16081616113800000000000000000000000000000000000000000000000000000000000000
2022-08-22 22:18:13,019 - goodwe.protocol - DEBUG - Sending: f703891c007d7ae7 - retry #2/3
2022-08-22 22:18:13,048 - goodwe.modbus - DEBUG - Response is too short: 42, expected 257.
2022-08-22 22:18:13,049 - goodwe.protocol - DEBUG - Received invalid response: aa55f703fa16081616113800000000000000000000000000000000000000000000000000000000000000
2022-08-22 22:18:13,050 - goodwe.protocol - DEBUG - Sending: f703891c007d7ae7 - retry #3/3
2022-08-22 22:18:13,982 - goodwe.protocol - DEBUG - Max number of retries (3) reached, request f703891c007d7ae7 failed.

Thank you !

Add new registers to ET

Hello,
Can you add 2 new registers to et.py file? As listed below:
et_add_regs.patch
It is based on 0.2.32 version. I use this at my side with GW10k-ET inverter and it works as expected.

Thank you.

exported grid in a day?

I can get On-grid Export Power in a moment, but , there isn' t a total grid exported in a day?

Thanks!!

Use of non-default port

Hi, thanks for you work.
I'm trying to set up connection to my inverter in a different network for separation. The inverter is over NAT. The connection is forwarded from port 50 to 8899. I saw that some time ago support for non-standard port was dropped. I'm wondering if it is possible to bring port configuration back - would be great.

daily statistics for ET inverters

I may be wrong but there is something strange in the values for daily statistics for ET inverters.
I cannot compare the values obtained from this library from those seen in the sems portal.

Looking at the register config, the sequence is not simmetric:
Energy4("e_total", 182, "Total PV Generation", Kind.PV),
Energy4("e_day", 186, "Today's PV Generation", Kind.PV),
Energy4("e_total_exp", 190, "Total Energy (export)", Kind.AC),
Long("h_total", 194, "Hours Total", "h", Kind.PV),
Energy("e_day_exp", 198, "Today Energy (export)", Kind.AC),
Energy4("e_total_imp", 200, "Total Energy (import)", Kind.AC),
Energy("e_day_imp", 204, "Today Energy (import)", Kind.AC),

"Today's PV Generation" is Energy4 (4 bytes) while "Today Energy (export)" and "Today Energy (import)" are Energy (2 bytes).
Also "Hours Total" appears between the export measures.

Obviously the asymmetry is not necessary an issue, but since I obtain strange results I suspect that something should be fixed.

TIA

Inverters With 4 MPPTs

The GoodWe Home Assistant integration works very well with my GE-branded GoodWe GEH inverter.
However, my inverter has four PV strings (MPPTs), and the integration only reports sensors for two strings (i.e., sensor.pv1_power, sensor.pv2_power). The goodwe.pv_power sensor only totals PV1 and PV2. It would be fantastic to have support for 4-string GoodWe inverters.

All four PV strings are available through the GoodWe SEMS API.

I am currently using the experimental version of the HA integration.

I see in the ET class that the code is there but commented out - I'm guessing that you have no way to test it.

Model: GEH10-1U-10 (the device misreported in HA as GEH10-1U-1; I suspect it's truncated at 10 chars)
S/N: 9010KHSB21AW0043
Firmware: 43-2S002-S10 (02041-23-S00)

I have attached some debug level HA log entries. I'd be happy to test the code on your behalf, if you'd like - if I can help in any way, please let me know.

goodwe_log.txt

Improve support for MS models

Hi, I recently had a GW6000-MS inverter installed which is single phase and has 3 MPPTs. I noticed in Home Assistant the following problems:

  1. Sensors for three phases are shown.
  2. Only pv1 and pv2 strings are shown.

I've tracked the issue down to the following lines, which miscategorises my inverter. I've locally tested a fix by adding in another serial sub-string 'MST' and the problem is resolved.

goodwe/goodwe/dt.py

Lines 147 to 156 in 33d90cb

if any(model in self.serial_number for model in ["DSN", "MSU", "PSB", "PSC"]):
# this is single phase inverter, filter out all L2 and L3 sensors
self._sensors = tuple(filter(self._is_not_3phase_sensor, self.__all_sensors))
if any(model in self.serial_number for model in ["MSU", "PSC"]):
# this is 3 PV strings inverter, keep all sensors
pass
else:
# this is only 2 PV strings inverter
self._sensors = tuple(filter(self._is_not_pv3_sensor, self._sensors))

no attribute connect

Hello please i have question im trying to use your code to get data from my GW10K-ET but when i try to run inverter_check.py and set ip address of my goodwe i get python error
inverter = asyncio.run(goodwe.connect(IP_ADDRESS, FAMILY, COMM_ADDR, TIMEOUT, RETRIES)) ^^^^^^^^^^^^^^ AttributeError: partially initialized module 'goodwe' has no attribute 'connect' (most likely due to a circular import)

Received invalid response

I'm having big problems when reading info from my inverter (GW8K-DT).

It seams that I receive incomplete packages from the inverter. My guess is that it only sends data until the changed value is represented. Part of my Home assistant log is attached here: inverter_log.txt

I've also made my own software in .net (I am a .net developer) and discovered the same thing there. I've discussed it more here: mletenay/home-assistant-goodwe-inverter#88 (comment)

I hope we can work this out together, I am a professional developer (.net) as of almost 15 years. I think I could be of good help fixing this issue (I've seen more people having issues with this).
This is not a network issue. Both inverter and client (both HA and a client computer) is on the same switch, same VLAN and all is cabled, I have even tried changing cables just to be sure.

GW25K-ET Wrong V/A/Power register mappings

Hi,

Just got my 25K-ET installed a few days ago and still experimenting with everything.

Noticed there's a large discrepancy in the power reported by SEMS/SolarGo and also the ModBus outputs.

When reading out the registers via modbus as configured right now, you get the following:

vpv1: 				 PV1 Voltage = 696.9 V
ipv1: 				 PV1 Current = 3.3 A
ppv1: 				 PV1 Power = 1729 W
vpv2: 				 PV2 Voltage = 696.9 V
ipv2: 				 PV2 Current = 0.0 A
ppv2: 				 PV2 Power = 2922 W
vpv3: 				 PV3 Voltage = 647.4 V
ipv3: 				 PV3 Current = 5.3 A
ppv3: 				 PV3 Power = 0 W
ppv: 				 PV Power = 4651 W

For context, my configuration population is 1 string each on both MPPT1 and MPPT2, with MPPT3 unpopulated.

The problem as you see in the above breakdown, is that the power calculation as described by the power registers isn't accurate.

In comparison, this is what SolarGo is reporting, which seems to be accurate as far as the population config:

image

<style> </style>
  V A P calculated P modbus
PV1 696 3.3 2296.8 1729
PV2 696 0 0 2922
PV3 647 5.3 3429.1 0
PV4 647 0 0 n/a
PV5 0 0 0 n/a
PV6 0 0 0 n/a
    Total P 5725.9 4651

In the SolarGo flow overview, the app is showcasing the 5.7kW figure as generation coming from the panels.

When I go into SEMS, that is reporting the 4.6kW figure, which seems to match the modbus power total.

What's actually even more odd, is that although the calculated figure seems more accurate, the breakdown of where the power is flowing afterwards seems to want to indicate that the ModBus/SEMS figure to be the accurate ones, as it's showing ~2.3kW into the backup/grid output and 2.3kW into the battery and 0W into the grid meter.

However, SolarGo is showing 3.5kW into the house, which I know to be inaccurate, and I also noted that SolarGo always overestimates the house power by a large amount which seems to correlate with the calculated vs mdobus power sum difference.

To sum it up, it's one giant mess across all the apps and reporting figures.

At the very least, what is certain, is that the modbus ppv2/ppv3 figures are not showcasing what they're labelled as, assuming the values they are showing are even accurate. Instead what they seem to be showing is per-MPPT string-aggregate power figures, and the V/A registers are showing per-string data, hence the mismatch in the labelling.

Unfortunately I don't have MPPT3 populated as it would be interesting to see what the modbus output even shows when power would be flowing through that, given that PV4/PV5/PV6 data doesn't exist in the current known mappings (I saw the mention that one might attempt reverse-engineer things from the app).

Another FYI: I have the whole house exclusively connected to the backup output, however one will note that the modbus pgrid/2/3 figures will be +- mirroring the backup load outputs even though they should be zero (as shown by the meter itself), so that data is also relatively untrustworthy and useless and forces you to refer to the meter data and calculations to do any possible grid-tied loads.

Add support for other inverters

Hi,
I've been developing the goodwe protocol library (mostly for the HomeAssistant) for more than a year now.
See - https://github.com/mletenay/home-assistant-goodwe-inverter/blob/master/custom_components/goodwe/goodwe_inverter.py
There is support for ET, ES, EM and EH inverters now.
I was for quite some time considering to extract the actual python API lib from the HomeAssistant related code and was about to do it now, when I discovered your library.

I suggest we should join forces and merge our codes to single python lib which supports all possible inverter families.

(You can reach me/us also on our discord channel discord.gg/taxywxt)

Meter Total Energy import and export swapped

Hello,
I have a GW6000-EH inverter, which I monitor with Home Assistant. I have switched it off and when I switched it on 'Meter Total Energy (import)' and 'Meter Total Energy (export)' have been swapped. I restarted it again and one piece of data was recorded correctly, but then it continued to swap.
Thanks,
Carlos.

image

e_day_imp without value

Hi,

I have a GW3600-EH inverter and all the entities are properly popullated, but the e_day_imp does not. I mainly use the library directly on HomeAssistant, but I also tried it as standalone.

Is there any way to find why this happens? How can I share with you more data to debug this?

Thanks!

Peak shaving is missing from the GoodWe inverter operation mode

GoodWe has added a peak shaving mode in ARM version 22 for the ET series. See: https://community.goodwe.com/Forum/details/2c9180827a7b69a0017a94a74d0c0281

It is also mentioned in the manual.

This option is missing in Home Assistant

This feature was implemented by GoodWe for the Belgian market for example. There will be a peak tariff starting from 1/1/2023

Goodwe's implementation of the peak shaving might not be the most ideal, though it can be useful when it's combined with some smart logic, for example: connect car >> switch mode >> charge battery taking into account the maximum peak >> charge EV and stop when battery is depleted, repeat until car is full. >> switch back to general mode.

So, it's an important feature.

Enhancement - set mode

Hello,

Is it possible to implement change mode? For example to eco mode. I would like change mode for some cases.

Thanks
Jirka

Eco Mode + Discharge Battery

Hi guys, I have a GW5048D-ES inverter and a few questions about it:

  1. How can I enable the Eco Mode (Charge / Discharge) at specific times using this library?
  2. Imagine this scenario: It is a cloudy day which means not much PV, in that case, I want to discharge the battery into the grid, is that possible?

Multiple total counters have negative values regularly

Hi,

First I want to say great work so far!
I was working on a GoodWeLogger setup but then I came across this project.
Since I already had the WiFI dongle I figured this project/library based on UDP was worth a shot.

I've connected HA to my GW5K-DT and everything seems to work thus far.
Fortunately my e_day and e_total do work kinda, but they report -0.1kWh regularly:
afbeelding

This is also the case for the h_total sensor, seems like a problem with sensors reporting total values?
afbeelding

So my question is, is this a known issue yet?
I've enabled debug logging, And during a -0.1kWh moment there are no errors logged.

Note:
This question was first posted in #71 but I moved it since the protocol logic is part of this library.

Sorry - fundamental question about how to setup?

Hi. Sorry this is a dumb question. I have a GOODWE GW-GW20KAU-DT(G2)

Which is connected to my wifi, and uploading data to sems portal fine. However, I cannot connect to it using this tool/library (nor see any UDP traffic from the device). Is there something I need to do in order to set this up on the inverter? Would love to grab data directly, and not use the portal.

Support for ESA models

Hi there, I have a GW5048ESA and I'm trying to get the data on my own.
I'm able to figure out a handful of values by trial and error, but I don't know the rest (such as operating mode, battery status mode, etc). :-(

image

I'm querying the inverter directly via UDP and decoding the AA55 message response.

Any plans to add support for this, or at least know where I can find some info?

Thank you!

pv mode 1 and 2 switched?

PV1 has 0W and PV2 has 17W but pv mode shows PV1 producing power and PV2 not connected

Model: Goodwe GW8K-ET

Screenshot 2022-03-05 232256

timezone

I've just recently installed a PV system with a goodwe inverter. When I installed it, the timezone was UTC+1 (CET) and this time was configured on the inverter. On the last weekend in March DST was set in the Netherlands. The time on the inverter remained in the UTC+1 timezone, the timezone on my computer which runs gw2pvo switched to CEST (UTC+2).

The data on the sems portal shows timestamps which correspond to UTC+1, same as the inverter.

The cfg file contains city = Amsterdam.
Timezone in pvoutput: UTC+1:00 Europe/Amsterdam

Adjust for DST = Both + manual = correct
Adjust for DST = None + manual = 1 hour behind
Adjust for DST = Both + systemd service = 1 hour ahead
Adjust for DST = None + systemd service = correct

manual command:
~/venv/bin/python ~/venv/bin/gw2pvo --config ~/gw2pvo.cfg --date $(date +%Y-%m-%d)

systemd service:
ExecStart=/home/gw2pvo/venv/bin/python /home/gw2pvo/venv/bin/gw2pvo --config /home/gw2pvo/gw2pvo.cfg

I'd like to have a setup whereby I don't need to change anything for DST changes. How do other users do this?

GW25K-ET missing voltage & ampere of 2nd battery

Hi, thanks again for adding the soc of the 2nd battery. The output for the 2nd battery doesn't contain the voltage and ampere, so the power use of the 2nd battery can't be calculated. Or is there an other way to calculate the pbattery2 value out of house_consumption value?

1500 XS, FW 1.53.50 not working

Hello Marcel,

I tried several Py test scripts. None of them will respond. I was able to send this:
echo "WIFIKIT-214028-READ" | nc -v -u -n -b 192.168.178.130 48899

I got the the serial numer back. I understand from your comments this is only the Wifi part talking back. Nothing comes back from port 8899. I was able to setup the SEMS portal. (SolarGo is NOT working and says the function is not supported by this device) I made a tcpdump and concluded that 8899 or even 48899 was not even used by SEMS. Could it be that SEMS is using a total different protocol?

As I believe I have a fairly new firmware I'm afraid Goodwe has changed something that breaks the support for port 8899. Any suggestions?

Conflicting use with Goodwe Sems Portal

I don't know why, but when I setup a 1 minute sample from my Goodwe inverter using this library, the inverter stops reporting up to the seems portal until after I terminate my local monitoring.

How to change General - Eco mode

Hi, reading the values from the inverter works perfectly for me. Could you please advise me, if I want to change the MODE via python, How do I achieve this? I can't seem to figure it out. There is only a sample to read the values. But I would need to write something to the inverter as well.

Thank you

Sell / Sold per day

Hi,
I would like to ask you, how can I get "sell" or "sold" value for actual day? It is value in kWh what I sell to distribution network. SEMS portal has this value.
Value e_day_exp is not good for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.