inverter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChannelDescriptions = map[string]string{
	"A.Ms.Amp":  "Input A DC current",
	"A.Ms.Vol":  "Input A DC voltage",
	"A.Ms.Watt": "Input A DC power",
	"B.Ms.Amp":  "Input B DC current",
	"B.Ms.Vol":  "Input B DC voltage",
	"B.Ms.Watt": "Input B DC power",

	"E-Total": "Total amount of feeding-in energy",

	"GridMs.PhV.phsA": "Grid voltage on phase L1",
	"GridMs.PhV.phsB": "Grid voltage on phase L2",
	"GridMs.PhV.phsC": "Grid voltage on phase L3",

	"Pac": "Delivered active power",

	"Cntry":           "Country Specific Standard",
	"Error":           "Error message",
	"GridMs.Hz":       "Grid frequency",
	"HP.swRev":        "Firmware version of the central assembly",
	"Inv.TmpLimStt":   "Status display for the derating due to excess temperatures",
	"MainModel":       "Inverter Device class",
	"Mlt.BatCha.Pwr":  "Minimum On power for MFR battery bank",
	"Mlt.BatCha.Tmm":  "Minimum time before reconnection of MFR battery bank",
	"Mlt.ComCtl.Sw":   "Status of MFR with control via communication",
	"Mlt.MinOnPwr":    "Minimum On power for MFR self-consumption",
	"Mlt.MinOnPwrTmm": "Minimum power On time, MFR self-consumption",
	"Mlt.MinOnTmm":    "Minimum On time for MFR self-consumption",
	"Mlt.OpMode":      "Operating mode of multifunction relay",
	"Mode":            "Operating condition",
	"Model":           "Inverter Device type",
	"MPPShdw.IsOn":    "OptiTrac Global Peak switched on",
	"Mt.TotOpTmh":     "Total number of grid-feeding operational hours",
	"Mt.TotTmh":       "Total number of operating hours of inverter",
	"Op.EvtCntUsr":    "Number of events for user",
	"Op.EvtNo":        "Current event number",
	"Op.GriSwStt":     "Grid relay status",
	"Op.OpModSet":     "Operating condition",
	"Op.TmsRmg":       "Waiting time until feed-in",
	"Pkg.swRev":       "Software version of components in inverter",
	"Plimit":          "Maximum active power device",
	"Serial Number":   "Serial number",
	"SerNumSet":       "Serial number",
	"SY_Systemzeit":   "System time as linux timestamp",
	"SY_Zeitzone":     "System timezone",

	"Wind_a0": "Power characteristic curves coefficient for Udc^0",
	"Wind_a1": "Power characteristic curves coefficient for Udc^1",
	"Wind_a2": "Power characteristic curves coefficient for Udc^2",
	"Wind_a3": "Power characteristic curves coefficient for Udc^3",
}

ChannelDescriptions is a mapping from channel names to their description. [0]: http://files.sma.de/dl/1348/NG_PAR-TB-en-22.pdf [1]: https://www.energymatters.com.au/images/SMA/SBNG_PAR-TEN084410.pdf

Functions

func Initialize

func Initialize(yasdiConfigFile string, driver, devices int) (handles []int, err error)

Initialize initializes yasdi and detects devices. If Initialize returns without an error, then you will need to execute Shutdown after usage.

func Shutdown

func Shutdown()

Shutdown needs to be run after successful initialization and usage.

Types

type Channel

type Channel struct {
	Handle       int
	DeviceHandle int
	Name         string
	Unit         string
	Minimum      float64
	Maximum      float64
	Description  string
}

func NewChannel

func NewChannel(deviceHandle, channelHandle int) (*Channel, error)

func (*Channel) GetValues

func (c *Channel) GetValues() (float64, string, error)

func (*Channel) String

func (c *Channel) String() string

type Inverter

type Inverter struct {
	Handle       int
	SerialNumber uint
	Name         string
	Channels     map[string]*Channel
}

func NewInverter

func NewInverter(deviceHandle int) (*Inverter, error)

func (*Inverter) GetChannelUnit

func (i *Inverter) GetChannelUnit(channelName string) (string, error)

func (*Inverter) GetChannelValue

func (i *Inverter) GetChannelValue(channelName string) (float64, error)

func (*Inverter) GetName

func (i *Inverter) GetName() string

func (*Inverter) GetSerialNumber

func (i *Inverter) GetSerialNumber() uint

type Plant

type Plant struct {
	Inverters []*Inverter
	Channels  []string
	// contains filtered or unexported fields
}

Plant implements the scraper interface to make its metrics available via prometheus

func NewPlant

func NewPlant(yasdiFile string, driverID, devices int, channels []string) (*Plant, error)

func (*Plant) Detect

func (p *Plant) Detect() error

func (*Plant) Initialize

func (p *Plant) Initialize() error

func (*Plant) Shutdown

func (p *Plant) Shutdown()

type ScrapeableInverter

type ScrapeableInverter interface {
	GetChannelValue(channel string) (float64, error)
	GetName() string
	GetChannelUnit(channelName string) (string, error)
	GetSerialNumber() uint
}

type SimulatedChannel

type SimulatedChannel struct {
	Min   float64
	Max   float64
	Adder float64
	Value float64
}

type Simulation

type Simulation struct {
	Serial       uint
	Name         string
	Channels     map[string]SimulatedChannel
	ChannelUnits map[string]string
}

func NewSimulation

func NewSimulation(serial uint, name string) *Simulation

func (*Simulation) GetChannelUnit

func (i *Simulation) GetChannelUnit(channelName string) (string, error)

func (*Simulation) GetChannelValue

func (i *Simulation) GetChannelValue(channel string) (float64, error)

func (*Simulation) GetName

func (i *Simulation) GetName() string

func (*Simulation) GetSerialNumber

func (i *Simulation) GetSerialNumber() uint

Jump to

Keyboard shortcuts

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