https://github.com/enbility/eebus-go
EEBUS protocol implementation in go
https://github.com/enbility/eebus-go
charging-stations eebus electric-vehicles emobility energy-management energy-management-systems
Last synced: 7 months ago
JSON representation
EEBUS protocol implementation in go
- Host: GitHub
- URL: https://github.com/enbility/eebus-go
- Owner: enbility
- License: mit
- Created: 2022-04-11T13:29:20.000Z (about 4 years ago)
- Default Branch: dev
- Last Pushed: 2025-10-29T15:49:41.000Z (8 months ago)
- Last Synced: 2025-11-14T06:02:36.659Z (7 months ago)
- Topics: charging-stations, eebus, electric-vehicles, emobility, energy-management, energy-management-systems
- Language: Go
- Homepage: https://enbility.net
- Size: 2.57 MB
- Stars: 91
- Watchers: 15
- Forks: 41
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- open-sustainable-technology - eebus-go - Enable your products and services to support the energy management protocol EEBUS, the communication interface that enables energy management relevant devices in buildings to connect and interact with each other and with grid and market operators. (Energy Systems / Energy Data Accessibility and Integration)
README
# eebus-go
[](https://github.com/enbility/eebus-go/actions/workflows/default.yml/badge.svg?branch=dev)
[](https://godoc.org/github.com/enbility/eebus-go)
[](https://coveralls.io/github/enbility/eebus-go?branch=dev)
[](https://goreportcard.com/report/github.com/enbility/eebus-go)
[](https://www.codefactor.io/repository/github/enbility/eebus-go)
[](https://deepwiki.com/enbility/eebus-go)
This library provides a foundation for implementing [EEBUS](https://eebus.org) use cases in [go](https://golang.org). It uses the SHIP implementation [ship-go](https://github.com/enbility/ship-go) and the SPINE implementation [spine-go](https://github.com/enbility/spine-go). Both repositories started as part of this repository, before they were moved into their own separate repositories and go packages.
Basic understanding of the EEBUS concepts SHIP and SPINE to use this library is required. Please check the corresponding specifications on the [EEBUS downloads website](https://www.eebus.org/media-downloads/).
## Introduction
The supported functionality contains:
- Support for SHIP 1.0.1 via [ship-go](https://github.com/enbility/ship-go)
- Support for SPINE 1.3.0 via [spine-go](https://github.com/enbility/spine-go)
- Certificate handling
- mDNS Support, incl. avahi support
- Connection (websocket) handling, including reconnection and double connections
- Support for handling pairing of devices
## Packages
- `api`: global API interface definitions and eebus service configuration
- `features/client`: provides feature helpers with the local SPINE feature having the client role and the remote SPINE feature being the server for easy access to commonly used functions
- `features/server`: provides feature helpers with the local SPINE feature having the server role for easy access to commonly used functions
- `service`: central package which provides access to SHIP and SPINE. Use this to create the EEBUS service, its configuration and connect to remote EEBUS services
- `usecases`: containing actor and use case based implementations with use case scenario based APIs and events
## Examples
The examples folder contains a few demo applications using this stack. These do **not** provide complete implementations of any use case, but are intended as usage guidelines for the eebus-go stack in general and to have a quick demo.
Therefore, please do not expect any of these examples to provide any meaningful functionality on their own, but instead view them as rough guidelines on the functionality you could implement using the eebus-go stack.
### Controlbox
This includes example code for sending an LPC limit 5 seconds after connecting to a compatible device that can receive LPC limits.
#### First Run
```sh
go run examples/controlbox/main.go 4713
```
`4713` is the example server port that this process should listen on
The certificate and key and the local SKI will be generated and printed. You should then save the certificate and the key to a file.
#### General Usage
```sh
Usage: go run examples/controlbox/main.go
```
- `remoteski` is the SKI of the remote device or service you want to connect to
- `certfile` is a local file containing the generated certificate in the first usage run
- `keyfile` is a local file containing the generated key in the first usage run
### HEMS
This includes example code for accepting LPC and LPP limits from a control box, receiving and printing data to the console from battery (VABD) and pv inverters (VAPD) and grid connection point data (MGCP).
#### First Run
```sh
go run examples/hems/main.go 4714
```
`4714` is the example server port that this process should listen on
The certificate and key and the local SKI will be generated and printed. You should then save the certificate and the key to a file.
#### General Usage
```sh
Usage: go run examples/hems/main.go
```
- `remoteski` is the SKI of the remote device or service you want to connect to
- `certfile` is a local file containing the generated certificate in the first usage run
- `keyfile` is a local file containing the generated key in the first usage run
### EVSE
This includes example code for accepting LPC from a control box.
#### First Run
```sh
go run examples/hems/main.go 4715
```
`4715` is the example server port that this process should listen on
The certificate and key and the local SKI will be generated and printed. You should then save the certificate and the key to a file.
#### General Usage
```sh
Usage: go run examples/evse/main.go
```
- `remoteski` is the SKI of the remote device or service you want to connect to
- `certfile` is a local file containing the generated certificate in the first usage run
- `keyfile` is a local file containing the generated key in the first usage run
### Explanation
The remoteski is from the eebus service to connect to.
If no certfile or keyfile are provided, they are generated and printed in the console so they can be saved in a file and later used again. The local SKI is also printed.
## SHIP implementation notes
- Double connection handling is not implemented according to SHIP 12.2.2. Instead the connection initiated by the higher SKI will be kept. Much simpler and always works
- PIN Verification is _NOT_ supported other than SHIP 13.4.4.3.5.1 _"none"_ PIN state is supported!
- Access Methods SHIP 13.4.6 only supports the most basic scenario and only works after PIN verification state is completed.
- Supported registration mechanisms (SHIP 5):
- auto accept (without any interaction mechanism!)
- user verification
This approach has been tested with:
- Elli Charger Connect
- Porsche Mobile Charger Connect
- SMA Home Energy Manager 2.0
## Interfaces
### Verbose logging
Use `SetLogger` on `Service` to set the logger which needs to conform to the `logging.Logging` interface of [ship-go](https://github.com/enbility/ship-go).
Example:
```go
configuration = service.NewConfiguration(...)
h.myService = service.NewEEBUSService(configuration, h)
h.myService.SetLogging(h)
```