[new binding] Logger LSW for Sofar/Omnik/IE for SolarmanPV based on protocol v5 (iGEN tech)

The binding is working fine for me, but there are a few observations:

  • Logger is also sending some data that are not recognised, maybe this will help decode them:
2022-05-15 10:39:15.432 [WARN ] [al.protocolv5.UnknownResponseHandler] - Unknown response from logger xxxx, length 14: A501001047000EEED5A166003015
2022-05-15 10:45:42.474 [WARN ] [al.protocolv5.UnknownResponseHandler] - Unknown response from logger xxxx, length 138: A5610010150015EED5A1660201D717841B610200005DA5FC4601034E00020000000000000000000010FC008415290148003700B000E2FF90138B09BD015B09C2015209C10156000046E7000018EF0A30016A00290032197B10E11506003C0000000100000487000000009F7E1715A5010010470016EED5A166003815A5010010470017EED5A166003915
  • When logger goes offline at night, the reconnection attempts produce exceptions in the log file, that just causes the log file to grow and get dirty. I would prefer if these were not logged as they are normal situation.
  • For the midnight, the daily production should reset internally, as the logger will be offline. I display on a wall tablet the daily production and daily consumption from the energy meter and the second resets at midnight but the first stays until the morning. That could be a configuration option how to behave here.
  • There was a question about how the binding should behave at night. I think it can keep on trying to reconnect at some intervals, if it does not dump exceptions to the log. It could try to ping the device, but echo requests may be filtered on some routed networks. Maybe we could make use of the sunrise/sunset hours calculated based on location position, which can be configured in OH. When there is sunrise + some time and device is not up, it is likely there is fault. It will be detected earlier than with the max timeout approach. In hours between sunset + some time until sunrise - some time the binding can stop attempts to reconnect. It all could be of course configurable, so users can choose other approaches if the want.
    Great job on the binding, it is very useful for me!

OK, I have this results for device serial number 23146XXXXX with firmware version
LSW3_15_FFFF_1.0.65. No data received. Are you planing to add support for other protocols in future @Piotr_Bojko ?

15:37:15.714 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNINITIALIZED to INITIALIZING
15:37:15.722 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from INITIALIZING to UNKNOWN
15:37:15.805 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:37:15.805 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A5100010150082CAAAF68902015C9D0D003D290000C553A06206003915
15:39:15.808 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 14: A5010010470083CAAAF68900CE15
15:41:15.810 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 43: A5100010150084CAAAF6890201D49D0D00B5290000C553A06206002B15A5010010470085CAAAF68900D015
15:43:15.812 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A5100010150086CAAAF68902014C9E0D002D2A0000C553A06206001F15
15:44:03.135 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from ONLINE to UNKNOWN
15:44:03.159 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A5100010150008CAAAF6890201EC9E0D009B000000D753A06206009715
15:44:03.160 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:44:06.578 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from ONLINE to UNKNOWN
15:44:06.593 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A5100010150009CAAAF6890201EF9E0D009F000000D753A06206009F15
15:44:06.593 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:44:16.682 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from ONLINE to UNKNOWN
15:44:16.903 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A510001015000ACAAAF6890201F99E0D00A9000000D753A0620600B415
15:44:16.905 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:45:15.813 [WARN ] [.internal.protocolv5.LswLoggerHandler] - Context is closed, not switching to org.openhab.binding.lswlogger.internal.protocolv5.states.SendingRequestState@1def46d
15:45:47.508 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from ONLINE to UNKNOWN
15:45:48.160 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A510001015000CCAAAF6890201559F0D0004010000D753A06206006F15
15:45:48.160 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:46:03.160 [WARN ] [.internal.protocolv5.LswLoggerHandler] - Context is closed, not switching to org.openhab.binding.lswlogger.internal.protocolv5.states.SendingRequestState@52c38d67
15:46:06.594 [WARN ] [.internal.protocolv5.LswLoggerHandler] - Context is closed, not switching to org.openhab.binding.lswlogger.internal.protocolv5.states.SendingRequestState@75267c2e
15:46:16.906 [WARN ] [.internal.protocolv5.LswLoggerHandler] - Context is closed, not switching to org.openhab.binding.lswlogger.internal.protocolv5.states.SendingRequestState@7e2815a6
15:46:55.940 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from ONLINE to UNKNOWN
15:46:56.158 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A510001015000DCAAAF6890201999F0D0048010000D753A0620600F815
15:46:56.160 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:46:56.162 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'LSWLogger_Online' changed from NULL to ON
15:46:57.874 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from ONLINE to UNKNOWN
15:46:58.090 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 29: A510001015000ECAAAF68902019A9F0D004A010000D753A0620600FC15
15:46:58.090 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'lswlogger:LSWLoggerV5:falownik' changed from UNKNOWN to ONLINE
15:47:48.162 [WARN ] [.internal.protocolv5.LswLoggerHandler] - Context is closed, not switching to org.openhab.binding.lswlogger.internal.protocolv5.states.SendingRequestState@3adc96c1
15:48:56.160 [WARN ] [.internal.protocolv5.LswLoggerHandler] - Context is closed, not switching to org.openhab.binding.lswlogger.internal.protocolv5.states.SendingRequestState@1d397374
15:48:58.093 [WARN ] [nal.protocolv5.UnknownResponseHandler] - Unknown response from logger falownik, length 14: A501001047000FCAAAF689005A15

Hello,
I have a device serial with SN: 2336xxxxxx and firmware LSW3_15_FFFF_1.0.78.
I connected to the LSW Logger it came online, but all the values are wrong, reading static(not updating) or senseless data.
@Piotr_Bojko are you planning to work on this? I am happy to contribute towards those efforts.
What is more important to me (which seems to be missing here) is reading the backup battery information.
That is are they charging or discharging, and if they are full. Only then i can put meaningful realtime rules to maximize my available PV power while prioritizing the batteries (ensuring they are not being discharged during the day).

@wars has a big list of attributes, can these be added to logger to read in realtime as opposed to going o the solarman api (which is delayed 15 minutes) while is good for logging through grafana would be not suite the need for near realtime reactions.
Looking forward to having back.
Espresso

@Piotr_Bojko when I try to activate your binding in karaf, I get

Error starting bundle 266: Could not resolve module: org.opehnab.binding.lswlogger [266]
Unresolved requirement: Import-Package: org.openhab.core.library.unit

Any idea anyone how I can solve this? I am running openhab 2.5.12
Thanks!
Tomek

I didn’t test it against 2.5.x flavours. Sorry :slight_smile:

I think I will release the plugin either as a pull request to standard builtin oh addons or as a standalone bundle to marketplace. In either ways it will be possible to tinker it to cover more logger firmware versions or oh (like 2.5.x)

Try in a console feature:install [look for anything that might resemble the missing package]

After using it for months, I notice the binding occasionally, every few weeks stops working silently.
The thing status is still online, but there are no updates to the state and binding stops contacting the logger. What helps is starting the thing again, like changing a configuration to force initialization.
This is pretty consistent. All other bindings and openhab work fine when this happens.
Anyone else noticed such behavior?
I have started it now with debug logging.

I am aware of that - I have it reported by someone. I cannot trace it, though I have it once on my own setup, but only once.

Is it possible to use some parts of methodology used in:

https://github.com/MichaluxPL/Sofar_LSW3

to add support for v5 protocol version ?

But this binding should support (more or less) only v5 protocol.

Hi @Piotr_Bojko

i’am tryiing to get your binding up and running with a logger with sn 23XXXXXXXX, but i get an NumberFormatException because of the datatype int used in LoggerThingConfiguration. Could you pls change that to long?

[re.config.core.internal.ConfigMapper] - Could not set field value for field ‘serialNumber’: For input string: “23XXXXXXXX”
java.lang.NumberFormatException: For input string: “23XXXXXXXX”
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
at java.lang.Integer.parseInt(Integer.java:652) ~[?:?]
at java.lang.Integer.valueOf(Integer.java:983) ~[?:?]
at org.openhab.core.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:153) ~[bundleFile:?]
at org.openhab.core.config.core.internal.ConfigMapper.as(ConfigMapper.java:97) [bundleFile:?]
at org.openhab.core.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
at org.openhab.core.thing.binding.BaseThingHandler.getConfigAs(BaseThingHandler.java:218) [bundleFile:?]
at org.openhab.binding.lswlogger.internal.protocolv5.LswLoggerHandler.initialize(LswLoggerHandler.java:74) [bundleFile:?]
at jdk.internal.reflect.GeneratedMethodAccessor126.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]

thx an br

Hmm, could you try to make the PR to my repo for this?

Anyway, after catching some air and spare time I will check this. Quick look leads to discovery that int type is used in a serialization logic in some request frames in protocol. So it is not only a type change.

Hi,
I have tried to install binding in OH 3.3. Installed from CLI but:

  • there is no binding or such thing available in GUI
  • after manually add thing in the config file I get in logs:
    openhab.log:2022-11-29 12:11:05.862 [INFO ] [.thing.internal.GenericThingProvider] - No ThingHandlerFactory found for thing lswlogger:LSWLoggerV5:sofar (thing-type is lswlogger:LSWLoggerV5). Deferring initialization.

in console
315 │ Installed │ 80 │ 3.1.0.202109222126 │ openHAB Add-ons :: Bundles :: LswLogger Binding

anyone can help?

Most likely you should add binary file of the binding to your “openhab/addons/” folder by hand.

This binding is not in official marketplace so it wont be downloaded automatically.

installation done, I needed to activate it from CLI. No I can see in GUI as well. I started configure channels, basically map them to the Items.
Now got:
2022-11-29 13:06:25.371 [WARN ] [al.protocolv5.UnknownResponseHandler] - Unknown response from logger sofar, length 43: A51000101500133787998B02019240000022040000B7B4856306007E15A50100104700143787998B004E15
2022-11-29 13:04:25.360 [WARN ] [al.protocolv5.UnknownResponseHandler] - Unknown response from logger sofar, length 29: A51000101500103787998B02011A400000AA030000B7B4856306008A15
2022-11-29 13:02:25.350 [WARN ] [al.protocolv5.UnknownResponseHandler] - Unknown response from logger sofar, length 14: A501001047000F3787998B004915

but as @espresso I have a device serial with SN: 2342xxxxxx and firmware LSW3_15_270A_1.50.

status is detected:

but current Power or energy Total not:

Each new inverter with higher SN may be updated with newer firmware.

I am open to help but without information how to decode the message from the new firmware - I can’t do much, I am afraid.

Try to look though github or other places if someone cracks the messages from your device.

found this documentation:

and also project contains xml with mapping. I will test script later today to see if can connect.

this also could be useful for new version of LSW3

Cześć @Piotr_Bojko ,

I realised that can’t check too much in the evening as PV doesn’t work :slight_smile:
I spent hours for searching right codes for new series of Sofar Solar inverters. I think I found the best set for implementation. It is not fully specification but gets values for the most required parameters.

Would you take a look and check if you are able adjust registers to the ones listed in this thread? It is excact HW I have inverter KTLX-G3 series.

I will be happy to test.