fronius

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PowerDataPath is the Fronius API URL-path for power real time data
	PowerDataPath = "/solar_api/v1/GetPowerFlowRealtimeData.fcgi"
	// ArchiveDataPath is the Fronius API URL-path for archive data
	ArchiveDataPath = "" /* 177-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel added in v0.8.0

type Channel struct {
	Unit   string
	Values map[string]float64
}

Channel represents the inverter channel data

type ClientOptions

type ClientOptions struct {
	URL              string
	Headers          http.Header
	Timeout          time.Duration
	PowerFlowEnabled bool
	ArchiveEnabled   bool
}

ClientOptions holds some parameters for the SymoClient.

type Inverter

type Inverter struct {
	DT          float64 `json:"DT"`
	Power       float64 `json:"P"`
	BatterySoC  float64 `json:"SOC"`
	EnergyDay   float64 `json:"E_Day"`
	EnergyYear  float64 `json:"E_Year"`
	EnergyTotal float64 `json:"E_Total"`
}

Inverter represents a power inverter installed at the Fronius Symo site.

type InverterArchive added in v0.8.0

type InverterArchive struct {
	Data struct {
		CurrentDCString1 Channel `json:"Current_DC_String_1"`
		CurrentDCString2 Channel `json:"Current_DC_String_2"`
		VoltageDCString1 Channel `json:"Voltage_DC_String_1"`
		VoltageDCString2 Channel `json:"Voltage_DC_String_2"`
	}
}

InverterArchive represents a power archive data with its channels

type SymoClient

type SymoClient struct {
	Options ClientOptions
	// contains filtered or unexported fields
}

SymoClient is a wrapper for making API requests against a Fronius Symo device.

func NewSymoClient

func NewSymoClient(options ClientOptions) (*SymoClient, error)

NewSymoClient constructs a SymoClient ready to use for collecting metrics.

func (*SymoClient) GetArchiveData added in v0.8.0

func (c *SymoClient) GetArchiveData() (map[string]InverterArchive, error)

GetArchiveData returns the parsed data from the Symo device.

func (*SymoClient) GetPowerFlowData

func (c *SymoClient) GetPowerFlowData() (*SymoData, error)

GetPowerFlowData returns the parsed data from the Symo device.

type SymoData

type SymoData struct {
	Inverters map[string]Inverter
	Site      struct {
		Mode          string `json:"Mode"`
		MeterLocation string `json:"Meter_Location"`
		// PowerGrid is the power supplied by the grid in Watt.
		// A negative value means that excess power is provided back to the grid.
		PowerGrid float64 `json:"P_Grid"`
		// PowerLoad is the current load in Watt.
		PowerLoad float64 `json:"P_Load"`
		// PowerAccu is the current power supplied from Accumulator in Watt.
		PowerAccu float64 `json:"P_Akku"`
		// PowerPhotovoltaic is the current power coming from Photovoltaic in Watt.
		PowerPhotovoltaic float64 `json:"P_PV"`
		// RelativeSelfConsumption indicates the ratio between the current power generated and the current load.
		// When it reaches 100, the RelativeAutonomy declines, since the site can not produce enough energy and needs support from the grid.
		// If the device returns null in PowerPhotovoltaic, this field becomes also 0!
		RelativeSelfConsumption float64 `json:"rel_SelfConsumption"`
		// RelativeAutonomy is the ratio of how autonomous the installation is.
		// An autonomy of 100 means that the site is producing more energy than it is needed.
		RelativeAutonomy float64 `json:"rel_Autonomy"`
		// EnergyDay is the accumulated energy in Wh generated in this day so far.
		// It is reset at the device's configured timezone at midnight.
		EnergyDay float64 `json:"E_Day"`
		// EnergyYear is the accumulated energy in Wh generated in this year so far.
		// It is reset at the device's configured timezone at midnight of 31st of December.
		EnergyYear float64 `json:"E_Year"`
		// EnergyTotal is the accumulated energy in Wh generated in this site so far.
		EnergyTotal float64 `json:"E_Total"`
	}
}

SymoData holds the parsed data from the Symo API.

Jump to

Keyboard shortcuts

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