Ginlong Solis solar inverter monitoring

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

Mine is working fine.

I assume you need a server for the logger to find and connect to. I capture the incoming string with NodeRed (see post above). My logger is version 1.0.57 so I don’t know if that makes a difference.

Server B does not work under some firmware versions. Instead you can redirect the output entirely by going to /config_hide.html

See algodynamic - Reverse Engineering the Solis/Ginlong Inverter Protocol for some information.

Also

Also from Poland, you should check orno we-517 , it,s two way energy meter with serial modbus. It has energy monitoring per phase also.

P.S in my OH3 Regex transformation is working strange, i still don,t have data from datalogger stick… ;-(

//edit
in regex pattern should be one “slash” not two “slash” - wow… now its working

1 Like

I’ve not checked what it does but does the upgrade option work to take you to a version where the Server B does work?

I don’t know. As I have a working monitor I’m reluctant to change the firmware in case the protocol changes.

Understandable. You would hope that upgrading using the OEMs upgrade tool shouldn’t break anything but we’ve all had to spend time unpicking stuff we hoped would work!