Goodwe solar binding? or how to receive data from webportal

binding
Tags: #<Tag:0x00007f51e5591508>

(Jordy Wauters) #1

Hi ,

is there anybody who can help me with hooking up my goodwe solar inverter to openhab . i noticed there isn’t any binding for this . or is there another binding or way to receive the data from my inverter.

kind regards.


(Vincent Regaud) #2

Does the inverter connect to the web?
How does the inverter reports it’s data, Ebus, KNX, Serial, Ethernet, Wifi, 433Mhz RF, Fairy dust?
What protocol is used for transmission of data? HTTP, MQTT, Inverted Manchester, Russian?

Does the manufacturer provide this kind of information?
Or does one has to use hack tools like wireshark to figure it all out?


(Jordy Wauters) #3

the inverter connects trough wifi to the web. online i can monitor my device via the https://www.semsportal.com/Home/Login with username and password. i am new to the openhab community so is fairy dust a real thing :rofl:


(Vincent Regaud) #4

Does the semsportal provide an API?


(SierraNL) #5

Can you find the IP of your inverter in your router? I believe most “chinese” inverters have an integrated webserver. I have Hosola inverters, and use the http binding to scrape the webpage running on the inverters themselves.


(Poul Rævdal) #6

Continuing the discussion from Goodwe solar binding? or how to receive data from webportal:

I am interesting in following this and have a request to do something similar.

I have a solar inverter that have an internal webserver where i can login but also an API link which is

http://(local IP address)/api/realTimeData.htm where it shows the following data

{“method”:“uploadsn”,“version”:“Solax_SI_CH_2nd_20160912_DE02”,“type”:“AL_SE”,“SN”:"(Serialnumber)",“Data”:[0.0,0.0,0.0,0.0,0.0,0.0,0,0,2.2,2673.0,-841,0,0,48.06,0.00,0,18,18,0.0,384.1,1932.66,1279.81,0.00,0.0,0.0,0,0.00,0,0,0,0.00,0,8,0,0,0.00,0,8],“Status”:“8”}

Found an article on home assistant where they describe the data stream

How is it possible to get this information added into a binding and show the data in openhab.

Future needs for this is of course some rules to measure that the solar is producing good power and to start the washing machine while the power from the solar is good.

Help is needed to build a binding or getting the data into openhab, thanks.

Regards
Poul


(Vincent Regaud) #7

Interesting ping me tomorrow


(Poul Rævdal) #8

Do you know how to connect or use an existing binding to get the data ?


(SierraNL) #9

To get the data from the API you can use the HTTP binding, which you can use directly in an item or in a rule.
Then you have to parse the data into values which you can place in one ore more items.
This kind of data is called JSON, and OpenHAB has a transformation called JSONPath that can parse exactly this kind of data.

I’m a little short of time to create an example, but using these keywords and google you should be able to get it working.


(Vincent Regaud) #10

Quick example:

From the HASS website:

Live datastream
1: PV1 Current
2: PV2 Current
3: PV1 Voltage
4: PV2 Voltage
5: Grid Current
6: Grid Voltage
7: Grid Power
8: Inner Temp
9: Solar Today
10: Solar Total
11: Feed In Power
12: PV1 Power
13: PV2 Power
14: Battery Voltage
15: Battery Current
16: Battery Power
17: Battery Temp
18: ???
19: Battery Capacity
20: Solar Total 2

42: Energy to Grid
43: Energy from Grid

51: Grid Frequency

54: EPS Voltage
55: EPS Current
56: EPS VA
57: EPS Frequency

63: ???
68: ???
69: Status
rule "get data from inverter"
when
    Time cron "1 0/5 * ? * * *" //Every 5 minutes
then
    val String result = sendHttpGetRequest("http://(local IP address)/api/realTimeData.htm", 5000) // Retreives full JSON
    val SolarToday = transform("JSONPATH", "$.Data[8]", result) //Extract Battery Capacity
    logInfo("TEST", SolarToday)
end

Now, you only have 44 values in the “Data” compared to what the HASS website say, so you’ll have to make sense of the values (Note the SolarToday is the 9th value so the json is $.Data[8] because we start from 0)


(Jordy Wauters) #11

i have found some similar info like poulraevdal on a home assistant website for scraping the sems portal webpage. i don’t know how to implement or do al this stuff. if someone can explain some basics to me would be nice.
https://github.com/Sprk-nl/goodwe_sems_portal_scraper


(Jordy Wauters) #12

found some extra info , if there are developers who can make a binding for this. i think this info comes in handy.