Skip to content

larmic-iot/sonnen-charger-api

Repository files navigation

sonnen-charger-api

License Go build Docker build and push Docker hub image Docker Image Version (latest by date)

NOTE this application is still in development and a very early version.

A REST api client (adapter) for the sonnenCharger. Sonnen does not support the REST api of the charger. So this app is using Modbus. REST endpoints documented in open api 3.1.

This project inspired by tp-link-hs110-api written in go and improves my Go knowledge. Project layout is based on golang-standards.

Other sonnen charger api using modbus projects

Versioning

Semantic Versioning 2.x is used. Version number MAJOR.MINOR.PATCH with

  • MAJOR version increase on incompatible API changes
  • MINOR version increase on adding new functionality in a backwards compatible manner
  • PATCH version increase on backwards compatible bug fixes or documentation

Usage

The easiest way is to use the docker image. Otherwise, the artifact will have to be built by yourself.

$ docker pull larmic/sonnen-charger-api
$ docker run -d -p 8080:8080 --rm \
 -e SONNEN_CHARGER_IP='<my-charger-ip>' \
 --name larmic-sonnen-charger-api larmic/sonnen-charger-api

Example requests

See open api 3 specification for further information.

$ curl http://localhost:8080/sonnen-charger-api             # Open Api 3.1 specification
$ curl http://localhost:8080/sonnen-charger-api/settings    # Charger settings

Build application by yourself

Requirements

  • Docker
  • Go 1.21.x (if you want to build it without using docker builder)

Build and run it

See Makefile!

$ make              # prints available make goals

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published