# Connect OH to Goodwe via UDP

**URL:** <https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847>\
**Category:** Other\
**Tags:** udp, goodwe\
**Created:** [October 1, 2020, 7:10pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847 "2020-10-01T19:10:08Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Musashi](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Musashi](https://community.openhab.org/u/Musashi)\
**Post date:** [October 1, 2020, 7:10pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/1 "2020-10-01T19:10:08Z")

</div>

We have a Goodwe ES inverter connected to our wifi network and an app (PVMaster) on the phone to obtain information such as battery SOC, PV generation, load etc. I want to pull this information into OH to automate things like the pool pump. To date the only information I’ve found online involves the SEMS web portal where this information is saved (at something like 5 minute intervals). My thinking was that if the app can get the information via wifi, it must be possible for OH to do the same. Unfortunately I’m an amateur (to put it lightly) when it comes to these things.

Then someone cracked it for HA:  
[https://powerforum.co.za/topic/6931-goodwe-5048es-protocol-reverse-engineering/](https://powerforum.co.za/topic/6931-goodwe-5048es-protocol-reverse-engineering/)  
[https://github.com/mletenay/home-assistant-goodwe-inverter/blob/master/custom\_components/goodwe/goodwe\_inverter.py](https://github.com/mletenay/home-assistant-goodwe-inverter/blob/master/custom_components/goodwe/goodwe_inverter.py)

Basically the app sends a message to the inverter’s IP on port 8899 (sometimes 48899) and the inverter sends the information back to the phone using this port. The Python code for HA includes the deciphering of this code. Now I want to replicate this process in OH but I’m running out of skills quickly. I’m not familiar with UDP (or TCP for that matter) or Python and I’m struggling to find my way. I’m hoping the TCP/UDP binding can obtain the information and I’ll need help to transform this information into the various parameters.

I know I’m asking a LOT (as far as I can see, this hasn’t been done before for a Goodwe) but I’m sure a lot of people can benefit from this development. Any help or pointers where I can quickly pick up the required knowledge?

---

<div class="post-metadata">

**Author:** ![Musashi](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Musashi](https://community.openhab.org/u/Musashi)\
**Post date:** [October 4, 2020, 7:22pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/2 "2020-10-04T19:22:14Z")

</div>

So I think I’m making a bit of progress. I ran the Python code “inverter\_test.py” from my laptop (OH runs on a separate RPI) and it looks like the code gets a response from the Goodwe:  
 ![Screenshot UDP comms](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/d/c/dc5f0a2a1b0cd85005757494ec1258508db99c7e.png)

It doesn’t get the response expected but that I can figure out later. For now I just want to get the info into OH.

So I installed the TCP/UDP binding and created the following items:  
String GoodweData { udp=“\<[192.168.68.110:8899:]”}  
String GoodweRequest { udp=“\>[192.168.68.110:8899:]”}

In the rules I created the following line to run every minute:  
sendCommand(GoodweRequest, “aa55c07f0102000241”)

I can see this line run but “GoodweData” does not get an update. I suspect I might be getting the whole string vs hex format wrong but I just don’t know. Any ideas would be appreciated.

---

<div class="post-metadata">

**Author:** ![Musashi](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Musashi](https://community.openhab.org/u/Musashi)\
**Post date:** [October 12, 2020, 7:48pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/3 "2020-10-12T19:48:20Z")

</div>

Using Packet Sender om my laptop, I mimicked the Goodwe to see if I can get the UDP connection to work but the IP address provided seemed wrong. This may have something to do with the way our network is set up.

So as an alternative I pulled out a wemos board, found some UDP code and added my MQTT code. The wemos successfully requests the data from the Goodwe and passes it on to OH via MQTT. It’s a bit of a workaround but it works!

---

<div class="post-metadata">

**Author:** ![kroebi](https://community.openhab.org/letter_avatar_proxy/v4/letter/k/8797f3/32.png) [@kroebi](https://community.openhab.org/u/kroebi)\
**Post date:** [October 15, 2020, 9:02pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/4 "2020-10-15T21:02:05Z")

</div>

I translate the python plugin into a php-skript (only for my ET-Model), which irun every minute with exec-binding (dont forget whitelisting it). For ES-Model you have to change the script.

1. change $oh\_url and static $pbx\_ip to your IPs

2. create items in PaperUi with the names from $Bat and $Dat arrays.

3. Insert new Frame in sitemap:  
Frame label=“PV” {  
Text item=PV1\_Power label=“Leistung [%.1f W]”  
Text item=Total\_Power label=“Last [%.1f W]”  
Text item=House\_Comsumption label=“Netz [%.1f W]”  
Text item=Inverter\_Temperature label=“Invertertemperatur [%.1f °C]”  
Text item=Battery\_Temperature label=“Batterietemperatur [%.1f °C]”  
Text item=Battery\_Power label=“Batterieleistung [%.1f W]”  
Text item=Battery\_State\_of\_Charge label=“Batterieladung [%.1f]”  
}

---

<div class="post-metadata">

**Author:** ![mtttr](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f07891/32.png) [@mtttr](https://community.openhab.org/u/mtttr)\
**Post date:** [March 9, 2023, 7:06pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/5 "2023-03-09T19:06:06Z")

</div>

Hey, I know this is a bit of an older post, but would you be willing to share the Wemos code? I want to connect my Wemos board to the inverter using UDP, just like you did.

---

<div class="post-metadata">

**Author:** ![Chris56](https://community.openhab.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Chris56](https://community.openhab.org/u/Chris56)\
**Post date:** [April 11, 2025, 1:27pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/6 "2025-04-11T13:27:07Z")

</div>

Hi Dirk,

we als have an ET model (GW15K-ET) and need to query especially SOC of the battery.  
The modbus specs of Goodwe are crap and unreliable (e.g. after a firmware upgrade suddenly modbus addresses don’t work anymore).  
Therefore: do you have any documentation (either received or written) on the port 8899 UDP protocol?  
Thanks in advance,  
Chris

---

<div class="post-metadata">

**Author:** ![kroebi](https://community.openhab.org/letter_avatar_proxy/v4/letter/k/8797f3/32.png) [@kroebi](https://community.openhab.org/u/kroebi)\
**Post date:** [April 11, 2025, 3:26pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/7 "2025-04-11T15:26:03Z")

</div>

Sorry, but changed to Homeassistant, which has a nice plugin for good we.

> **(attachments)**
>
> ![Screenshot_20250411-172407.jpg](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/2/6/2683cdbee9750798eebe276cd8f7b14cf910ec78.jpeg)

---

<div class="post-metadata">

**Author:** ![Chris56](https://community.openhab.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Chris56](https://community.openhab.org/u/Chris56)\
**Post date:** [April 11, 2025, 6:08pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/8 "2025-04-11T18:08:19Z")

</div>

To my knowledge Homeassistant uses an external (semsportal) site for the query.  
But we want th query inhouse, directly to the device. Thus, not being dependant on a running internet connection nor on a running external site.  
Thanks anyway!

---

<div class="post-metadata">

**Author:** ![kroebi](https://community.openhab.org/letter_avatar_proxy/v4/letter/k/8797f3/32.png) [@kroebi](https://community.openhab.org/u/kroebi)\
**Post date:** [April 11, 2025, 6:22pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/9 "2025-04-11T18:22:06Z")

</div>

It’s internal via UDP and you refresh every 10 secs.

---

<div class="post-metadata">

**Author:** ![Chris56](https://community.openhab.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Chris56](https://community.openhab.org/u/Chris56)\
**Post date:** [April 11, 2025, 7:04pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/10 "2025-04-11T19:04:47Z")

</div>

I don’t know Homeassisatant. Are the sources of the GoodWE binding available? Then everything should be in there …

---

<div class="post-metadata">

**Author:** ![Larsen](https://community.openhab.org/user_avatar/community.openhab.org/larsen/32/95475_2.png) [@Larsen](https://community.openhab.org/u/Larsen)\
**Post date:** [April 11, 2025, 8:33pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/11 "2025-04-11T20:33:58Z")

</div>

I first had the udp-solution running with my goodwe inverter ET 15K-ET and then switched to modbus/tcp. Both were stable and reliable.

- via udp with the python library ([Connecting Goodwe Solar Panel Inverter Directly to Openhab - #20 by Larsen](https://community.openhab.org/t/connecting-goodwe-solar-panel-inverter-directly-to-openhab/130982/20) ): The downside for me was that the polling interval was only every 3 minutes and that I was not able to do forced charging of the battery.
- via modbus-tcp: This was only possible after installing the wifi 2.0 module, but it was worth it: Direct connection via modbus binding, forced charging etc (lots of info here but in german: [GoodWe GW10K-ET Sammelthread - Wechselrichter - Photovoltaikforum](https://www.photovoltaikforum.com/thread/186135-goodwe-gw10k-et-sammelthread/))

---

<div class="post-metadata">

**Author:** ![Chris56](https://community.openhab.org/letter_avatar_proxy/v4/letter/c/e19b73/32.png) [@Chris56](https://community.openhab.org/u/Chris56)\
**Post date:** [April 12, 2025, 7:45am UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/12 "2025-04-12T07:45:55Z")

</div>

Nice your modbus interface works. But: as I said above, firmware update and a modbus address (37007) does not work anymore:  
37006 (BMS Error Code Low): 0 0x0  
37007 (SOC): timeout  
37008 (SOH): 99 0x63  
However I do need the SOC information to switch on an additional enery source in case the battery is low.  
Thus, 37007 ceased to work. Bang!  
I am sure the UDP 8899 interface will be more reliable, as SolarGo depends on it.  
And they will thorougly test it over firmware updates.  
Threfore, I’d rather use the 8899/UDP interface (use by the SolarGo app) and search for documentation of it.  
Of course, I filed a bug report with goodwe.

---

<div class="post-metadata">

**Author:** ![uitgeslapen](https://community.openhab.org/user_avatar/community.openhab.org/uitgeslapen/32/86127_2.png) [@uitgeslapen](https://community.openhab.org/u/uitgeslapen)\
**Post date:** [January 8, 2026, 8:36pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/13 "2026-01-08T20:36:47Z")

</div>

Hello Larsen,

Can you share how you are controller the inverter mode via modbus-tcp

Thanks!

---

<div class="post-metadata">

**Author:** ![Larsen](https://community.openhab.org/user_avatar/community.openhab.org/larsen/32/95475_2.png) [@Larsen](https://community.openhab.org/u/Larsen)\
**Post date:** [January 8, 2026, 10:03pm UTC](https://community.openhab.org/t/connect-oh-to-goodwe-via-udp/105847/14 "2026-01-08T22:03:02Z")

</div>

sure. It’s that part of the modbus things:

```auto
    Bridge poller GoodWe-battery-control "Goodwe 70 P47500" [start=47511, length=16, refresh=20000, type="holding"] {
        Thing data batteryEMSPowerMode "Goodwe 71 Lademodus Batterie" [readStart="47511", readValueType="uint16", writeType="holding", writeStart="47511", writeValueType="int16"] 
          // 0x01=automatic (default) 
          // 0x02=charge 
          // 0x03=discharge
        Thing data batteryEMSPowerSet "Goodwe 72 batteryEMSPowerSet" [readStart="47512", readValueType="uint16", writeType="holding", writeStart="47512", writeValueType="int16"]
          // charge power in [W]
    }

```
