Versions in this module Expand all Collapse all v0 v0.3.0 Jan 19, 2024 Changes in this version + const GridStatusConnected + const GridStatusIslanded + const GridStatusTransition + const OperationModeSelf + const OperationModeTimeBased + const SitemasterRebootOK + const SitemasterRebootPowerTooHigh + const SitemasterStatusDown + const SitemasterStatusUp + func DefaultPort(conn string, port int) string + func DefaultTransport() *http.Transport + func SetErrFunc(f func(string, error)) + func SetLogFunc(f func(...interface{})) + func WithHttpClient(httpClient *http.Client) func(c *Client) + type ApiError struct + Body []byte + StatusCode int + URL url.URL + func (e ApiError) Error() string + type AuthFailure struct + ErrorText string + Message string + URL url.URL + func (e AuthFailure) Error() string + type Client struct + func NewClient(gatewayAddress, gatewayLoginEmail, gatewayLoginPassword string, ...) *Client + func (c *Client) DoLogin() error + func (c *Client) FetchTLSCert() (*x509.Certificate, error) + func (c *Client) GetAuthToken() string + func (c *Client) GetGridFaults() ([]GridFaultData, error) + func (c *Client) GetGridStatus() (*GridStatusData, error) + func (c *Client) GetMeters(category string) ([]MeterData, error) + func (c *Client) GetMetersAggregates() (map[string]MeterAggregatesData, error) + func (c *Client) GetNetworks() ([]NetworkData, error) + func (c *Client) GetOperation() (*OperationData, error) + func (c *Client) GetProblems() (*TroubleshootingProblemsData, error) + func (c *Client) GetSOE() (*SOEData, error) + func (c *Client) GetSiteInfo() (*SiteInfoData, error) + func (c *Client) GetSitemaster() (*SitemasterData, error) + func (c *Client) GetStatus() (*StatusData, error) + func (c *Client) GetSystemStatus() (*SystemStatusData, error) + func (c *Client) SetAuthToken(token string) + func (c *Client) SetRetry(interval time.Duration, timeout time.Duration) + func (c *Client) SetTLSCert(cert *x509.Certificate) + type DecodedAlert map[string]interface + 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 int64 + 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 float64 + FreqShiftLoadShedDeltaF float64 + FreqShiftLoadShedSoe float64 + RealMode string + type SOEData struct + Percentage float64 + 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 float64 + AvailableBlocks int + BatteryBlocks []struct{ ... } + BatteryTargetPower float64 + BatteryTargetReactivePower float64 + BlocksControlled int + CanReboot string + CommandSource string + ExpectedEnergyRemaining float64 + FfrPowerAvailabilityHigh float64 + FfrPowerAvailabilityLow float64 + GridFaults []GridFaultData + GridServicesPower float64 + InstantaneousMaxChargePower float64 + InstantaneousMaxDischargePower float64 + InverterNominalUsablePower float64 + LastToggleTimestamp time.Time + LoadChargeConstraint float64 + MaxApparentPower float64 + MaxChargePower float64 + MaxDischargePower float64 + MaxPowerEnergyRemaining float64 + MaxPowerEnergyToBeCharged float64 + MaxSustainedRampRate float64 + NominalEnergyRemaining float64 + NominalFullPackEnergy float64 + Primary bool + Score float64 + SmartInvDeltaP float64 + SmartInvDeltaQ float64 + SolarRealPowerLimit float64 + SystemIslandState string + type TroubleshootingProblemsData struct + Problems []interface{}