Categorygithub.com/FileGo/octopusenergyapi
modulepackage
0.0.4
Repository: https://github.com/filego/octopusenergyapi.git
Documentation: pkg.go.dev

# README

Octopus Energy API

PkgGoDev Go Report Card tests build

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.

# Variables

GSPs provides a list of Grid Supply Points (GSP) https://en.wikipedia.org/wiki/Meter_Point_Administration_Number#Distributor_ID.
PCs represents Profile Class of a meter point https://en.wikipedia.org/wiki/Meter_Point_Administration_Number#Profile_Class_(PC).

# 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.