Are you trying to write something into solar-pv1-current channel? You can try to enable trace logs for solarman to check what messages system is sending into this channel (in openhab console run `log:set TRACE org.openhab.binding.solarman`)
To make channel writable you need to add readOnly=false inside THINGS file, not items. So you’ll have something like
Thing solarman:logger:local [ hostname="xxxx", inverterType="xxxx", serialNumber="xxxx" ] {
Channels:
Type number : tou-battery-soc-1 [scale="1", uom="%", rule="1", readOnly="false", registers="0x00A6"]
}
Then you connect item to that channel in items file and when you’ll send some number command (between 0 and 100, don’t recommend putting 0 - you don’t want to discharge battery so much ) to that item it should write it to invertor
tbh, I haven’t tried configuring things in UI Try to do it in things file
Ok, now I know what’s happening - when you update items file system is sending Refresh command to each channel and this warning is logged when we try to process incomming commands… Probably I need to add an exception for Refresh command and just ignore it as we are using polling to read data from logger
Just to report back that I already tested and it is working perfectly fine. I was a little confused in the beginning because I thought that we only needed a single channel. Afterwards I understood that we have to have duplicate channels one for reading and nother for wrting
Sorry for my late reply. When I created the Things file just with the inverter and no channels, It automatically created all the channels for me and I could not edit the created ones, so I created new channels that where the ones I intended to write to and used the automatically created ones for monitoring only.
Isn’t it supposed to be like this? I guess not .
Well, it is all working.
Do you think I should create it all again?
If possible could you also add these time of use settings as writable from the start for the type deye_hybrid that is the one that I am using?
Just checked the deye_hybrid definition and yeah, that one already contains some Time Of Use registers defined, but not writable. As I see register addresses are different from those in deye_sg01hp3 or deye_sg04lp3, but if you confirm that it’s working when you write to manually created channels with these addresses then I can just make them writeable.
I have made almost all ToU attributes there writable. One thing I’m a bit confused about is that we have Time of Use Enable 1 and similar channels there, which are supposed to use mask to manipulate register, but that functionality is missing inside binding (also this requires read-manipulate-write sequence as we can’t rely on register value we have - it could be outdated). So I have not touched that channels and they still will be read-only
Hi again, I just wanted to ask if there was some progress in the AT Modbus topic still very interested, and actually all Deye based microinverters need that enabler…
In this binding the parameter inverterType is both required (as in thing-types.xml) and has a default value. The parameter should either be mandatory, or have a default value. I prefer if it is required, as in my case the default value makes no sense.
The Solarman logger openHAB binding does apparently two tasks at the same time: it unwraps the Modbus communication, wrapped by the Solarman logger hardware, and offers profiles (set of preconfigured registers) for some devices (Sofar, Deye, Kstar inverters).
It would be reasonable to split the functionality into two:
A Solarman logger—Modbus Bridge, which could be used e.g. to connect from openHAB to a SunSpec device, tunneled over Solarman logger hardware
Device profiles, which work with any Modbus bridge
This would allow very easy to switch the communication from RS232 port → Solarman logger → Wifi → OpenHAB to RS232 port → serial-to-usb-cable → OpenHAB. Such switch is currently very cumbersome.
I have been working on an extension to the existing Solarman binding because I am missing some functions in the existing binding and would appreciate your advice on sharing it for community testing and potentially contributing it upstream.
The extension preserves the existing legacy profiles and adds optional advanced profiles based on the sensor and register definitions from kellerza/sunsynk. These definitions are pinned to a specific revision, with attribution and licensing information retained.
The work also includes serialized polling and commands, register readback to confirm writes, a limited retry after a confirmed mismatch, and more detailed communication diagnostics.
So far, hardware testing has been carried out on my Deye SUN-8K-SG01LP1-EU. The readings tested have matched expectations, and I have successfully tested writing the SOC settings for all six Time of Use periods and switching Solar Export on and off. Changes made directly on the inverter have also been reflected in openHAB. Other profiles and controls still need hardware validation.
Before publishing anything, I would like to ask:
Would a fork of openhab-addons, with a feature branch and GitHub pre-releases containing test JARs, be the preferred approach?
Would it be useful to provide separate builds for openHAB 5.2 and 5.3 SNAPSHOT?
Should I open an enhancement issue or a draft PR before inviting wider testing?
Are there any particular expectations or issues for incorporating and maintaining register definitions derived from Kellerza?
My aim is to extend the existing binding while preserving legacy support and gather feedback before considering an upstream contribution.
Thanks for asking before publishing. I haven’t had time to work on the binding lately, and since it solves my own problem I’ve had little motivation to change it, so I’m glad someone is picking it up.
I’d go straight to a PR against the latest openhab-addons main. People who want to test can build from your PR branch for the version they run, so you don’t need separate 5.2 and 5.3 builds and the feedback stays in one place. The openHAB contributing guide asks for an issue before larger changes, so I’d open a short enhancement issue that links this thread and reference it from a draft PR.
In the PR description I’d cover what it’s meant to do, which profiles are tested on real hardware and which aren’t, and how you made sure there are no regressions. Unit tests are expected, and it would help to have tests showing the legacy profiles still produce the same channels and register requests as before, so existing setups keep working. Sign off your commits with git commit -s.
kellerza/sunsynk is Apache-2.0, so deriving from its definitions is fine as long as the license and attribution stay with them, which you’re already doing. I’d mention it in the PR and add it to the README acknowledgments, like the binding already does for Stephan Joubert’s Home Assistant plugin. Reviewers can then say if they want anything else.
For the write part, I think it fits best as actions on the binding, since that makes writing rules much easier. It’s also a good place for your readback and retry logic, for example one call that sets a whole ToU period. The existing writable channels should keep working as they do now. Because this writes to the inverter, I’d document the risk clearly (kellerza’s README carries a similar warning) and validate values before writing.
@dpa-openhab’s idea of splitting the Solarman unwrapping from the device profiles is a good one. I wouldn’t require it for a first PR, but keeping that boundary clean in the code would make a later split much easier.
For deciding how to proceed use common sense. The .jar file for Solarman does not include in METAINF/MANIFEST.MF:Import-Package: version requirements for openhab itself, so likely the same .jar works with many openHAB versions.
I have published my changes to this binding at Solarman for Deye SG02LP1 inverter [5.2.0;6.0.0) . It uses milliseconds for the periods, instead of seconds; eliminates the default hardware, so that it has to be set explicitly; and removes some stuff to make the .jar file smaller. For the record, published .jar/.kar files on the market place can be further reduced by recompressing them with advzip -z4 $(find target -name '*.[jk]ar').
With Deye inverters different models (with distinct market names) can use the same modbus register differently.
On a different note, I want to be able to switch between these modes without “Time of use”:
use power from the grid, do not charge or discharge the battery
use power from the grid, charge the battery
do not use power from the grid, use power from the battery
In all of the above cases, if there is power from the Sun, it is used, and no power is returned to the grid.
Any suggestion how to change the above modes using the display of the device? How can I switch between the above modes from openHAB?
@Catalin_Sanda I’ll proceed as you suggested: open an enhancement issue linking this discussion, followed by a draft PR against the latest openhab-addons main.
The optional advanced profiles use pinned Kellerza definitions, providing broader monitoring and control coverage for supported Deye/Sunsynk models, including profile-specific conversions, shared-register controls and dependent write limits. The existing legacy selections remain available.