Ginlong Solis solar inverter monitoring

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.

Hi,
Thanks for interesting solution…
I’m using OH2.5. I’ve installed http bindings, regex transformations.
I’ve copied your code to sofar.items and and can’t get any item…
I’ve encoded username:pass and have chaned IP…
In openhab.log I can find:

[WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘sofar.items’ has errors, therefore ignoring it: [2,40]: mismatched character ‘s’ expecting set null
[2,147]: mismatched input ‘webdata_now_p’ expecting RULE_STRING
[2,164]: missing EOF at ‘(’
[4,47]: mismatched character ‘s’ expecting set null
[4,186]: mismatched character ‘’ expecting ‘"’

I’ve tried to update informations, made some changes, have read documentation and nothing helped…
Is it possible, that sofar is offline at this moment and can’t get anything?

Kind regards

Something wrong with your configuration in that file.

Have you ever made an xxx.items file before? Some editors include characters that are not wanted. Be sure to use encoding UTF-8 and linux style newline, not windows style carriage return + newline.

Otherwise, let’s see the first few lines of your solar.items file.

Hello Chris,
Strange things, when i am copying text to forum (both ways directly and through quotation) it removes some chars from text. I cant solve it. Please find full correct text via picture:

Please find attached as text file.

sofar.items.txt (501 Bytes)

When you copy-paste other peoples stuff, you need to take care about quotemarks.
You must use the correct quotemarks in your config files, check carefully.

"these are the correct marks"
“these are the wrong marks”

This is why we tell people to use code fences when posting.

Thank you Rossko. Quotemarks in config files are ok. Looks like when putting into forum it is removing some \ and *. Code fences solved it.

Chris please find bellow:

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*).*)]"

Yesterday’s answer from my phone so here’s a bit more detail:

Inverter programmed with IP of OpenHAB server and port 8900 as “second server”

NodeRED TCP In node:

Connected to OpenHAB2 out node:

Items:

String Solar_rx_data "Data recieved from the inverter [%s]"
Number:Power Solar_watt_now "Current solar generation [%.0f W]"
Number:Energy Solar_kwh_day "Solar generated energy today [%.1f kWh]"
Number:Energy Solar_kwh_total "Solar generated energy [%.0f kWh]"
Number:ElectricPotential Solar_dc_volts "Solar array DC [%.1f V]"
Number:ElectricCurrent Solar_dc_amps "Solar array DC [%.1f A]"
Number:ElectricPotential Solar_ac_volts "Solar AC [%.1f V]"
Number:ElectricCurrent Solar_ac_amps "Solar AC [%.1f A]"
Number:Frequency Solar_ac_freq "Solar AC [%.2f Hz]"
Number:Temperature Solar_temp "Temperature at solar inverter  [%.1f °C]"

Rule:

rule SolarProcessRx
when
        Item Solar_rx_data received update
then
        val String rxdata = Solar_rx_data.state.toString
        val rxbytes = rxdata.getBytes("ISO-8859-1")
        if (rxdata.substring(0,3) == "hYQ") { //if this is a relevant message
//              logWarn ("rules.SolarProcessRx" , "Header OK") // Uncomment this line to check if the header from your inverter matches. If not, amend the 3 characters in the line above to suit.
               var Number databyte = rxbytes.get(31)*256 + rxbytes.get(32) //Temperature
                var Number value = databyte/10
                Solar_temp.postUpdate(value)
                databyte = rxbytes.get(33)*256 + rxbytes.get(34)        //DC Voltage
                value = databyte/10
                Solar_dc_volts.postUpdate(value)
                databyte = rxbytes.get(39)*256 + rxbytes.get(40)        //DC Current
                value = databyte/10
                Solar_dc_amps.postUpdate(value)
                databyte = rxbytes.get(45)*256 + rxbytes.get(46)        //AC Current
                value = databyte/10
                Solar_ac_amps.postUpdate(value)
                databyte = rxbytes.get(51)*256 + rxbytes.get(52)        //AC Voltage
                value = databyte/10
                Solar_ac_volts.postUpdate(value)
                databyte = rxbytes.get(57)*256 + rxbytes.get(58)        //AC Frequency
                value = databyte/100
                Solar_ac_freq.postUpdate(value)
                databyte = rxbytes.get(59)*256 + rxbytes.get(60)        //Current generation Watts
                Solar_watt_now.postUpdate(databyte)
                databyte = rxbytes.get(69)*256 + rxbytes.get(70)        //kWh today
                value = databyte/100
                Solar_kwh_day.postUpdate(value)
                databyte = rxbytes.get(72)*65536+rxbytes.get(73)*256 + rxbytes.get(74)  //Total kWh
                value = databyte/10
                Solar_kwh_total.postUpdate(value)
                }
end

If there’s ever a TCP binding for OH3, it will negate the need to use NodeRED as a listener but the rest of the config can stay the same.

The data comes direct from the inverter so doesn’t require a Ginlong Monitoring account.

Thank U both Rossko And Marcin…
I’m using vi editor under Pi or sublime on Ubuntu - so I’ve checked first code with documentation few times and everything was pointing on regex… I’m happy to see that in fact the problem was in that piece of code :slight_smile: Thank U both very much :slight_smile:
As far as I know IP address is IP of sofar logger when its online?
At this moment it’s offline and can’t check how it works… Anyway - i’ll check tomorrow. Regards Chris

Thanks again Marcin. All is working :slight_smile: I was considering to connect sofar with modbus - U saved my time… Modbus i’ll try to use with energy meter - i’ve seen Rossko mentioned about it on other topic… All the best & Cheers!

Hello Chris,
What energy meter do you mean? This from energy provider company?

nope - I would rather to get some other like Lumel or Schneider 3 phase with modbus communication… I could check provider’s energy meter :slight_smile: I’d like to see what is daily consumption…

In Poland (for solar installations) we have meters from energy provider where usage is by hours. I can get this from their page.

Marcin I live in PL as well :slight_smile: Which provider is it? I don’t think it’s ENEA :frowning: Anyway - there are different measurements on sofar and on provider’s energy meter - so I would like to see what is my consumption…

Continuing the discussion from Ginlong Solis solar inverter monitoring:

Hi,

I also have the same issue, web version 1.0.23. remote server B in not connected status whatever I set the “remote server” page under the “advanced” menu.
I also confused by the setting of the “ip address” and the “domain name”.
What’s the use of the domain name? ip address looks enough for data logger to find the remote server.

Is there anyone succeed with the remote server B setup?

Regards,
William