Documentation
¶
Index ¶
- func Discover(ctx context.Context) (string, error)
- func GetToken(ctx context.Context, username, password, serialNumber string) (string, error)
- type Entry
- type Envoy
- func (e *Envoy) Home(ctx context.Context) (*home, error)
- func (e *Envoy) Info(ctx context.Context) (*EnvoyInfo, error)
- func (e *Envoy) Inventory(ctx context.Context) (*[]Inventory, error)
- func (e *Envoy) Inverters(ctx context.Context) (*[]Inverter, error)
- func (e *Envoy) Now(ctx context.Context) (tp, tc, net float64, err error)
- func (e *Envoy) Production(ctx context.Context) (*Production, error)
- type EnvoyInfo
- type Inventory
- type Inverter
- type Line
- type Production
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
Type string `json:"type"`
MeasurementType string `json:"measurementType"`
State string `json:"state,omitempty"`
Lines []Line `json:"lines,omitempty"`
ActiveCount int `json:"activeCount"`
ReadingTime int `json:"readingTime"`
WNow float64 `json:"wNow,omitempty"`
WhLifetime float64 `json:"whLifetime,omitempty"`
WhNow float64 `json:"whNow,omitempty"`
VarhLeadLifetime float64 `json:"varhLeadLifetime,omitempty"`
VarhLagLifetime float64 `json:"varhLagLifetime,omitempty"`
VahLifetime float64 `json:"vahLifetime,omitempty"`
RmsCurrent float64 `json:"rmsCurrent,omitempty"`
RmsVoltage float64 `json:"rmsVoltage,omitempty"`
ReactPwr float64 `json:"reactPwr,omitempty"`
ApprntPwr float64 `json:"apprntPwr,omitempty"`
PwrFactor float64 `json:"pwrFactor,omitempty"`
WhToday float64 `json:"whToday,omitempty"`
WhLastSevenDays float64 `json:"whLastSevenDays,omitempty"`
VahToday float64 `json:"vahToday,omitempty"`
VarhLeadToday float64 `json:"varhLeadToday,omitempty"`
VarhLagToday float64 `json:"varhLagToday,omitempty"`
}
type Envoy ¶
type Envoy struct {
// contains filtered or unexported fields
}
func (*Envoy) Production ¶
func (e *Envoy) Production(ctx context.Context) (*Production, error)
type EnvoyInfo ¶
type EnvoyInfo struct {
Device struct {
Text string `xml:",chardata"`
Sn string `xml:"sn"`
Pn string `xml:"pn"`
Software string `xml:"software"`
Euaid string `xml:"euaid"`
Seqnum string `xml:"seqnum"`
Apiver string `xml:"apiver"`
Imeter string `xml:"imeter"`
} `xml:"device"`
BuildInfo struct {
Text string `xml:",chardata"`
BuildTimeGmt string `xml:"build_time_gmt"`
BuildID string `xml:"build_id"`
} `xml:"build_info"`
XMLName xml.Name `xml:"envoy_info"`
Text string `xml:",chardata"`
Time string `xml:"time"`
Package []struct {
Text string `xml:",chardata"`
Name string `xml:"name,attr"`
Pn string `xml:"pn"`
Version string `xml:"version"`
Build string `xml:"build"`
} `xml:"package"`
}
type Inventory ¶
type Inventory struct {
Type string `json:"type"`
Devices []struct {
PartNum string `json:"part_num"`
Installed string `json:"installed"`
SerialNum string `json:"serial_num"`
LastRptDate string `json:"last_rpt_date"`
CreatedDate string `json:"created_date"`
ImgLoadDate string `json:"img_load_date"`
ImgPnumRunning string `json:"img_pnum_running"`
Ptpn string `json:"ptpn"`
DeviceStatus []string `json:"device_status"`
DeviceControl []struct {
Gficlearset bool `json:"gficlearset"`
} `json:"device_control"`
AdminState int `json:"admin_state"`
DevType int `json:"dev_type"`
Chaneid int `json:"chaneid"`
Producing bool `json:"producing"`
Communicating bool `json:"communicating"`
Provisioned bool `json:"provisioned"`
Operating bool `json:"operating"`
} `json:"devices"`
}
Inventory
type Inverter ¶
type Inverter struct {
SerialNumber string `json:"serialNumber"`
LastReportDate uint64 `json:"lastReportDate"`
DevType uint8 `json:"devType"`
LastReportWatts int16 `json:"lastReportWatts"`
MaxReportWatts uint16 `json:"maxReportWatts"`
}
requires authentication http://envoy.local/api/v1/production/inverters uint8 for Watts might be good enough, but mine are hitting 246...
type Line ¶
type Line struct {
WNow float64 `json:"wNow"`
WhLifetime float64 `json:"whLifetime"`
VarhLeadLifetime float64 `json:"varhLeadLifetime"`
VarhLagLifetime float64 `json:"varhLagLifetime"`
VahLifetime float64 `json:"vahLifetime"`
RmsCurrent float64 `json:"rmsCurrent"`
RmsVoltage float64 `json:"rmsVoltage"`
ReactPwr float64 `json:"reactPwr"`
ApprntPwr float64 `json:"apprntPwr"`
PwrFactor float64 `json:"pwrFactor"`
WhToday float64 `json:"whToday"`
WhLastSevenDays float64 `json:"whLastSevenDays"`
VahToday float64 `json:"vahToday"`
VarhLeadToday float64 `json:"varhLeadToday"`
VarhLagToday float64 `json:"varhLagToday"`
}
type Production ¶
type Production struct {
Production []Entry `json:"production"`
Consumption []Entry `json:"consumption"`
Storage []Entry `json:"storage"`
}
from the production endpoint
Click to show internal directories.
Click to hide internal directories.