enphase

package module
v0.0.0-...-8937cbc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 9 Imported by: 0

README

enphase

Code to query enphase hardware

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStreamMeterHandler

func DefaultStreamMeterHandler(obj *StreamMeter)

Types

type Envoy

type Envoy struct {
	SerialNumber      string
	InstallerUsername string
	InstallerPassword string
	URL               string
}

func NewEnvoy

func NewEnvoy(s, u, p, url string) *Envoy

func (*Envoy) GetProduction

func (e *Envoy) GetProduction() (*Production, error)

func (*Envoy) GetStreamMeter

func (e *Envoy) GetStreamMeter(handler func(*StreamMeter)) error

type Production

type Production struct {
	Production  []*ProductionInfo `json:"production"`
	Consumption []*ProductionInfo `json:"consumption"`
	Storage     []*ProductionInfo `json:"storage"`
}

func (*Production) String

func (p *Production) String() string

type ProductionInfo

type ProductionInfo struct {
	Type             string  `json:"type"`
	ActiveCount      int     `json:"activeCount"`      // 1
	MeasurementType  string  `json:"measurementType"`  // "production",
	ReadingTime      int64   `json:"readingTime"`      // 1660454270,
	WNow             float32 `json:"wNow"`             // 5261.947
	WhLifetime       float32 `json:"whLifetime"`       // 30015.385,
	VarhLeadLifetime float32 `json:"varhLeadLifetime"` // 3655.084,
	VarhLagLifetime  float32 `json:"varhLagLifetime"`  // 14644.192,
	VahLifetime      float32 `json:"vahLifetime"`      // 44573.333,
	RmsCurrent       float32 `json:"rmsCurrent"`       // 22.295,
	RmsVoltage       float32 `json:"rmsVoltage"`       // 715.657,
	ReactPwr         float32 `json:"reactPwr"`         // -744.02,
	ApprntPwr        float32 `json:"apprntPwr"`        // 5319.274,
	PwrFactor        float32 `json:"pwrFactor"`        // 0.99,
	WhToday          float32 `json:"whToday"`          // 16796.385,
	WhLastSevenDays  float32 `json:"whLastSevenDays"`  // 29147.385,
	VahToday         float32 `json:"vahToday"`         // 20645.333,
	VarhLeadToday    float32 `json:"varhLeadToday"`    // 2802.084,
	VarhLagToday     float32 `json:"varhLagToday"`     // 3578.192
}

type StreamMeter

type StreamMeter struct {
	Production struct {
		A StreamMeterInfo `json:"ph-a"`
		B StreamMeterInfo `json:"ph-b"`
		C StreamMeterInfo `json:"ph-c"`
	} `json:"production"`
	Net struct {
		A StreamMeterInfo `json:"ph-a"`
		B StreamMeterInfo `json:"ph-b"`
		C StreamMeterInfo `json:"ph-c"`
	} `json:"net-consumption"`
	Consumption struct {
		A StreamMeterInfo `json:"ph-a"`
		B StreamMeterInfo `json:"ph-b"`
		C StreamMeterInfo `json:"ph-c"`
	} `json:"total-consumption"`
}

func (*StreamMeter) String

func (s *StreamMeter) String() string

type StreamMeterInfo

type StreamMeterInfo struct {
	Power       float32 `json:"p"`
	Q           float32 `json:"q"` //?
	S           float32 `json:"s"` //?
	Voltage     float32 `json:"v"`
	Current     float32 `json:"i"`
	PowerFactor float32 `json:"pf"`
	Frequency   float32 `json:"f"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL