go-viessmann is a Go client library for accessing the Viessmann Cloud API
go-viessmann is compatible with modern Go releases in module mode, with Go installed:
go get github.com/probakowski/go-viessmann
will resolve and add the package to the current development module, along with its dependencies.
Alternatively the same can be achieved if you use import in a package:
import "github.com/probakowski/go-viessmann"
and run go get
without parameters.
Finally, to use the top-of-trunk version of this repo, use the following command:
go get github.com/probakowski/go-viessmann@master
import "github.com/probakowski/go-viessmann"
Construct a new viessmann client, then you can use different method from API, for example:
client := viessmann.Client{
ClientId: "<your_client_id"
RefreshToken "<OAuth refresh token"
HttpClient: client, //optional, HTTP client to use, http.DefaultClient will be used if nil
}
...
You have to register as developer on Viessmann Developer Portal and create API key
viessmann.Client
uses OAuth refresh token to obtain access token that is required for API access. This token can be
obtained manually as described in Viessmann documentation
or you can use server located in example/server/go
:
- Start server:
go run example/server.go
- Go to http://localhost:3000
- Provide Client ID and click
Log in
, you'll be redirected to Viessmann login page when you have to log in with credentials you used during registration - If everything is OK you will see overview of all your installations, gateways, devices and their features
- Refresh token will be stored in
config
file in current directory