Python plugin for Goodwe - local lan via udp

Python and python framework

Moderator: leecollings

kratax
Posts: 21
Joined: Tuesday 30 April 2019 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Python plugin for Goodwe - local lan via udp

Post by kratax »

Hi,
Is there any alternative for home assistant goodwe plugin which directly reads data from local network (i.e. not via sems portal)?
Github page of home assistant version:
https://github.com/mletenay/home-assist ... e-inverter

Thanks a lot!
Regards,
Kratax
User avatar
HansOtten
Posts: 50
Joined: Saturday 17 April 2021 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Mierlo
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by HansOtten »

Good question!

I would love also to replace the web based currrent plugin with a (more reliable and no external dependent, SEMS portal is sometimes slow) with a local one.

Hans
Raspberry Pi 4, SSD, RFlink, P1 Smart Meter. Many Zigbee devices CR2562 USB stick. Bresser via Weather Underground
Switched to Home Assistant!
kratax
Posts: 21
Joined: Tuesday 30 April 2019 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by kratax »

Ok, good to know, I am currently considering if that's easier to adapt this to domoticz (not much experience with that so far) or to switch from domoticz to home assistant ...
JanJaap
Posts: 215
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by JanJaap »

Hey,

I'm maintaining the plugin for accessing the Goodwe inverter via the SEMS API. Reason for not (yet?) switching to the local lan option is the fact that you need to have the firmware upgraded for your inverter, which most people (my assumption) haven't done. Not sure how or since when new inverters are being delivered with new firmware.

I do see indeed errors and sometimes the data lagging, but overal it works ok. I've got some other plugins I? want to finish first, maybe I'll dive into this later. If you guys wanna dive in, I'll be happy to help.

Regards Jan-Jaap
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
vinjon
Posts: 7
Joined: Tuesday 24 March 2020 9:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by vinjon »

You can submit a ticket at https://support.goodwe.com with the request for an firmware update so UDP readout becomes available. If you provide the serial number of your inverter they upgrade it over the internet within a week.
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by Wiljums »

JanJaap wrote: Tuesday 01 February 2022 22:08 Hey,

I'm maintaining the plugin for accessing the Goodwe inverter via the SEMS API. Reason for not (yet?) switching to the local lan option is the fact that you need to have the firmware upgraded for your inverter, which most people (my assumption) haven't done. Not sure how or since when new inverters are being delivered with new firmware.

I do see indeed errors and sometimes the data lagging, but overal it works ok. I've got some other plugins I? want to finish first, maybe I'll dive into this later. If you guys wanna dive in, I'll be happy to help.

Regards Jan-Jaap
Can I help in the development of the plugin? No coding experience, but I can test?
JanJaap
Posts: 215
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by JanJaap »

I've got my hands full at this moment with 2 other projects + no real need for this (via web api works ok) so won't promise anything......
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
remcok
Posts: 3
Joined: Wednesday 06 July 2022 1:03
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by remcok »

I created a plugin for Domoticz for local readout of a GoodWe inverter via modbus over UDP.
Works via LAN and WLAN. For XS inverter is firmware 1.xx.14 or higher required. Other GoodWe inverter model series (ET, EH, BT, BH, ES, EM, BP, DT, MS, NS) might work as well.

Currently the plugin is in working order but isn't (yet) in a shape to be released, so I'm looking for some beta testers to start in a couple of days. Please send me a message and I'll be contacting you back in a few days with some details to get you started.

Whenever you want to help beta testing I expect this from you:
1. You are familiar with Domoticz, know how to install and configure a plugin.
2. You are familiar with reading the Domoticz logs and are able to extract data from that to send to me.
3. You have a GoodWe inverter with the required firmware (For XS series firmware 1.xx.14 or higher) with a Wifi of LAN module which has been proven to already work with modbus over UDP on port 8899.
4. You have insight in your energy delivering stats (not in Domoticz, but in Sems, for example) so you can compare numbers between different systems.
5. You install and use the plugin at your own risk. If, for any reason, things break down, you lose data, Domoticz dies or anything else; its your own risk.

Edit: Hope this forum allows you to send me a PM or e-mail, so try that. Otherwise, maybe just reply below (without giving your e-mail address or other personal info in the post), then we will find another safe way to get the info.
Its only vintage if it works.
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by bvdf0251 »

Hi Remco, I'm interested.

Just received my goodwe 3600dns last month. Sems is very disappointing so looking for a way to log via local in domoticz.

My domoticz is on rPi bullseye so the other plugin isn't working.

Let me know what I can do.
remcok
Posts: 3
Joined: Wednesday 06 July 2022 1:03
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by remcok »

bvdf0251 wrote: Saturday 09 July 2022 15:08 Hi Remco, I'm interested.
...
Let me know what I can do.
Hi, I just finished publishing the beta version in my github account, you can find it here:
https://github.com/remco-k/domoticz-goo ... dp-plugin/

Please take a look at the readme, it will describe on how to install the plugin. If you find an issue, then please create an issue here, describe as much as possible on what the issue is and what you think is going wrong:
https://github.com/remco-k/domoticz-goo ... gin/issues

Hope it works for you, please let me know if this plugin works with your inverter.
Its only vintage if it works.
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by bvdf0251 »

Hi, Took a little time(Bullseye and Python do not get along)

Updated Domoticz to beta and the plugin is now functional.

Did have to manually install pymodbus via 'pip install pymodbus' perhaps this should be added to 'requirements.txt'

Also notice that you have to have 'Accept new Hardware Devices' enabled or it will fail to create devices.

My Inverter is 3600T-DS with Wi-Fi module.

I do notice that today's and total generation don't match the device setting. In devices the total is 622, on the dashboard it started at 0 and is now being totalled.
remcok
Posts: 3
Joined: Wednesday 06 July 2022 1:03
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by remcok »

bvdf0251 wrote: Sunday 10 July 2022 13:05 Did have to manually install pymodbus via 'pip install pymodbus' perhaps this should be added to 'requirements.txt'
Thanks, I added this to the requirements.
Also notice that you have to have 'Accept new Hardware Devices' enabled or it will fail to create devices.
I'm fairly new to Domoticz, about 3 to 4 weeks, this setting is in Setup->System, and I believe its normal that you need to enable it for devices to be added by plugins? And therefore device creation will fail if disabled. Or do you mean something else?
My Inverter is 3600T-DS with Wi-Fi module.
Noted as a reported working inverter.
I do notice that today's and total generation don't match the device setting. In devices the total is 622, on the dashboard it started at 0 and is now being totalled.
I believe this is normal as Domoticz didn't get the 'start of the day' value in the beginning of the day. Looking at other inverter plugins (I have a SolarEdge inverter as well), this looks the same.
I think if you have a look at it tommorow for that day, it should match up.

I pushed a new version with the above changes: beta-release-v0.0.2
Its only vintage if it works.
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by bvdf0251 »

Yes I meant that setting. I've been using Domoticz for some 2 years now but never actually used a plugin till now.

It's no problem just something that I noticed.

As for the daily generation I understand that because of the timing I don't get everything today, however when you check the device in 'devices' it does show the correct daily generation. Meaning the data is there.

Same for the total generation.

https://drive.google.com/file/d/1ReKbSX ... p=drivesdk

https://drive.google.com/file/d/1Rblyhx ... p=drivesdk

Would be nice if we can get this data in the database so I have the total amount generated accurately.
Jeweettoch13
Posts: 7
Joined: Saturday 23 July 2022 16:42
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by Jeweettoch13 »

Image
remcok wrote: Sunday 10 July 2022 14:54
bvdf0251 wrote: Sunday 10 July 2022 13:05 Did have to manually install pymodbus via 'pip install pymodbus' perhaps this should be added to 'requirements.txt'
Thanks, I added this to the requirements.
Also notice that you have to have 'Accept new Hardware Devices' enabled or it will fail to create devices.
I'm fairly new to Domoticz, about 3 to 4 weeks, this setting is in Setup->System, and I believe its normal that you need to enable it for devices to be added by plugins? And therefore device creation will fail if disabled. Or do you mean something else?
My Inverter is 3600T-DS with Wi-Fi module.
Noted as a reported working inverter.
I do notice that today's and total generation don't match the device setting. In devices the total is 622, on the dashboard it started at 0 and is now being totalled.
I believe this is normal as Domoticz didn't get the 'start of the day' value in the beginning of the day. Looking at other inverter plugins (I have a SolarEdge inverter as well), this looks the same.
I think if you have a look at it tommorow for that day, it should match up.

I pushed a new version with the above changes: beta-release-v0.0.2
HI there. I have the plugin running but it seems i can't get data from the inverter. Could it be that i'm running an older firmware? Where can i check the version of it?


2022-07-24 11:18:54.504 Error: Goodwe UDP: Call to function 'onHeartbeat' failed, exception details:
2022-07-24 11:18:54.505 Error: Goodwe UDP: Traceback (most recent call last):
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/usr/local/lib/python3.7/dist-packages/goodwe/inverter.py"„ line 108, in read_from_socket
2022-07-24 11:18:54.505 Error: Goodwe UDP: result = await command.execute(self.host, self.timeout, self.retries)
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/usr/local/lib/python3.7/dist-packages/goodwe/protocol.py"„ line 109, in execute
2022-07-24 11:18:54.505 Error: Goodwe UDP: await response_future
2022-07-24 11:18:54.505 Error: Goodwe UDP: goodwe.exceptions.MaxRetriesException
2022-07-24 11:18:54.505 Error: Goodwe UDP:
2022-07-24 11:18:54.505 Error: Goodwe UDP: During handling of the above exception, another exception occurred:
2022-07-24 11:18:54.505 Error: Goodwe UDP:
2022-07-24 11:18:54.505 Error: Goodwe UDP: Traceback (most recent call last):
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/opt/domoticz/userdata/plugins/domoticz-goodwe-modbusudp-plugin/plugin.py", line 361, in onHeartbeat
2022-07-24 11:18:54.505 Error: Goodwe UDP: _plugin.onHeartbeat()
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/opt/domoticz/userdata/plugins/domoticz-goodwe-modbusudp-plugin/plugin.py", line 219, in onHeartbeat
2022-07-24 11:18:54.505 Error: Goodwe UDP: runtime_data = asyncio.run( self.inverter.read_runtime_data() )
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
2022-07-24 11:18:54.505 Error: Goodwe UDP: return loop.run_until_complete(main)
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
2022-07-24 11:18:54.505 Error: Goodwe UDP: return future.result()
2022-07-24 11:18:54.505 Error: Goodwe UDP: File Yusr/local/lib/python3.7/dist-packages/goodwe/dt.py", line 156, in read_runtime_data
2022-07-24 11:18:54.505 Error: Goodwe UDP: raw data = await self. read from socket(self._READ_DEVICE_RUNNING_DATA)
2022-07-24 11:18:54.505 Error: Goodwe UDP: File "/usr/local/lib/python3.7/dist-packages/goodwe/inverter.py", line 114, in_read_from_soccket
2022-07-24 11:18:54.505 Error: Goodwe UDP: self._consecutive failures count)
2022-07-24 11:18:54.505 Error: Goodwe UDP: goodwe.exceptions.RequestFailedException: ('No valid response received even after 3 retries', 1)


On the other side it is showing 19 out of 34 values so data is coming trough in domoticz.

I also noticed when UDP is active, no SEMS portal data is coming trough. Is this because of the intercept of data?
Last edited by Jeweettoch13 on Sunday 24 July 2022 11:51, edited 4 times in total.
Jeweettoch13
Posts: 7
Joined: Saturday 23 July 2022 16:42
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by Jeweettoch13 »

JanJaap wrote: Tuesday 01 February 2022 22:08 Hey,

I'm maintaining the plugin for accessing the Goodwe inverter via the SEMS API. Reason for not (yet?) switching to the local lan option is the fact that you need to have the firmware upgraded for your inverter, which most people (my assumption) haven't done. Not sure how or since when new inverters are being delivered with new firmware.

I do see indeed errors and sometimes the data lagging, but overal it works ok. I've got some other plugins I? want to finish first, maybe I'll dive into this later. If you guys wanna dive in, I'll be happy to help.

Regards Jan-Jaap
I have your plugin working, tnx! only downside is that it is only displaying one of the three phases of output (current and voltage) while it's a 3-phase inverter. Or can i tweak something in SEMS portal for this?
JanJaap
Posts: 215
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by JanJaap »

Hi Jeweettoch,

This topic is for the straight to the inverter via UDP plugin. For questions on the via-the-web version of goodwe SEMS plugin, please use this topic: Python Plugin: GoodWe solar inverter via SEMS API. I'm guessing it ain't all that hard to make, guessing data is there. In both of the plugins.
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
hesselb
Posts: 7
Joined: Thursday 11 July 2019 11:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by hesselb »

i have th plugin working inverter is GW6000-DT
but som errors

2022-08-04 15:29:21.265 Error: goodwe: 'onHeartbeat' failed 'RequestFailedException':'('No valid response received even after 3 retries', 1)'.
2022-08-04 15:29:21.265 Error: goodwe: Exception traceback:
2022-08-04 15:29:21.265 Error: goodwe: ----> Line 361 in '/home/pi/domoticz/plugins/domoticz-goodwe-modbusudp-plugin/plugin.py', function onHeartbeat
2022-08-04 15:29:21.265 Error: goodwe: ----> Line 222 in '/home/pi/domoticz/plugins/domoticz-goodwe-modbusudp-plugin/plugin.py', function onHeartbeat
2022-08-04 15:29:21.265 Error: goodwe: ----> Line 50 in '/usr/lib/python3.7/asyncio/runners.py', function run
2022-08-04 15:29:21.265 Error: goodwe: ----> Line 584 in '/usr/lib/python3.7/asyncio/base_events.py', function run_until_complete
2022-08-04 15:29:21.265 Error: goodwe: ----> Line 156 in '/usr/local/lib/python3.7/dist-packages/goodwe/dt.py', function read_runtime_data
2022-08-04 15:29:21.266 Error: goodwe: ----> Line 117 in '/usr/local/lib/python3.7/dist-packages/goodwe/inverter.py', function _read_from_socket
Arnoud
Posts: 6
Joined: Thursday 10 November 2016 21:37
Target OS: Linux
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by Arnoud »

I have a GW5000D-NS, which is a single phase, dual input inverter, running software V1.1.2.1

This plugin in its current form does not work for my model. I have managed to get it working by making a few changes.

The biggest issue seems to be the detection of single vs 3 phase in the plugin. It tries to read vgrid2 and vgrid3, which fail (around line 315 in the code). By changing that part to force it always to single phase I got it to work.

For your reference, this is the output of my inverter from the first sample script:

Code: Select all

timestamp:               Timestamp = 2022-09-12 20:02:28
vpv1:            PV1 Voltage = 198.7 V
ipv1:            PV1 Current = 0.1 A
ppv1:            PV1 Power = 20 W
vpv2:            PV2 Voltage = 265.4 V
ipv2:            PV2 Current = 0.1 A
ppv2:            PV2 Power = 27 W
vline1:                  On-grid L1-L2 Voltage = -0.1 V
vgrid1:                  On-grid L1 Voltage = 233.3 V
igrid1:                  On-grid L1 Current = 1.1 A
fgrid1:                  On-grid L1 Frequency = 49.98 Hz
pgrid1:                  On-grid L1 Power = 257 W
ppv:             PV Power = 50 W
work_mode:               Work Mode code = 1
work_mode_label:                 Work Mode = Normal
error_codes:             Error Codes = 0
warning_code:            Warning code = 0
temperature:             Inverter Temperature = 27.5 C
e_day:           Today's PV Generation = 23.3 kWh
e_total:                 Total PV Generation = 583.1 kWh
h_total:                 Hours Total = 396 h
safety_country:                  Safety Country code = 20
safety_country_label:            Safety Country = Holland
funbit:                  FunBit = 368
vbus:            Bus Voltage = 356.9 V
vnbus:           NBus Voltage = -0.1 V
And it generates these sensors:
2022-09-12_200251.png
2022-09-12_200251.png (76.26 KiB) Viewed 5222 times
There are a few that don't seem to be reporting the correct value. I will give a stab at it trying to figure out what to change to get it to work correctly.
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by bvdf0251 »

Hi Remco,

How can I upgrade without losing history?

Thanks.
bofisko
Posts: 23
Joined: Sunday 22 November 2020 17:44
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin for Goodwe - local lan via udp

Post by bofisko »

Hi, It that some body who will be to help me to make in LUA Fibaro HC3 make quick app for load data directly from local LAN for Goodwe via UDP protocol like is here or in HA.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest