Nifty SunSpec is a delightful little SunSpec client library written in Java. It aims to be easy to use, reliable, and cover the most common SunSpec use cases around integrating with SunSpec-compatible devices. It requires a minimum of Java 17 to use.
This code was spun out of the SolarNode project after many years of happy use collecting data from many, many SunSpec devices over many, many, many moons.
The shell project is an interactive command-line application for interrogating SunSpec devices over Modbus TCP or RTU, which can be compiled into a native executable with GraalVM.
This library does not provide a modbus client library. Instead it defines a core ModbusConnection
interface, and you must provide an implementation of that API at runtime.
Nifty SunSpec can be integrated into your project using the following coordinates,
all of which use the net.solarnetwork.common Group identifier:
| Artifact | Notes |
|---|---|
nifty-sunspec-api |
The high-level interfaces. |
nifty-sunspec-core |
The core implementation. |
Typically it is sufficient to declare just the nifty-sunspec-core in your project. For example in
a Gradle project:
dependencies {
implementation 'net.solarnetwork.common:nifty-sunspec-core:1.0.0'
}To build Nifty SunSpec yourself, clone or download this repository. Note that Java 25+ is required for building. Then:
# Linux/macOS/etc
./gradlew build -x test
# Or Windows
.\gradlew.bat build -x testThe component artifacts will be created within the build/libs directory of each component:
api/build/libs/nifty-sunspec-api-X.Y.Z.jarcore/build/libs/nifty-sunspec-core-X.Y.Z.jarshell/build/libs/nifty-sunspec-shell-X.Y.Z.jar