Versions in this module Expand all Collapse all v0 v0.3.0 Feb 17, 2024 Changes in this version + const GridStatusConnected + const GridStatusIslanded + const GridStatusTransition + const OperationModeBackup + const OperationModeSelf + const OperationModeTimeBased + const SitemasterRebootOK + const SitemasterRebootPowerTooHigh + const SitemasterStatusDown + const SitemasterStatusUp + func SetErrFunc(f func(string, error)) + func SetLogFunc(f func(...interface{})) + type APIClient struct + AuthCookie string + UserRecord string + func NewClient(gatewayAddress string, gatewayLoginEmail string, authCookie string, ...) *APIClient + func (c *APIClient) FetchTLSCert() (*x509.Certificate, error) + func (c *APIClient) GetGridFaults() (*[]GridFaultData, error) + func (c *APIClient) GetGridStatus() (*GridStatusData, error) + func (c *APIClient) GetMeters(category string) (*[]MeterData, error) + func (c *APIClient) GetMetersAggregates() (*map[string]MeterAggregatesData, error) + func (c *APIClient) GetNetworks() (*[]NetworkData, error) + func (c *APIClient) GetOperation() (*OperationData, error) + func (c *APIClient) GetProblems() (*TroubleshootingProblemsData, error) + func (c *APIClient) GetSOE() (*SOEData, error) + func (c *APIClient) GetSiteInfo() (*SiteInfoData, error) + func (c *APIClient) GetSitemaster() (*SitemasterData, error) + func (c *APIClient) GetStatus() (*StatusData, error) + func (c *APIClient) GetSystemStatus() (*SystemStatusData, error) + func (c *APIClient) SetConfigCompleted() (*ConfigData, error) + func (c *APIClient) SetOperation(mode string, backupReservePercent float32) error + func (c *APIClient) SetRetry(interval time.Duration, timeout time.Duration) + func (c *APIClient) SetTLSCert(cert *x509.Certificate) + func (c *APIClient) SitemasterRun() error + func (c *APIClient) SitemasterStop() error + type ApiError struct + Body []byte + StatusCode int + URL url.URL + func (e ApiError) Error() string + type AuthClient struct + func NewAuthClient(gatewayAddress string, installerEmail string) *AuthClient + func (a *AuthClient) Cookies(u *url.URL) []*http.Cookie + func (a *AuthClient) SetCookies(u *url.URL, cookies []*http.Cookie) + func (c *AuthClient) FetchTLSCert() (*x509.Certificate, error) + func (c *AuthClient) GetAuthToken() string + func (c *AuthClient) GetAuthTokens() (string, string) + func (c *AuthClient) GetSessionToggleCookie() string + func (c *AuthClient) PerformLogin() (string, string, error) + func (c *AuthClient) SetRetry(interval time.Duration, timeout time.Duration) + func (c *AuthClient) SetTLSCert(cert *x509.Certificate) + type AuthFailure struct + ErrorText string + Message string + URL url.URL + func (e AuthFailure) Error() string + type ConfigData struct + CanReboot bool + CellularDisabled bool + CommissionCount int + DeviceType string + Din string + GitHash string + IsNew bool + StartTime string + SyncType string + TegType string + UpTime string + Version string + type DecodedAlert map[string]string + func (v *DecodedAlert) UnmarshalJSON(data []byte) error + type Duration struct + func (v *Duration) MarshalJSON() ([]byte, error) + func (v *Duration) UnmarshalJSON(p []byte) error + type GridFaultData struct + AlertIsFault bool + AlertName string + AlertRaw int64 + DecodedAlert DecodedAlert + EcuPackagePartNumber string + EcuPackageSerialNumber string + EcuType string + GitHash string + SiteUID string + Timestamp int64 + type GridStatusData struct + GridServicesActive bool + GridStatus string + type MeterAggregatesData struct + EnergyExported float32 + EnergyImported float32 + Frequency float32 + IACurrent float32 + IBCurrent float32 + ICCurrent float32 + InstantApparentPower float32 + InstantAverageCurrent float32 + InstantAverageVoltage float32 + InstantPower float32 + InstantReactivePower float32 + InstantTotalCurrent float32 + LastCommunicationTime time.Time + LastPhasePowerCommunicationTime time.Time + LastPhaseVoltageCommunicationTime time.Time + NumMetersAggregated int + Timeout int + type MeterData struct + CachedReadings struct{ ... } + Connection struct{ ... } + CtVoltageReferences struct{ ... } + Cts []bool + ID int + Inverted []bool + Location string + RealPowerScaleFactor float32 + Type string + type NetworkData struct + Active bool + Dhcp bool + Enabled bool + ExtraIps []struct{ ... } + IfaceNetworkInfo struct{ ... } + Interface string + LastInternetConnected bool + LastTeslaConnected bool + NetworkName string + Primary bool + SecurityType string + Username string + type NonIsoTime struct + func (v *NonIsoTime) UnmarshalJSON(p []byte) error + type OperationData struct + BackupReservePercent float32 + FreqShiftLoadShedDeltaF float64 + FreqShiftLoadShedSoe float32 + RealMode string + type SOEData struct + Percentage float32 + type SiteInfoData struct + GridData struct{ ... } + MaxSiteMeterPowerKW int + MaxSystemEnergyKWH float32 + MaxSystemPowerKW float32 + MeasuredFrequency float32 + MinSiteMeterPowerKW int + NominalSystemEnergyKWH float32 + NominalSystemPowerKW float32 + SiteName string + TimeZone string + type SitemasterData struct + CanReboot string + ConnectedToTesla bool + PowerSupplyMode bool + Running bool + Status string + type StatusData struct + CellularDisabled bool + CommissionCount int + DeviceType string + Din string + Followers interface{} + GitHash string + IsNew bool + Leader string + StartTime NonIsoTime + SyncType string + UpTime Duration + Version string + type SystemStatusData struct + AllEnableLinesHigh bool + AuxiliaryLoad float32 + AvailableBlocks int + BatteryBlocks []struct{ ... } + BatteryTargetPower float32 + BatteryTargetReactivePower float32 + BlocksControlled int + CanReboot string + CommandSource string + ExpectedEnergyRemaining float32 + FfrPowerAvailabilityHigh float32 + FfrPowerAvailabilityLow float32 + GridFaults []GridFaultData + GridServicesPower float32 + InstantaneousMaxChargePower float32 + InstantaneousMaxDischargePower float32 + InverterNominalUsablePower float32 + LastToggleTimestamp time.Time + LoadChargeConstraint float32 + MaxApparentPower float32 + MaxChargePower float32 + MaxDischargePower float32 + MaxPowerEnergyRemaining float32 + MaxPowerEnergyToBeCharged float32 + MaxSustainedRampRate float32 + NominalEnergyRemaining float32 + NominalFullPackEnergy float32 + Primary bool + Score float32 + SmartInvDeltaP float32 + SmartInvDeltaQ float32 + SolarRealPowerLimit float32 + SystemIslandState string + type ToggleSupportedResponse struct + ToggleAuthSupported bool + type TroubleshootingProblemsData struct + Problems []interface{}