Documentation ¶
Overview ¶
Package powerwall extracts information from a powerwall on demand.
Index ¶
- type Aggregates
- type Config
- type Diagnostic
- type DiagnosticCheck
- type Duration
- type FloatDurationSeconds
- type GridCode
- type GridState
- type GridStatus
- type HTTPMethod
- type IP
- type Installer
- type MeterDetails
- type Monitor
- type Network
- type NetworkInfo
- type NetworkInterface
- type OperatingMode
- type Operation
- type Options
- type Powerwall
- type Powerwalls
- type SOE
- type SiteInfo
- type SiteMaster
- type Solar
- type Status
- type SystemStatus
- type Time
- type TimeZone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregates ¶
type Aggregates struct { Site MeterDetails `json:"site"` Battery MeterDetails `json:"battery"` Load MeterDetails `json:"load"` Solar MeterDetails `json:"solar"` }
type Diagnostic ¶
type Diagnostic struct { Name string `json:"name"` // "Commissioning" Category string `json:"category"` // "InternalComms" Disruptive bool `json:"disruptive"` // inputs is null, so I cannot determine the schema Checks []DiagnosticCheck `json:"checks"` }
type DiagnosticCheck ¶
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
func (*Duration) UnmarshalJSON ¶
type FloatDurationSeconds ¶
type FloatDurationSeconds struct {
// contains filtered or unexported fields
}
func (FloatDurationSeconds) Duration ¶
func (f FloatDurationSeconds) Duration() time.Duration
func (*FloatDurationSeconds) UnmarshalJSON ¶
func (f *FloatDurationSeconds) UnmarshalJSON(b []byte) error
type GridCode ¶
type GridCode struct { Code string `json:"grid_code"` // "60Hz_240V_s_UL1741SA:2018_ISO-NE" Voltage int `json:"grid_voltage_setting"` Frequency int `json:"grid_freq_setting"` PhaseSetting string `json:"grid_phase_setting"` // "Split Country string `json:"country"` State string `json:"state"` Distributor string `json:"distributor"` // * Utility string `json:"utility"` // Eversource Energy (NSTAR-Cambridge Electric Light) Retailer string `json:"retailer"` // * Region string `json:"region"` // UL1741SA-IOS-NE:2018 }
type GridStatus ¶
type GridStatus struct { Status SystemStatus `json:"grid_status"` // SystemGridConnected Active bool `json:"grid_services_active"` // false in normal operation. Unclear what this means. }
type HTTPMethod ¶
type HTTPMethod string
type Installer ¶
type Installer struct { Company string `json:"company"` CustomerID string `json:"customer_id"` Phone string `json:"phone"` Email string `json:"email"` Location string `json:"location"` Mounting string `json:"mounting"` Wiring string `json:"wiring"` BackupConfiguration string `json:"backup_configuration"` SolarInstallation string `json:"solar_installation"` HasStackKit bool `json:"has_stack_kit"` HasPowerlineToEthernet bool `json:"has_powerline_to_ethernet"` RunSitemaster bool `json:"run_sitemaster"` VerifiedConfig bool `json:"verified_config"` InstallationTypes []string `json:"installation_types"` }
type MeterDetails ¶
type MeterDetails struct { LastCommunicationTime Time `json:"last_communication_time"` // YYYY-MM-DDTHH:MM:SS-HH:MM InstantPower float64 `json:"instant_power"` InstantReactivePower float64 `json:"instant_reactive_power"` InstantApparentPower float64 `json:"instant_apparant_power"` Frequency float64 `json:"frequency"` EnergyExported float64 `json:"energy_exported"` EnergyImported float64 `json:"energy_imported"` InstantAverageVoltage float64 `json:"instant_average_voltage"` InstantTotalCurrent float64 `json:"instant_total_current"` IACurrent float64 `json:"i_a_current"` IBCurrent float64 `json:"i_b_current"` ICCurrent float64 `json:"i_c_current"` LastPhaseVoltageCommunicationTime Time `json:"last_phase_voltage_communication_time"` LastPhasePowerCommunicationTime Time `json:"last_phase_power_communication_time"` // Would like to turn Timeout into a time.Duration, but I need to know units. Timeout int64 `json:"timeout"` }
type Monitor ¶
type Monitor interface { io.Closer GetNetworks() ([]Network, error) GetSiteInfo() (*SiteInfo, error) GetOperation() (*Operation, error) GetConfig() (*Config, error) GetPowerwalls() (*Powerwalls, error) GetStatus() (*Status, error) GetSiteMaster() (*SiteMaster, error) GetAggregates() (*Aggregates, error) GetSOE() (*SOE, error) GetGridStatus() (*GridStatus, error) GetSolars() ([]Solar, error) GetInstaller() (*Installer, error) }
type Network ¶
type Network struct { Name string `json:"network_name"` Interface NetworkInterface `json:"interface"` DHCP bool `json:"dhcp"` Enabled bool `json:"enabled"` ExtraIPs []IP `json:"extra_ips"` Active bool `json:"active"` Primary bool `json:"primary"` Info NetworkInfo `json:"iface_network_info"` }
type NetworkInfo ¶
type NetworkInfo struct { Name string `json:"network_name"` Networks []IP `json:"networks"` Gateway string `json:"gateway"` Interface NetworkInterface `json:"interface"` State string `json:"state"` StateReason string `json:"state_reason"` SignalStrength int `json:"signal_strength"` HardwareAddress string `json:"hw_address"` }
type NetworkInterface ¶
type NetworkInterface int
const ( Ethernet NetworkInterface = iota Cellular Wifi )
func (NetworkInterface) String ¶
func (n NetworkInterface) String() string
func (*NetworkInterface) UnmarshalJSON ¶
func (n *NetworkInterface) UnmarshalJSON(b []byte) error
type OperatingMode ¶
type OperatingMode int
const ( Backup OperatingMode = iota SelfConsumption Autonomous Scheduler SiteControl )
func (OperatingMode) String ¶
func (o OperatingMode) String() string
func (*OperatingMode) UnmarshalJSON ¶
func (n *OperatingMode) UnmarshalJSON(b []byte) error
type Operation ¶
type Operation struct { RealMode OperatingMode `json:"real_mode"` // "backup" BackupReservePercent float64 `json:"backup_reserve_percent"` FreqShiftLoadShedSOE float64 `json:"freq_shift_load_shed_soe"` FreqShiftLoadShedDeltaF float64 `json:"freq_shift_load_shed_delta_f"` }
type Options ¶
type Options struct { // Gateway is the hostname or IP address of the Tesla // Energy gateway. Gateway string // Username should be the "customer" username for the gateway. // You'll have to setup these credentials by pointing your // browser at the gateway and going through the customer // account setup flow before using this monitor. Username string // Password should be the "customer" password for the gateway. Password string }
Options describes the information needed to extract information from the Tesla Energy Gateway about your powerwalls.
type Powerwall ¶
type Powerwall struct { UnusedType string `json:"Type"` PackagePartNumber string PackageSerialNumber string Type string `json:"type"` // acpw GridState GridState `json:"grid_state"` // "Grid_Uncompliant" GridReconnectionTimeSeconds FloatDurationSeconds `json:"grid_reconnection_time_seconds"` UnderPhaseDetection bool `json:"under_phase_detection"` Updating bool `json:"updating"` CommissioningDiagnostic Diagnostic `json:"commissioning_diagnostic"` UpdateDiagnostic Diagnostic `json:"update_diagnostic"` }
type Powerwalls ¶
type Powerwalls struct { Enumerating bool `json:"enumerating"` Updating bool `json:"updating"` CheckingIfOffGrid bool `json:"checking_if_offgrid"` RunningPhaseDetection bool `json:"running_phase_detection"` PhaseDetectionLastError string `json:"phase_detection_last_error"` BubbleShedding bool `json:"bubble_shedding"` OnGridCheckError string `json:"on_grid_check_error"` GridQualifying bool `json:"grid_qualifying"` GridCodeValidating bool `json:"grid_code_validating"` PhaseDetectionNotAvailable bool `json:"phase_detection_not_available"` Powerwalls []Powerwall `json:"powerwalls"` }
type SiteInfo ¶
type SiteInfo struct { MaxSystemEnergykWh int64 `json:"max_system_energy_kWh"` MaxSystemPowerkW int64 `json:"max_system_power_kW"` SiteName string `json:"site_name"` TimeZone TimeZone `json:"timezone"` MaxSiteMeterPowerkW int64 `json:"max_site_meter_power_kW"` MinSiteMeterPowerkW int64 `json:"min_site_meter_power_kW"` NominalSystemEnergykWh float64 `json:"nominal_system_energy_kWh"` NominalSystemPowerkW float64 `json:"nominal_system_power_kW"` GridCode GridCode `json:"grid_code"` }
type SiteMaster ¶
type Status ¶
type Status struct { StartTime Time `json:"start_time"` UpTime Duration `json:"up_time_seconds"` IsNew bool `json:"is_new"` Version string `json:"version"` // 20.49.0 GitHash string `json:"git_hash"` // hexadecimal sequence CommissionCount int `json:"commission_count"` // 0 // jrester code suggests gateway1 == "hec", gateway2 == "teg", // and a not yet attributed value "smc" DeviceType string `json:"device_type"` // "hec" // jrester code suggests sync type values can include // "v1", "v2", and "v2.1" SyncType string `json:"sync_type"` // v1 }
type SystemStatus ¶
type SystemStatus int
const ( GridConnected SystemStatus = iota IslandedReady IslandedActive TransitionToGrid )
func (SystemStatus) String ¶
func (s SystemStatus) String() string
func (*SystemStatus) UnmarshalJSON ¶
func (s *SystemStatus) UnmarshalJSON(b []byte) error
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func (*Time) UnmarshalJSON ¶
type TimeZone ¶
type TimeZone struct {
// contains filtered or unexported fields
}
func (TimeZone) MarshalJSON ¶
func (*TimeZone) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.