powerwall

package module
v0.0.0-...-22521f3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 9 Imported by: 1

README

powerwall

This class is an example of how to use the APIs that are available from your Tesla powerwall/gateway system. Done in Go

None of this would be possible without all the documentation provided here:

https://github.com/vloschiavo/powerwall2

Requirements

Tesla Powerwall and gateway

Know the IP address of the gateway (intenal webserver)

Created a local login with password on the local gateway's web interface

Cert file

The file "powerwall.cer" is the certificate for my powerwall. It assumes you have a DNS entry of "powerwall" pointing to the IP address in your house.

get_structs

cmds

Example tools in the cmds folder.

get_structs

Gets the bulk of the useful json responses and creates structs

guesstimate

Demonstrates how to use the generated structs to create a command. This gets the basics status of a solar/powerwall system

Documentation

Index

Constants

View Source
const PWURL string = "https://powerwall/api"

Variables

This section is empty.

Functions

func CheckName

func CheckName(endpointname string) bool

func List

func List(bnameonly bool)

Types

type Config

type Config struct {
	Vin string `json:"vin"`
}

type Customer

type Customer struct {
	GridServices    bool `json:"grid_services"`
	LimitedWarranty bool `json:"limited_warranty"`
	Marketing       bool `json:"marketing"`
	PrivacyNotice   bool `json:"privacy_notice"`
	Registered      bool `json:"registered"`
}

type DisconnectTypes

type DisconnectTypes []string

type Generators

type Generators struct {
	DisconnectType string `json:"disconnect_type"`
}

type Installer

type Installer struct {
	BackupConfiguration      string   `json:"backup_configuration"`
	Company                  string   `json:"company"`
	CustomerID               string   `json:"customer_id"`
	Email                    string   `json:"email"`
	HasResidualCurrentDevice bool     `json:"has_residual_current_device"`
	InstallationTypes        []string `json:"installation_types"`
	Location                 string   `json:"location"`
	Mounting                 string   `json:"mounting"`
	Phone                    string   `json:"phone"`
	RunSitemaster            bool     `json:"run_sitemaster"`
	SolarInstallation        string   `json:"solar_installation"`
	SolarInstallationType    string   `json:"solar_installation_type"`
	VerifiedConfig           bool     `json:"verified_config"`
	Wiring                   string   `json:"wiring"`
}

type InstallerCompanies

type InstallerCompanies []struct {
	Company    string `json:"company"`
	CustomerID string `json:"customer_id"`
}

type Login

type Login struct {
	Email     string    `json:"email"`
	Firstname string    `json:"firstname"`
	Lastname  string    `json:"lastname"`
	LoginTime time.Time `json:"loginTime"`
	Provider  string    `json:"provider"`
	Roles     []string  `json:"roles"`
	Token     string    `json:"token"`
}

type Meters

type Meters []struct {
	Cts []struct {
		Inverted             []bool  `json:"inverted"`
		RealPowerScaleFactor float64 `json:"real_power_scale_factor,omitempty"`
		Type                 string  `json:"type"`
		Valid                []bool  `json:"valid"`
	} `json:"cts"`
	Serial  string `json:"serial"`
	ShortID string `json:"short_id"`
	Type    string `json:"type"`
}

type MetersAggregates

type MetersAggregates struct {
	Battery struct {
		EnergyExported                    float64   `json:"energy_exported"`
		EnergyImported                    float64   `json:"energy_imported"`
		Frequency                         float64   `json:"frequency"`
		IACurrent                         float64   `json:"i_a_current"`
		IBCurrent                         float64   `json:"i_b_current"`
		ICCurrent                         float64   `json:"i_c_current"`
		InstantApparentPower              float64   `json:"instant_apparent_power"`
		InstantAverageCurrent             float64   `json:"instant_average_current"`
		InstantAverageVoltage             float64   `json:"instant_average_voltage"`
		InstantPower                      float64   `json:"instant_power"`
		InstantReactivePower              float64   `json:"instant_reactive_power"`
		InstantTotalCurrent               float64   `json:"instant_total_current"`
		LastCommunicationTime             time.Time `json:"last_communication_time"`
		LastPhaseEnergyCommunicationTime  time.Time `json:"last_phase_energy_communication_time"`
		LastPhasePowerCommunicationTime   time.Time `json:"last_phase_power_communication_time"`
		LastPhaseVoltageCommunicationTime time.Time `json:"last_phase_voltage_communication_time"`
		NumMetersAggregated               float64   `json:"num_meters_aggregated"`
		Timeout                           float64   `json:"timeout"`
	} `json:"battery"`
	Load struct {
		EnergyExported                    float64   `json:"energy_exported"`
		EnergyImported                    float64   `json:"energy_imported"`
		Frequency                         float64   `json:"frequency"`
		IACurrent                         float64   `json:"i_a_current"`
		IBCurrent                         float64   `json:"i_b_current"`
		ICCurrent                         float64   `json:"i_c_current"`
		InstantApparentPower              float64   `json:"instant_apparent_power"`
		InstantAverageCurrent             float64   `json:"instant_average_current"`
		InstantAverageVoltage             float64   `json:"instant_average_voltage"`
		InstantPower                      float64   `json:"instant_power"`
		InstantReactivePower              float64   `json:"instant_reactive_power"`
		InstantTotalCurrent               float64   `json:"instant_total_current"`
		LastCommunicationTime             time.Time `json:"last_communication_time"`
		LastPhaseEnergyCommunicationTime  time.Time `json:"last_phase_energy_communication_time"`
		LastPhasePowerCommunicationTime   time.Time `json:"last_phase_power_communication_time"`
		LastPhaseVoltageCommunicationTime time.Time `json:"last_phase_voltage_communication_time"`
		Timeout                           float64   `json:"timeout"`
	} `json:"load"`
	Site struct {
		EnergyExported                    float64   `json:"energy_exported"`
		EnergyImported                    float64   `json:"energy_imported"`
		Frequency                         float64   `json:"frequency"`
		IACurrent                         float64   `json:"i_a_current"`
		IBCurrent                         float64   `json:"i_b_current"`
		ICCurrent                         float64   `json:"i_c_current"`
		InstantApparentPower              float64   `json:"instant_apparent_power"`
		InstantAverageCurrent             float64   `json:"instant_average_current"`
		InstantAverageVoltage             float64   `json:"instant_average_voltage"`
		InstantPower                      float64   `json:"instant_power"`
		InstantReactivePower              float64   `json:"instant_reactive_power"`
		InstantTotalCurrent               float64   `json:"instant_total_current"`
		LastCommunicationTime             time.Time `json:"last_communication_time"`
		LastPhaseEnergyCommunicationTime  time.Time `json:"last_phase_energy_communication_time"`
		LastPhasePowerCommunicationTime   time.Time `json:"last_phase_power_communication_time"`
		LastPhaseVoltageCommunicationTime time.Time `json:"last_phase_voltage_communication_time"`
		NumMetersAggregated               float64   `json:"num_meters_aggregated"`
		Timeout                           float64   `json:"timeout"`
	} `json:"site"`
	Solar struct {
		EnergyExported                    float64   `json:"energy_exported"`
		EnergyImported                    float64   `json:"energy_imported"`
		Frequency                         float64   `json:"frequency"`
		IACurrent                         float64   `json:"i_a_current"`
		IBCurrent                         float64   `json:"i_b_current"`
		ICCurrent                         float64   `json:"i_c_current"`
		InstantApparentPower              float64   `json:"instant_apparent_power"`
		InstantAverageCurrent             float64   `json:"instant_average_current"`
		InstantAverageVoltage             float64   `json:"instant_average_voltage"`
		InstantPower                      float64   `json:"instant_power"`
		InstantReactivePower              float64   `json:"instant_reactive_power"`
		InstantTotalCurrent               float64   `json:"instant_total_current"`
		LastCommunicationTime             time.Time `json:"last_communication_time"`
		LastPhaseEnergyCommunicationTime  time.Time `json:"last_phase_energy_communication_time"`
		LastPhasePowerCommunicationTime   time.Time `json:"last_phase_power_communication_time"`
		LastPhaseVoltageCommunicationTime time.Time `json:"last_phase_voltage_communication_time"`
		NumMetersAggregated               float64   `json:"num_meters_aggregated"`
		Timeout                           float64   `json:"timeout"`
	} `json:"solar"`
}

type MetersReadings

type MetersReadings struct {
	SynchrometerX struct {
		Data struct {
			Cts []struct {
				Ct     float64 `json:"ct"`
				EExpWs float64 `json:"eExp_Ws"`
				EImpWs float64 `json:"eImp_Ws"`
				IA     float64 `json:"i_A"`
				PW     float64 `json:"p_W"`
				QVar   float64 `json:"q_VAR"`
				VV     float64 `json:"v_V"`
			} `json:"cts"`
			FirmwareVersion string `json:"firmwareVersion"`
		} `json:"data"`
		Error string `json:"error"`
	} `json:"synchrometerX"`
	SynchrometerY struct {
		Data struct {
			Cts []struct {
				Ct     float64 `json:"ct"`
				EExpWs float64 `json:"eExp_Ws"`
				EImpWs float64 `json:"eImp_Ws"`
				IA     float64 `json:"i_A"`
				PW     float64 `json:"p_W"`
				QVar   float64 `json:"q_VAR"`
				VV     float64 `json:"v_V"`
			} `json:"cts"`
			FirmwareVersion string `json:"firmwareVersion"`
		} `json:"data"`
		Error string `json:"error"`
	} `json:"synchrometerY"`
}

type MetersSite

type MetersSite []struct {
	CachedReadings struct {
		EnergyExported                    float64   `json:"energy_exported"`
		EnergyImported                    float64   `json:"energy_imported"`
		Frequency                         float64   `json:"frequency"`
		IACurrent                         float64   `json:"i_a_current"`
		IBCurrent                         float64   `json:"i_b_current"`
		ICCurrent                         float64   `json:"i_c_current"`
		InstantApparentPower              float64   `json:"instant_apparent_power"`
		InstantAverageCurrent             float64   `json:"instant_average_current"`
		InstantAverageVoltage             float64   `json:"instant_average_voltage"`
		InstantPower                      float64   `json:"instant_power"`
		InstantReactivePower              float64   `json:"instant_reactive_power"`
		InstantTotalCurrent               float64   `json:"instant_total_current"`
		LastCommunicationTime             time.Time `json:"last_communication_time"`
		LastPhaseEnergyCommunicationTime  time.Time `json:"last_phase_energy_communication_time"`
		LastPhasePowerCommunicationTime   time.Time `json:"last_phase_power_communication_time"`
		LastPhaseVoltageCommunicationTime time.Time `json:"last_phase_voltage_communication_time"`
		ReactivePowerA                    float64   `json:"reactive_power_a"`
		ReactivePowerB                    float64   `json:"reactive_power_b"`
		RealPowerA                        float64   `json:"real_power_a"`
		RealPowerB                        float64   `json:"real_power_b"`
		SerialNumber                      string    `json:"serial_number"`
		Timeout                           float64   `json:"timeout"`
		VL1n                              float64   `json:"v_l1n"`
		VL2n                              float64   `json:"v_l2n"`
	} `json:"Cached_readings"`
	Connection struct {
		DeviceSerial string   `json:"device_serial"`
		HTTPSConf    struct{} `json:"https_conf"`
		ShortID      string   `json:"short_id"`
	} `json:"connection"`
	Cts      []bool  `json:"cts"`
	ID       float64 `json:"id"`
	Inverted []bool  `json:"inverted"`
	Location string  `json:"location"`
	Type     string  `json:"type"`
}

type MetersSolar

type MetersSolar []struct {
	CachedReadings struct {
		EnergyExported                    float64   `json:"energy_exported"`
		EnergyImported                    float64   `json:"energy_imported"`
		Frequency                         float64   `json:"frequency"`
		IACurrent                         float64   `json:"i_a_current"`
		IBCurrent                         float64   `json:"i_b_current"`
		ICCurrent                         float64   `json:"i_c_current"`
		InstantApparentPower              float64   `json:"instant_apparent_power"`
		InstantAverageCurrent             float64   `json:"instant_average_current"`
		InstantAverageVoltage             float64   `json:"instant_average_voltage"`
		InstantPower                      float64   `json:"instant_power"`
		InstantReactivePower              float64   `json:"instant_reactive_power"`
		InstantTotalCurrent               float64   `json:"instant_total_current"`
		LastCommunicationTime             time.Time `json:"last_communication_time"`
		LastPhaseEnergyCommunicationTime  time.Time `json:"last_phase_energy_communication_time"`
		LastPhasePowerCommunicationTime   time.Time `json:"last_phase_power_communication_time"`
		LastPhaseVoltageCommunicationTime time.Time `json:"last_phase_voltage_communication_time"`
		ReactivePowerB                    float64   `json:"reactive_power_b"`
		RealPowerB                        float64   `json:"real_power_b"`
		SerialNumber                      string    `json:"serial_number"`
		Timeout                           float64   `json:"timeout"`
		VL2n                              float64   `json:"v_l2n"`
	} `json:"Cached_readings"`
	Connection struct {
		DeviceSerial string   `json:"device_serial"`
		HTTPSConf    struct{} `json:"https_conf"`
		ShortID      string   `json:"short_id"`
	} `json:"connection"`
	CtVoltageReferences struct {
		Ct1 string `json:"ct1"`
		Ct2 string `json:"ct2"`
		Ct3 string `json:"ct3"`
	} `json:"ct_voltage_references"`
	Cts                  []bool  `json:"cts"`
	ID                   float64 `json:"id"`
	Inverted             []bool  `json:"inverted"`
	Location             string  `json:"location"`
	RealPowerScaleFactor float64 `json:"real_power_scale_factor"`
	Type                 string  `json:"type"`
}

type MetersStatus

type MetersStatus struct {
	Errors interface{} `json:"errors"`
	Status string      `json:"status"`
}

type Networks

type Networks []struct {
	Active   bool  `json:"active"`
	Dhcp     *bool `json:"dhcp"`
	Enabled  bool  `json:"enabled"`
	ExtraIps []struct {
		Ip      string  `json:"ip"`
		Netmask float64 `json:"netmask"`
	} `json:"extra_ips,omitempty"`
	IfaceNetworkInfo *struct {
		Gateway    string `json:"gateway"`
		HwAddress  string `json:"hw_address"`
		Interface  string `json:"interface"`
		IpNetworks []struct {
			Ip   string `json:"ip"`
			Mask string `json:"mask"`
		} `json:"ip_networks"`
		NetworkName    string  `json:"network_name"`
		SignalStrength float64 `json:"signal_strength"`
		State          string  `json:"state"`
		StateReason    string  `json:"state_reason"`
	} `json:"iface_network_info,omitempty"`
	Interface             string `json:"interface"`
	LastInternetConnected bool   `json:"lastInternetConnected"`
	LastTeslaConnected    bool   `json:"lastTeslaConnected"`
	NetworkName           string `json:"network_name"`
	Primary               bool   `json:"primary"`
	SecurityType          string `json:"security_type,omitempty"`
	Username              string `json:"username"`
}

type PW_Endpoints

type PW_Endpoints struct {
	Endpoint   string // the final piece of the URL
	Structname string // Name to save in a created go file for the struct
	Filename   string // Name of the file to save it in
	// contains filtered or unexported fields
}

type Powerwall

type Powerwall struct {
	// contains filtered or unexported fields
}

func New

func New(certfile string) *Powerwall

func (*Powerwall) CheckEndpoint

func (pP *Powerwall) CheckEndpoint(endpointname string) bool

func (*Powerwall) DebugOff

func (pP *Powerwall) DebugOff()

func (*Powerwall) DebugOn

func (pP *Powerwall) DebugOn()

func (*Powerwall) Dump

func (pP *Powerwall) Dump()

func (*Powerwall) GetConfig

func (pP *Powerwall) GetConfig() (bool, Config)

func (*Powerwall) GetCustomer

func (pP *Powerwall) GetCustomer() (bool, Customer)

func (*Powerwall) GetDisconnectTypes

func (pP *Powerwall) GetDisconnectTypes() (bool, DisconnectTypes)

func (*Powerwall) GetGenerators

func (pP *Powerwall) GetGenerators() (bool, Generators)

func (*Powerwall) GetInstaller

func (pP *Powerwall) GetInstaller() (bool, Installer)

func (*Powerwall) GetInstallerCompanies

func (pP *Powerwall) GetInstallerCompanies() (bool, InstallerCompanies)

func (*Powerwall) GetLogin

func (pP *Powerwall) GetLogin() (bool, Login)

func (*Powerwall) GetMeters

func (pP *Powerwall) GetMeters() (bool, Meters)

func (*Powerwall) GetMetersAggregates

func (pP *Powerwall) GetMetersAggregates() (bool, MetersAggregates)

func (*Powerwall) GetMetersReadings

func (pP *Powerwall) GetMetersReadings() (bool, MetersReadings)

func (*Powerwall) GetMetersSite

func (pP *Powerwall) GetMetersSite() (bool, MetersSite)

func (*Powerwall) GetMetersSolar

func (pP *Powerwall) GetMetersSolar() (bool, MetersSolar)

func (*Powerwall) GetMetersStatus

func (pP *Powerwall) GetMetersStatus() (bool, MetersStatus)

func (*Powerwall) GetNetworks

func (pP *Powerwall) GetNetworks() (bool, Networks)

func (*Powerwall) GetPowerwalls

func (pP *Powerwall) GetPowerwalls() (bool, Powerwalls)

func (*Powerwall) GetSaveDirectory

func (pP *Powerwall) GetSaveDirectory() string

func (*Powerwall) GetSiteInfo

func (pP *Powerwall) GetSiteInfo() (bool, SiteInfo)

func (*Powerwall) GetStruct

func (pP *Powerwall) GetStruct(endpointname string, bstdout bool) bool

func (*Powerwall) GetStructList

func (pP *Powerwall) GetStructList(bstdout bool) bool

func (*Powerwall) GetSystemStatus

func (pP *Powerwall) GetSystemStatus() (bool, SystemStatus)

func (*Powerwall) GetSystemStatusGridfaults

func (pP *Powerwall) GetSystemStatusGridfaults() (bool, SystemStatusGridfaults)

func (*Powerwall) GetSystemStatusSoe

func (pP *Powerwall) GetSystemStatusSoe() (bool, SystemStatusSoe)

func (*Powerwall) GetToken

func (pP *Powerwall) GetToken() string

func (*Powerwall) GetTokenFileName

func (pP *Powerwall) GetTokenFileName() string

func (*Powerwall) GetUrl

func (pP *Powerwall) GetUrl(endpointname string) string

func (*Powerwall) ListEndpoints

func (pP *Powerwall) ListEndpoints(bnameonly bool)

func (*Powerwall) Login

func (pP *Powerwall) Login(username string, passwd string, bstdout bool) bool

func (*Powerwall) RawGetStruct

func (pP *Powerwall) RawGetStruct(endpointname string, bstdout bool) bool

func (*Powerwall) RawGetUrl

func (pP *Powerwall) RawGetUrl(shortUrl string) string

func (*Powerwall) ReadTokenFromFile

func (pP *Powerwall) ReadTokenFromFile() bool

func (*Powerwall) SaveResponseBody

func (pP *Powerwall) SaveResponseBody(r *restapi.Restapi, sFilename string, sStructname string, sEndpointname string, bstdout bool) bool

func (*Powerwall) SaveResponseOff

func (pP *Powerwall) SaveResponseOff()

func (*Powerwall) SaveResponseOn

func (pP *Powerwall) SaveResponseOn()

func (*Powerwall) SaveTokenToFile

func (pP *Powerwall) SaveTokenToFile() bool

func (*Powerwall) SetObject

func (pP *Powerwall) SetObject(obj interface{})

func (*Powerwall) SetSaveDirectory

func (pP *Powerwall) SetSaveDirectory(dir string)

func (*Powerwall) SetToken

func (pP *Powerwall) SetToken(token string)

func (*Powerwall) SetTokenFileName

func (pP *Powerwall) SetTokenFileName(filename string)

type Powerwalls

type Powerwalls struct {
	BubbleShedding             bool        `json:"bubble_shedding"`
	CheckingIfOffgrid          bool        `json:"checking_if_offgrid"`
	Enumerating                bool        `json:"enumerating"`
	GatewayDin                 string      `json:"gateway_din"`
	GridCodeValidating         bool        `json:"grid_code_validating"`
	GridQualifying             bool        `json:"grid_qualifying"`
	Msa                        interface{} `json:"msa"`
	OnGridCheckError           string      `json:"on_grid_check_error"`
	PhaseDetectionLastError    string      `json:"phase_detection_last_error"`
	PhaseDetectionNotAvailable bool        `json:"phase_detection_not_available"`
	Powerwalls                 []struct {
		PackagePartNumber   string `json:"PackagePartNumber"`
		PackageSerialNumber string `json:"PackageSerialNumber"`
		// egc 1/18/2023
		// changed form Type to Type2 because the autogeneration messed up
		//
		Type2                   string      `json:"Type"`
		BcType                  interface{} `json:"bc_type"`
		CommissioningDiagnostic struct {
			Alert    bool   `json:"alert"`
			Category string `json:"category"`
			Checks   []struct {
				Checks    interface{} `json:"checks"`
				Debug     struct{}    `json:"debug"`
				EndTime   time.Time   `json:"end_time"`
				Message   string      `json:"message"`
				Name      string      `json:"name"`
				Results   struct{}    `json:"results"`
				StartTime time.Time   `json:"start_time"`
				Status    string      `json:"status"`
			} `json:"checks"`
			Disruptive bool        `json:"disruptive"`
			Inputs     interface{} `json:"inputs"`
			Name       string      `json:"name"`
		} `json:"commissioning_diagnostic"`
		GridReconnectionTimeSeconds float64 `json:"grid_reconnection_time_seconds"`
		GridState                   string  `json:"grid_state"`
		InConfig                    bool    `json:"in_config"`
		Type                        string  `json:"type"`
		UnderPhaseDetection         bool    `json:"under_phase_detection"`
		UpdateDiagnostic            struct {
			Alert    bool   `json:"alert"`
			Category string `json:"category"`
			Checks   []struct {
				Checks    interface{} `json:"checks"`
				Debug     interface{} `json:"debug"`
				EndTime   interface{} `json:"end_time"`
				Name      string      `json:"name"`
				Progress  float64     `json:"progress"`
				Results   interface{} `json:"results"`
				StartTime interface{} `json:"start_time"`
				Status    string      `json:"status"`
			} `json:"checks"`
			Disruptive bool        `json:"disruptive"`
			Inputs     interface{} `json:"inputs"`
			Name       string      `json:"name"`
		} `json:"update_diagnostic"`
		Updating bool `json:"updating"`
	} `json:"powerwalls"`
	RunningPhaseDetection bool        `json:"running_phase_detection"`
	States                interface{} `json:"states"`
	Sync                  struct {
		CommissioningDiagnostic struct {
			Alert    bool   `json:"alert"`
			Category string `json:"category"`
			Checks   []struct {
				Checks    interface{} `json:"checks"`
				Debug     struct{}    `json:"debug"`
				EndTime   time.Time   `json:"end_time"`
				Message   string      `json:"message"`
				Name      string      `json:"name"`
				Results   struct{}    `json:"results"`
				StartTime time.Time   `json:"start_time"`
				Status    string      `json:"status"`
			} `json:"checks"`
			Disruptive bool        `json:"disruptive"`
			Inputs     interface{} `json:"inputs"`
			Name       string      `json:"name"`
		} `json:"commissioning_diagnostic"`
		UpdateDiagnostic struct {
			Alert    bool   `json:"alert"`
			Category string `json:"category"`
			Checks   []struct {
				Checks    interface{} `json:"checks"`
				Debug     interface{} `json:"debug"`
				EndTime   interface{} `json:"end_time"`
				Name      string      `json:"name"`
				Progress  float64     `json:"progress"`
				Results   interface{} `json:"results"`
				StartTime interface{} `json:"start_time"`
				Status    string      `json:"status"`
			} `json:"checks"`
			Disruptive bool        `json:"disruptive"`
			Inputs     interface{} `json:"inputs"`
			Name       string      `json:"name"`
		} `json:"update_diagnostic"`
		Updating bool `json:"updating"`
	} `json:"sync"`
	Updating bool `json:"updating"`
}

type SiteInfo

type SiteInfo struct {
	GridCode struct {
		Country           string `json:"country"`
		Distributor       string `json:"distributor"`
		GridCode          string `json:"grid_code"`
		GridCodeOverrides []struct {
			Name  string  `json:"name"`
			Value float64 `json:"value"`
		} `json:"grid_code_overrides"`
		GridFreqSetting    float64 `json:"grid_freq_setting"`
		GridPhaseSetting   string  `json:"grid_phase_setting"`
		GridVoltageSetting float64 `json:"grid_voltage_setting"`
		Region             string  `json:"region"`
		Retailer           string  `json:"retailer"`
		State              string  `json:"state"`
		Utility            string  `json:"utility"`
	} `json:"grid_code"`
	MaxSiteMeterPowerKW    float64 `json:"max_site_meter_power_kW"`
	MaxSystemEnergyKWh     float64 `json:"max_system_energy_kWh"`
	MaxSystemPowerKW       float64 `json:"max_system_power_kW"`
	MinSiteMeterPowerKW    float64 `json:"min_site_meter_power_kW"`
	NominalSystemEnergyKWh float64 `json:"nominal_system_energy_kWh"`
	NominalSystemPowerKW   float64 `json:"nominal_system_power_kW"`
	SiteName               string  `json:"site_name"`
	Timezone               string  `json:"timezone"`
}

type SystemStatus

type SystemStatus struct {
	AllEnableLinesHigh     bool    `json:"all_enable_lines_high"`
	AuxiliaryLoad          float64 `json:"auxiliary_load"`
	AvailableBlocks        float64 `json:"available_blocks"`
	AvailableChargerBlocks float64 `json:"available_charger_blocks"`
	BatteryBlocks          []struct {
		OpSeqState             string        `json:"OpSeqState"`
		PackagePartNumber      string        `json:"PackagePartNumber"`
		PackageSerialNumber    string        `json:"PackageSerialNumber"`
		Type                   string        `json:"Type"`
		BackupReady            bool          `json:"backup_ready"`
		ChargePowerClamped     bool          `json:"charge_power_clamped"`
		DisabledReasons        []interface{} `json:"disabled_reasons"`
		EnergyCharged          float64       `json:"energy_charged"`
		EnergyDischarged       float64       `json:"energy_discharged"`
		FOut                   float64       `json:"f_out"`
		IOut                   float64       `json:"i_out"`
		NominalEnergyRemaining float64       `json:"nominal_energy_remaining"`
		NominalFullPackEnergy  float64       `json:"nominal_full_pack_energy"`
		OffGrid                bool          `json:"off_grid"`
		POut                   float64       `json:"p_out"`
		PinvGridState          string        `json:"pinv_grid_state"`
		PinvState              string        `json:"pinv_state"`
		QOut                   float64       `json:"q_out"`
		VOut                   float64       `json:"v_out"`
		Version                string        `json:"version"`
		VfMode                 bool          `json:"vf_mode"`
		WobbleDetected         bool          `json:"wobble_detected"`
	} `json:"battery_blocks"`
	BatteryTargetPower               float64       `json:"battery_target_power"`
	BatteryTargetReactivePower       float64       `json:"battery_target_reactive_power"`
	BlocksControlled                 float64       `json:"blocks_controlled"`
	CanReboot                        string        `json:"can_reboot"`
	CommandSource                    string        `json:"command_source"`
	ExpectedEnergyRemaining          float64       `json:"expected_energy_remaining"`
	FfrPowerAvailabilityHigh         float64       `json:"ffr_power_availability_high"`
	FfrPowerAvailabilityLow          float64       `json:"ffr_power_availability_low"`
	GridFaults                       []interface{} `json:"grid_faults"`
	GridServicesPower                float64       `json:"grid_services_power"`
	HardwareCapabilityChargePower    float64       `json:"hardware_capability_charge_power"`
	HardwareCapabilityDischargePower float64       `json:"hardware_capability_discharge_power"`
	InstantaneousMaxApparentPower    float64       `json:"instantaneous_max_apparent_power"`
	InstantaneousMaxChargePower      float64       `json:"instantaneous_max_charge_power"`
	InstantaneousMaxDischargePower   float64       `json:"instantaneous_max_discharge_power"`
	InverterNominalUsablePower       float64       `json:"inverter_nominal_usable_power"`
	LastToggleTimestamp              time.Time     `json:"last_toggle_timestamp"`
	LoadChargeConstraint             float64       `json:"load_charge_constraint"`
	MaxApparentPower                 float64       `json:"max_apparent_power"`
	MaxChargePower                   float64       `json:"max_charge_power"`
	MaxDischargePower                float64       `json:"max_discharge_power"`
	MaxPowerEnergyRemaining          float64       `json:"max_power_energy_remaining"`
	MaxPowerEnergyToBeCharged        float64       `json:"max_power_energy_to_be_charged"`
	MaxSustainedRampRate             float64       `json:"max_sustained_ramp_rate"`
	NominalEnergyRemaining           float64       `json:"nominal_energy_remaining"`
	NominalFullPackEnergy            float64       `json:"nominal_full_pack_energy"`
	Primary                          bool          `json:"primary"`
	Score                            float64       `json:"score"`
	SmartInvDeltaP                   float64       `json:"smart_inv_delta_p"`
	SmartInvDeltaQ                   float64       `json:"smart_inv_delta_q"`
	SolarRealPowerLimit              float64       `json:"solar_real_power_limit"`
	SystemIslandState                string        `json:"system_island_state"`
}

type SystemStatusGridfaults

type SystemStatusGridfaults []interface{}

type SystemStatusSoe

type SystemStatusSoe struct {
	Percentage float64 `json:"percentage"`
}

Jump to

Keyboard shortcuts

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