Documentation ¶
Index ¶
- func Discover() (string, error)
- func SetConfig(host, user, pass, serial string)
- func SetLoggerLevel(l logrus.Level)
- type Entry
- type Envoy
- func (e *Envoy) Close()
- func (e *Envoy) GetLocalSessionCookie() (err error)
- func (e *Envoy) GetToken() (err error)
- func (e *Envoy) Home() (*Home, error)
- func (e *Envoy) Info() (*EnvoyInfo, error)
- func (e *Envoy) Inventory() (*[]Inventory, error)
- func (e *Envoy) Inverters() (*[]Inverter, error)
- func (e *Envoy) Login() (err error)
- func (e *Envoy) Now() (float64, float64, float64, error)
- func (e *Envoy) Production() (*Production, error)
- func (e *Envoy) Rediscover() error
- func (e *Envoy) SystemMax() (uint64, error)
- func (e *Envoy) Today() (float64, float64, float64, error)
- type EnvoyInfo
- type Home
- type Homenet
- type Homenetif
- type Homenumlev
- type Inventory
- type Inverter
- type Line
- type Production
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLoggerLevel ¶
Types ¶
type Entry ¶
type Entry struct { Type string `json:"type"` ActiveCount int `json:"activeCount"` MeasurementType string `json:"measurementType"` 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"` State string `json:"state,omitempty"` Lines []Line `json:"lines,omitempty"` }
type Envoy ¶
type Envoy struct { Host string `json:"host"` Username string `json:"username"` Password string `json:"password"` EnvoySerial string `json:"serial"` JWTToken string `json:"jwt_token"` ManagerSessionId string `json:"-"` LocalSessionId string `json:"-"` // contains filtered or unexported fields }
func (*Envoy) GetLocalSessionCookie ¶
func (*Envoy) Production ¶
func (e *Envoy) Production() (*Production, error)
func (*Envoy) Rediscover ¶
type EnvoyInfo ¶
type EnvoyInfo struct { XMLName xml.Name `xml:"envoy_info"` Text string `xml:",chardata"` Time string `xml:"time"` 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"` 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"` BuildInfo struct { Text string `xml:",chardata"` BuildTimeGmt string `xml:"build_time_gmt"` BuildID string `xml:"build_id"` } `xml:"build_info"` }
type Home ¶
type Home struct { SoftwareBuildEpoch int `json:"software_build_epoch"` IsNonvoy bool `json:"is_nonvoy"` DbSize string `json:"db_size"` DbPercentFull string `json:"db_percent_full"` Timezone string `json:"timezone"` CurrentDate string `json:"current_date"` CurrentTime string `json:"current_time"` Network Homenet `json:"network"` Tariff string `json:"tariff"` Comm struct { Num int `json:"num"` Level int `json:"level"` Pcu Homenumlev `json:"pcu"` Acb Homenumlev `json:"acb"` Nsrb Homenumlev `json:"nsrb"` } `json:"comm"` Alerts []interface{} `json:"alerts"` // dunno on this one yet UpdateStatus string `json:"update_status"` }
type Homenetif ¶
type Homenetif struct { SignalStrength int `json:"signal_strength"` SignalStrengthMax int `json:"signal_strength_max"` Network bool `json:"network,omitempty"` Type string `json:"type"` Interface string `json:"interface"` Dhcp bool `json:"dhcp"` IP string `json:"ip"` Carrier bool `json:"carrier"` Mac string `json:"mac,omitempty"` Supported bool `json:"supported,omitempty"` Present bool `json:"present,omitempty"` Configured bool `json:"configured,omitempty"` Status string `json:"status,omitempty"` }
type Homenumlev ¶
type Homenumlev struct {}
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"` DeviceStatus []string `json:"device_status"` LastRptDate string `json:"last_rpt_date"` AdminState int `json:"admin_state"` DevType int `json:"dev_type"` CreatedDate string `json:"created_date"` ImgLoadDate string `json:"img_load_date"` ImgPnumRunning string `json:"img_pnum_running"` Ptpn string `json:"ptpn"` Chaneid int `json:"chaneid"` DeviceControl []struct { Gficlearset bool `json:"gficlearset"` } `json:"device_control"` 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.