Skip to content

tebben/toon-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOON-GO-SDK

toon-go-sdk can be used in your project to interact with the Toon API endpoint at https://api.toon.eu/toon/v3
There is a cli.go file which can be build and started, however this is used to do some testing, maybe there will be a full cli to interact with the Toon API in the future.

how-to

Create an account at https://developer.toon.eu/
After registering create an app and use "http:https://127.0.0.1:8080/oauthcallback" as Callback URL.

Create a ToonAuthenticator, you can find your client id and secret from the created app at https://developer.toon.eu/. Provider should be something as eneco or viesgo

authenticator := auth.NewToonAuthenticator(
		{clientID},
		{clientSecret},
		{provider},
		"http:https://127.0.0.1:8080/oauthcallback",
		"0.0.0.0",
		"/oauthcallback",
		8080)

Get a token using your provider credentials, for instance the credentials u use to login to the Eneco website.

authenticator.StartGetToken(username, password)

GetAgreements example

agreements, err := toon.GetAgreements(authenticator)

Note: An initial agreement API call is needed since all other calls require an AgreementID

GetStatus example

ag := *agreements
data, err := toon.GetStatus(authenticator, ag[0].AgreementID)

API implementation status

This project is work in progress

Production

  • agreementId-production-electricity-flows-get
  • agreementId-production-electricity-data-get
  • getElectricityGraphDataEneco
  • getElectricityProductionAndDelivery

Agreements

  • getAgreements

Status

  • getStatus

Consumption

  • getGasFlowData
  • getElectricityGraphData
  • getDistrictHeatGraphData
  • getElectricityFlowData
  • getGasGraphData
  • unsubscribePushEvent
  • getWebhooks
  • subscribeToPushEvent

Thermostat

  • getThermostatPrograms
  • updateThermostatPrograms
  • setThermostatState
  • getThermostatStates
  • updateCurrentTemperature
  • getCurrentTemperature

Devices

  • getDeviceConfiguration
  • updateDeviceConfiguration
  • getDevicesGraphData
  • getDevicesConfiguration
  • updateDevicesConfiguration
  • getDevicesFlows

About

SDK for the Toon smart thermostat API in go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages