Hello all,
Using the technical details provided by Victron Energy in one of their PDFs, I was able to create a small Java library to discover VE.Direct USB devices and read data from them. I needed this for my MPPT Charge controller but it should be usable with more or less any VE.Direct device.
https://github.com/kazetsukaimiko/victron-java
This library uses Java 9+ Streams. It has a single dependency of JSSC, although there is an abstraction layer built in so that can be removed if necessary. It can also be used to read events from the command line, and has nice helper code to convert electrical units.
I wanted to put this out there and get an idea of how useful it might be to others. It is well tested with 80%-90% code coverage. I organized it to support more protocols than VE.Direct, but as I currently don't have any Victron devices that use other protocols I have omitted writing in support for them, but feel free to submit feature requests via the GitHub Issue tracker.
I intend to maintain this library and eventually get it into Maven central for easy import into Maven/Gradle projects. To test it you will need git, maven, and Java 11+. You can then checkout the code:
git clone https://github.com/kazetsukaimiko/victron-java.git && cd victron-java
And run the CLI Monitor:
mvn exec:java -Dexec.mainClass="kaze.app.ShowDevices"