Ginlong Solis solar inverter monitoring

I was looking at interesting Tutorials & Examples as I’m currently in the process of implementing a KNX system with OpenHAB on top of it.

I also have a Ginlong Solis inverter that was installed last summer. Currently my WiFi signal is not that strong enough to always be picked up by the monitoring stick. Now, I have already been looking at solutions to get the solar data out of the inverter.

What I did find was that the solution for Omnik Dataloggers (https://github.com/Woutrrr/Omnik-Data-Logger) also worked for my Ginlong inverter. From the original config file, I only configured the ip and serial number of the inverter. Then it was possible to get data on demand out of the inverter.

2 Likes

So, I’ve dug further into this issue:

My inverter is handing out hex data of 216 length. I can identify the serial code. For the remaining of the code I wrote a python script which basically looked at every 4 character combination. So what it did was:

a = float(int(hexdata[102:106],16))/10
b = float(int(hexdata[104:108],16))/10
c = float(int(hexdata[106:110],16))/10
... 

And so on, and then i printed the output of all the variables to a file which I could then compare with the actual data.
I though this way I could easily recognize the different data elements … NOT!

I’ve compared several files of this python output with the actual data when logging into www.ginlongmonitoring.com … but not a single number matched with the actual data. Very strange! It’s as if the data has been encrypted in a way…
Darren, if you’re interested I can pm you an actual data overview with the corresponding hex string and you can give it a go if you want…

Anhyhow - frustrated as I was - I did find another way to get my data into OpenHab and then finally into Grafana. I stumbled upon another page (https://www.domoticz.com/forum/viewtopic.php?f=65&t=7941) where someone wrote a script to extract the data from the monitoring site itself (www.ginlongmonitoring.com). It’s also a python file where you enter your username and password of the site, and then it can pull the data from the site itself

I’ve then made a “merger python script” from the domoticz python script +the script from Darren, basically removing the final code where the data is uploaded to the domoticz host website, and replacing it with the MQTT code from Darren so the data is sent to the MQTT broker.
And result: it works like a charm :slight_smile:

So far I don’t have the same amount of variables (Domoticz has defined 5: TodayIncome, ActualPower, etoday, etotal and etotalstr), but it should be possible to also extract the other variables like temperature, frequency, etc… I guess.

Only disadvantage of this approach: the data is extacted from the monitoring website and not from the inverter itself, making you dependent on an external server…

@peterkuterna thanks for also sharing your approach with the Omnik Datalogger. This is then a 3rd viable alternative

@Darren_Poulson Hope you got your solar panels back online!

Glad you’re getting some data back at least. :slight_smile:

I did manage to figure out what was wrong, the network cable’s retention tab had broken off and whilst it hadn’t totally fallen out, it had slipped out enough to not register. Working again now.

@peterkuterna Nice looking project you’ve found there, will take a look when theres daylight. Didn’t think it was possible to query the actual device.

@sceppi Unfortunately I don’t think all the variables are 4 bytes, at least there were a couple that I found that weren’t. Just enough to make things confusing. Its also a problem that the protocol supported by my script is different to the one for the ginlong website, and are sent at different intervals. So you’ll never have quite the same values, but instead have to get a load of data and look for trends, etc. Its a painstaking process, and it was my first ever attempt at doing anything like that.

I’m away for a week or so, so won’t have time to look into it properly yet. May get a bit of time tomorrow to have a quick look.

An update on my setup as I now have a powerline wifi adapter installed near the inverter.

I’m using this project to capture the data from the monitoring stick: https://github.com/XtheOne/Inverter-Data-Logger/

I’m using the outputs towards PVoutput & MQTT. The last one to have this as items in my OpenHAB installation.

Hi
I wonder if anyone is watching for questions, i have one on python version, I’m using 3.6 ,will th w scripts for pyton 2,7 still work with this ???

I’ve no idea what the differences between the python versions are really. Try running it and see? Pretty sure it should either run, or just need minor tweaks.

Hi Darren
I wasn’t sure if you monitored the thread.
I’m using mosquito on sensors in home assistant which run in a python virtual env.
Thats giving some minor problems with downloading with PIP the modules required.
even with sudo its refusing to download at the moment, but as soon as I get that sorted ,I’ll
try ruuning your script and see what happens,
The device is a odroid Xu4 which is an octal core ARM SBC, running ubuntu18.04
thanks for the reply

1 Like

Hello,

I implemented a monitor for NodeJS in combination with influxdb.
I only show the output in a grafana graph so no need to store it in different items like shown above.

Those interested can find the code at: https://github.com/herrJones/ginlong-node

Regards,

Jan

Hi,

Hoping someone is monitoring and can help.

I have a Solis Wifi dongle. I can see in sceppi’s screen shot that it is from firmware 1.0.1. I am on 1.0.20 and in the general world of progress I seem to have far less. I dont have a test option and I dont have a connection protocol.

I have put in a listening IP & port and verified from another machine on the network that there isnt a local firewall blocking the port and its all fine with the exception of the logger says “not connected” even after it has connected to the ginlong monitor. I have left this for 24 hours (including a very sunny day) and still no connection.

I have tried the above MQTT solution for OpenHAB (really really would love this) and didnt work so went to basics and used nc in Linux and a simply python script and not joy. In all cases I can see there were no attempts from the dongle to open a connection never mind send data.

Anyone got this working with the newer firmware?

And the status page says:
Remote server information

Remote server A Connected
Remote server B Not connected

I have exactly the same problem with an ME3000SP. Any luck resolving it?

Hi,
I have a Sofar HYD5000 inverter with attached battery pack. I too have been trying to reverse engineer the comms.
The SolarMan logger sends a variety of packet sizes, the one of most interest is 203 bytes. So far I’ve identified

  • inverter serial
  • logger ID
  • battery charge level
  • battery temp

sometimes the IP address appears in the packet, leaving me to guess that there are variable fields with flag values to indicate what’s coming next.

I’ve failed miserably so far to identify the two PV strings, voltage and current. Or the grid draw.

I dug around the solarmanpv website in the hope of finding some documentation, but failed to get anything at all.

If anyone’s interested in getting their hands on the source code to the C program I wrote which uses pcap to sniff the traffic, let me know. I run it as a man in the middle sniffer.

Paul

Hello guys. @Carl_Meek / @KrisG I had the very same problem, I even tried setting up a simple TCP server to see if I’m getting any connection but no.

What I ended up is this tool I made by myself:

which is very lame in it’s basic but works :wink: So I set up this simple NodeJS app and set up my items in OpenHAB using HTTP binding:

Number PV_POWER "Value: [%.1f W]" { http="<[http://my_service_ip:8080/:5000:JSONPATH($.power)]" }

where 5000 is 5 seconds refresh interval, rest of the values you bind the same way (see readme in my node project repo)

Any comments / suggestions welcome :slight_smile:

Did you have any thoughts about, if this inverter might be communication through the modbus protocol? I cant see its aavilable communications protocols from its specs, but it looks like there is a RS485, Ethernet/WiFi and CAN bus (CAN bus for the battery probably). So perhaps it could be as simple as tcp modbus or RS485 modbus.

I have a Solis 4G and I use rs485 and modbus rtu for comunication. This way you only need a 2$ usb to rs485 plugged in to your Openhab HW and run modbus binding.

Have a Ginlong Solis 4G 3.6 and like to use the second server address. However I have no knowledge about LINUX, Rpi, Python etc. Just a bit about Arduino and ESP8266 (and C). So I have an ESP8266 configured as webserver. The second Solis port is configured with the IP address and port of the ESP8266.
Nothing is being received and the status of “Remote Server B” remains “Not Connected”.
Anybody done this before ? Any suggestions?

Hi KrisG,
I’m having the same issue. I have ver 1.0.23 and server B is showing Not Connected. I setup a SBC (AtomcPi) to listen to the port using the linux NC and nothing is received. I used NMAP from another PC to test the port and it did work, so NC was expecting the signal but the inverter wasn’t sending anything. :thinking: :thinking:

I’m very interested on being able to store the data locally. Any advice, please share…
Thanx,
Ricardo

I have Sofar inverter but looks like dataloger is same.
Easiest way i found:

Group Sofar_group
Number Sofar_power (Sofar_group) {http="<[http://X.X.X.X/status.html{Authorization=Basic abcabcabc}:60000:REGEX(.var\swebdata_now_p.{4}(\d).)]"}
Number Sofar_energy_today (Sofar_group) {http="<[http://X.X.X.X/status.html{Authorization=Basic abcabcabc}:300000:REGEX(.var\swebdata_today_e.{4}(\d.\d
).)]"}
Number Sofar_energy_total (Sofar_group) {http="<[http://X.X.X.X/status.html{Authorization=Basic abcabcabc}:1200000:REGEX(.var\swebdata_total_e.{4}(\d.\d
).*)]"}

Needs http binding and REGEX transform.
Replace X.X.X.X with your IP and abcabcabc with your user:passwor encoded (instruction in http binding)

Then you can use persistence to store and display data. (i am using infuxdb + graphana)

You can also adjust time interval.

It is example of .item file ? What about .thing ?

The given Items example uses HTTP binding version 1, so there are no Things and channels involved there.

There’s enough information there to make an HTTP Thing and channels to use the newer binding.

I am capturing the data from my Solis using a TCP node in NodeRed because there is currently no TCP binding in OH3 to receive the data as a “second server”.

Roughly this is the way it works:
Set the second server in the inverter to the IP of the NodeRed server with a static port number.
Configure a TCP node in NodeRed to capture the data from the inverter.
Configure an item node in NodeRed to send the data to openHAB.
Process the incoming data with a rule which updates the items.

Items I have are:
Solar generation
AC voltage and current
Frequency
DC voltage and current
Generation today
Total generation
Internal temperature

There are probably others in the data but not of significant interest.

A TCP binding would mean not having to use NodeRed.