envoy

package module
v0.0.0-...-ef27086 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: BSD-2-Clause Imports: 10 Imported by: 2

README

go-envoy

Pull data from an Enphase IQ Envoy or IQ Combiner

This uses the local API, not the Cloud API, so you can poll as frequently as you like

Only basic features will be supported

  • reading inventory
  • reading current consumption/production/storage data

Usage

First argument is the command you want to run, second argument is the IP address or hostname of your IQ. If no IP/hostname is passed in the application will attempt to find the IQ on your network.

% envoy <command> <envoy IP/hostname>

Examples

  • see current production / max, consumption, net statistics
  • max is calculated based on the sum of the highest production each panel has produced since last IQ reboot
% envoy now
Production: 6698.88W / 8808W	Consumption: 722.03W	Net: -5976.85W

Or pass in the IP of your IQ

% envoy now 192.168.0.123
Production: 6698.88W / 8808W    Consumption: 722.03W    Net: -5976.85W
  • see today's totals
% envoy today
Production: 13.55kWh	Consumption: 8.58kWh	Net: 0.00kWh
  • see envoy info
% envoy info
Serial Number:  xxx
Part Number:  800-00555-r03
Software Version:  R4.10.35

Building

  • Requires go1.15 or newer.
% go build -o envoy cmd/envoy/main.go

TO DO

This does what I need, if there are features you'd like, please let me know

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover() (string, error)

func SetLogger

func SetLogger(l envoylogger)

Types

type Envoy

type Envoy struct {
	// contains filtered or unexported fields
}

func New

func New(host string) (*Envoy, error)

func (*Envoy) Close

func (e *Envoy) Close()

func (*Envoy) Home

func (e *Envoy) Home() (*home, error)

func (*Envoy) Host

func (e *Envoy) Host() string

func (*Envoy) Info

func (e *Envoy) Info() (*EnvoyInfo, error)

func (*Envoy) Inventory

func (e *Envoy) Inventory() (*[]inventory, error)

http://envoy.local/inventory.json?deleted=1

func (*Envoy) Inverters

func (e *Envoy) Inverters() (*[]Inverter, error)

func (*Envoy) Now

func (e *Envoy) Now() (float64, float64, float64, error)

func (*Envoy) Password

func (e *Envoy) Password(p string)

func (*Envoy) Production

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

func (*Envoy) Rediscover

func (e *Envoy) Rediscover() error

func (*Envoy) SystemMax

func (e *Envoy) SystemMax() (uint64, error)

func (*Envoy) Today

func (e *Envoy) Today() (float64, float64, float64, 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 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 Stream

type Stream struct {
	Production       streamSet `json:"production"`
	NetConsumption   streamSet `json:"net-consumption"`
	TotalConsumption streamSet `json:"total-consumption"`
}

Stream is the type for the webstream

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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