jEEBus.SPINE

This repository contains the Java implementation of the Smart Premises Interoperable Neutral-message Exchange (SPINE) which represents the information layer of the EEBus Communication Standard, containing its data model. It is developed and maintained by the Team Smart Grid Communication at the Fraunhofer Institute for Solar Energy Systems ISE. For further information please refer to our website.

The SPINE Specification can be downloaded from the website of the EEBus Initiative e.V.

Key Features

jEEBus.SPINE provides an easy-to-use API and features many abstractions and automations to make EEBus use case development more efficient.

Contributing

If you would like to contribute to this project, please use the contact form on our website to get in touch with the development team.

Project Setup

This is a Gradle Project that comes with a packaged Gradle Wrapper (use ./gradlew on Linux and gradlew.bat on Windows systems). You can run the following command to download all necessary dependencies and build the project:

./gradlew clean build

To run all contained unit tests, run

./gradlew test

There are three subprojects in the projects folder. spine contains the general implementation of SPINE, while spine-test-utilities provides a framework to develop automatic tests for SPINE applications. demo contains minimal example applications showing how jEEBus.SPINE can be configured and used.

User guide

This section provides a short overview on how to use jEEBus.SPINE in your projects. A demo subproject containing example classes can be found in the downloadable Project in the Download section of our website.

Use jEEBus.SPINE as a library

This library is available on MavenCentral. The concrete way to add it as a dependency to your project depends on the build tool you are using. It is recommended to use the latest available version.

with Gradle

implementation 'org.openmuc.jeebus:spine:3.0.0'

with Maven

<dependency>
  <groupId>org.openmuc.jeebus</groupId>
  <artifactId>spine</artifactId>
  <version>3.0.0</version>
</dependency>

Set up a SPINE device

  1. Creating a SPINE device that is not connected to SHIP is not practical in most cases. Thus, it is recommended to start by configuring a SHIP node by creating a new instance of ShipNodeConfiguration.

  2. The jEEBus.SPINE package org.openmuc.jeebus.shipspine contains classes to connect it to jEEBus.SHIP. The easiest way to do this is to create a ShipCommunication instance as shown below. However, you can also cusomize this logic by implementing the Communication interface.

  3. The final step consists of building the SPINE device itself. To do this, you can use a dedicated builder class like so:

    The created SPINE device will now be visible for EEBus communication in the specified network. It will automatically try to connect to other EEBus devices via SHIP and handle SPINE DetailedDiscovery and UseCaseDiscovery processes.

For the complete example Java class, please refer to the MinimalExampleDevice in the demo subproject.

Implement an EEBus use case

This section demonstrates how to implement a use case, how to listen for valid use case partners, and lastly how to communicate with remote SPINE devices.

  1. To implement a specific use case, create a new class implementing the UseCase interface.

  2. You need to implement getter methods for the actor, name, version and supported scenarios of the use case as per its specification.

  3. The getAddress method should return top-level address under which all scenarios of the UseCase can be accessed. Normally, this is the address of the entity the use case is registered on.

  4. There are setup methods that are called when building the SPINE device. Firstly, you can add or assign the entity address in the setup method for the DeviceBuilder:

  5. In the setup method for the EntityBuilder you can initate the SPINE features needed for the use case:

  6. The setDevice method is called once the SPINE device is built. It is good practice to keep a reference to it and to use the automatic Discovery API to identify valid use case communication partners. Please refer to the JavaDoc of the method for detailed information on the paramaters. Here is an example:

  7. In the example above, we define that a method named startUseCase should be called when valid use case partners are identified. That means when the method is called, we can be sure there is a remote SPINE device connected to ours that supports the desired actor of our use case, and we can communicate with it. Here is how the method may look:

For a complete example Java class, please refer to the ExampleUseCase class in the demo subproject. Lastly, you can refer to the JavaDoc of the UseCase interface.