calipower

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

README

go-calipower Go Reference

Get available capacity, estimates, and reserves from California ISO.

Usage

package main

import (
	"fmt"
	"log"
	"strconv"

	"git.sr.ht/~maatt/go-calipower"
)

func main() {
	data, err := calipower.GetPowerData()
	fmt.Printf(strconv.Itoa(data.CurrentReserve))
}

Better example can be found in test/test.go.

Acknowledgements

Data is collected from FlexAlert.org, a website run by the California ISO. Data is meant to be used within the allowance of the California ISO.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurAvailability

func GetCurAvailability() (string, error)

func GetCurAvailability1H

func GetCurAvailability1H() (int, error)

func GetCurAvailability4H

func GetCurAvailability4H() (int, error)

func GetCurCapacity

func GetCurCapacity() (int, error)

func GetCurDemand

func GetCurDemand() (int, error)

func GetCurReserves

func GetCurReserves() (int, error)

Types

type ISOData

type ISOData struct {
	CurrentNetDemandWithoutPumpTS               string   `json:"CurrentNetDemandWithoutPumpTS"`
	SlotDate                                    string   `json:"slotDate"`
	RenewablesPercentwoBatteries                int      `json:"renewablesPercentwoBatteries"`
	HistDemand                                  string   `json:"histDemand"`
	CurrentSystemDemandWithoutPumpTS            string   `json:"CurrentSystemDemandWithoutPumpTS"`
	UnloadedCapacityDeratedMax                  int      `json:"Unloaded_capacity_derated_max"`
	HistDemandDate                              string   `json:"histDemandDate"`
	RequiredReserve                             int      `json:"Required_reserve"`
	CurrentSystemDemandTS                       string   `json:"CurrentSystemDemandTS"`
	TodaysPeakDemandTS                          string   `json:"TodaysPeakDemandTS"`
	UnloadedCapacity4H                          int      `json:"Unloaded_capacity_4H"`
	UnloadedCapacity10M                         int      `json:"Unloaded_capacity_10M"`
	CurrentRenewables                           int      `json:"currentRenewables"`
	Limitation                                  string   `json:"Limitation"`
	PSVERSION                                   string   `json:"PS_VERSION"`
	RenewablesPercent                           int      `json:"renewablesPercent"`
	CurrentAdjustedUnloadedGenerationCapacityTS string   `json:"CurrentAdjustedUnloadedGenerationCapacityTS"`
	TodayForecastPeakDemandTS                   string   `json:"todayForecastPeakDemandTS"`
	CurrentCo2Intensity                         float64  `json:"currentCo2intensity"`
	TodayForecastPeakDemand                     int      `json:"todayForecastPeakDemand"`
	CurrentSolar                                int      `json:"currentSolar"`
	CurrentSystemDemand                         int      `json:"CurrentSystemDemand"`
	CurrentCo2                                  int      `json:"currentCo2"`
	CurrentAdjustedUnloadedGenerationCapacity   int      `json:"CurrentAdjustedUnloadedGenerationCapacity"`
	OutageDTS                                   string   `json:"OutageDTS"`
	HistoryFirstDate                            string   `json:"HistoryFirstDate"`
	AvailableCapacity                           int      `json:"Available_capacity"`
	CurrentNetDemandWithoutPump                 int      `json:"CurrentNetDemandWithoutPump"`
	CurrentSystemDemandPlusUnloaded4H           int      `json:"CurrentSystemDemandPlusUnloaded4h"`
	Shutdown                                    string   `json:"Shutdown"`
	UnloadedCapacity1H                          int      `json:"Unloaded_capacity_1H"`
	TodaysPeakDemand                            int      `json:"TodaysPeakDemand"`
	CurrentWind                                 int      `json:"currentWind"`
	TomorrowsForecastPeakDemand                 float64  `json:"tomorrowsForecastPeakDemand"`
	CurrentNetDemandTS                          string   `json:"CurrentNetDemandTS"`
	CurrentNetDemand                            int      `json:"CurrentNetDemand"`
	CurrentRenewableswoBatteries                int      `json:"currentRenewableswoBatteries"`
	Gridstatus                                  []string `json:"gridstatus"`
	CurrentReserve                              int      `json:"Current_reserve"`
	CurrentSystemDemandWithoutPump              int      `json:"CurrentSystemDemandWithoutPump"`
}

func GetPowerData

func GetPowerData() (*ISOData, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL