modulepackage
0.0.4
Repository: https://github.com/filego/octopusenergyapi.git
Documentation: pkg.go.dev
# README
Octopus Energy API
This package provides an interface to Octopus Energy's API, which provides a lot of useful data, including viewing half-hourly consumption of an electricity or gas meter.
An API key from Octopus Energy is required, as mentioned here. This can be obtained from your online dashboard.
Usage
client, err := octopusenergyapi.NewClient("{API_KEY}", http.DefaultClient)
if err != nil {
log.Fatal(err)
}
mpoint, err := client.GetMeterPoint(mpan)
if err != nil {
log.Fatal(err)
}
fmt.Printf("MPAN: %s\nProfile class: %d (%s)\n",
mpoint.MPAN, mpoint.ProfileClass, octopusenergyapi.PCs[mpoint.ProfileClass])
fmt.Printf("GSP: %s (%s)\n",
mpoint.GSP.GSPGroupID, mpoint.GSP.Name)
If you find bug or would like to see some additional functionality, please raise an issue. PRs are also more than welcome.
# Packages
No description provided by the author
# Functions
NewClient returns a client.
# Structs
Client represents a Client to be used with the API.
Consumption represents a power consumption in a given interval.
ConsumptionOption represents optional parameters for API.GetMeterConsumption.
GridSupplyPoint represents a Grid Supply Point (GSP).
Link represents a hyperlink.
MeterPoint represents a meter point https://developer.octopus.energy/docs/api/#retrieve-a-meter-point.
Product represents an Octopus Energy product https://developer.octopus.energy/docs/api/#retrieve-a-product.
Tariff represent an Octopus Energy tariff.