Documentation ¶
Overview ¶
Package aurora provides an interface for communicating with Power-One Aurora inverters.
Index ¶
- Constants
- Variables
- type AlarmState
- type AlarmStates
- type Argument
- type Byte
- type Command
- type ConfigurationState
- type Counter
- type CumulationPeriod
- type DCDCState
- type DSParameter
- type GlobalState
- type InputType
- type Inverter
- func (i *Inverter) BoosterTemperature() (float32, error)
- func (i *Inverter) CommCheck() error
- func (i *Inverter) Communicate(command Command, args ...Argument) ([]byte, error)
- func (i *Inverter) CommunicateVar(v interface{}, command Command, args ...Argument) error
- func (i *Inverter) Configuration() (ConfigurationState, error)
- func (i *Inverter) DailyEnergy() (uint32, error)
- func (i *Inverter) FirmwareVersion() (string, error)
- func (i *Inverter) Frequency() (float32, error)
- func (i *Inverter) GetCounterData(counter Counter) (uint32, error)
- func (i *Inverter) GetCumulatedEnergy(period CumulationPeriod) (uint32, error)
- func (i *Inverter) GetDSPData(parameter DSParameter) (float32, error)
- func (i *Inverter) GetTime() (time.Time, error)
- func (i *Inverter) GridCurrent() (float32, error)
- func (i *Inverter) GridPower() (float32, error)
- func (i *Inverter) GridRunTime() (time.Duration, error)
- func (i *Inverter) GridVoltage() (float32, error)
- func (i *Inverter) Input1Current() (float32, error)
- func (i *Inverter) Input1Voltage() (float32, error)
- func (i *Inverter) Input2Current() (float32, error)
- func (i *Inverter) Input2Voltage() (float32, error)
- func (i *Inverter) InverterTemperature() (float32, error)
- func (i *Inverter) Joules() (uint16, error)
- func (i *Inverter) Last4Alarms() ([]AlarmState, error)
- func (i *Inverter) ManufactureDate() (string, string, error)
- func (i *Inverter) MonthlyEnergy() (uint32, error)
- func (i *Inverter) PartNumber() (string, error)
- func (i *Inverter) PartialEnergy() (uint32, error)
- func (i *Inverter) PartialRunTime() (time.Duration, error)
- func (i *Inverter) ResetRunTime() error
- func (i *Inverter) SerialNumber() (string, error)
- func (i *Inverter) SetTime(t time.Time) error
- func (i *Inverter) State() (*State, error)
- func (i *Inverter) TotalEnergy() (uint32, error)
- func (i *Inverter) TotalRunTime() (time.Duration, error)
- func (i *Inverter) Version() (*Version, error)
- func (i *Inverter) WeeklyEnergy() (uint32, error)
- func (i *Inverter) YearlyEnergy() (uint32, error)
- type InverterState
- type InverterType
- type Product
- type ProductSpec
- type State
- type TransmissionState
- type Version
Constants ¶
const InverterEpochOffset = 946706400
InverterEpochOffset is the number of seconds since unix epoch that Power-One started the Aurora firmware epoch
Variables ¶
var ErrCRCFailure = errors.New("CRC Failure")
ErrCRCFailure is returned whenever the data read in from the serial port might have been corrupted en route and no longer matches the crc
Functions ¶
This section is empty.
Types ¶
type AlarmState ¶
type AlarmState byte
AlarmState is a state of alarm returned by the inverter as part of the State struct or as an array of 4 AlarmStates in response to the Last4Alarms request
const ( AlarmNone AlarmState = iota AlarmSunLow1 AlarmInputOverCurrent AlarmInputUnderVoltage AlarmInputOverVoltage AlarmSunLow5 AlarmNoParameters AlarmBulkOverVoltage AlarmCommError AlarmOutputOverCurrent AlarmIGBTSat AlarmBulkUV11 AlarmE009 AlarmGridFail AlarmBulkLow AlarmRampFail AlarmDCDCFail16 AlarmWrongMode AlarmGroundFault18 AlarmOverTemp AlarmBulkCapFail AlarmInverterFail AlarmStartTimeout AlarmGroundFault23 AlarmDegaussError AlarmIleakSensFail AlarmDCDCFail25 AlarmSelfTestError1 AlarmSelfTestError2 AlarmSelfTestError3 AlarmSelfTestError4 AlarmDCInjError AlarmGridOverVoltage AlarmGridUnderVoltage AlarmGridOF AlarmGridUF AlarmZGridHi AlarmE024 AlarmRisoLow ALarmVrefError AlarmErrorMeasV AlarmErrorMeasF AlarmErrorMeasI AlarmErrorMeasIleak AlarmReadErrorV AlarmReadErrorI AlarmTableFail AlarmFanFail AlarmUTH AlarmInterlockFail AlarmRemoteOff AlarmVoutAvgError AlarmBatteryLow AlarmClkFail AlarmInputUC AlarmZeroPower AlarmFanStucked AlarmDCSwitchOpen AlarmBulkUV58 AlarmAutoexclusion AlarmGridDFDT AlarmDenSwitchOpen AlarmJboxFail )
Alarm states
func (AlarmState) String ¶
func (a AlarmState) String() string
type AlarmStates ¶
type AlarmStates []AlarmState
AlarmStates an array of AlarmState returned byt he Last4Alarms request
func (AlarmStates) String ¶
func (a AlarmStates) String() string
type Argument ¶
type Argument interface {
Byte() byte
}
Argument is an interface that exposes Byte() to return a single byte representation of the given argument
type Command ¶
type Command byte
Command is a command to send to the inverter
const ( GetState Command = 50 + iota // Get the inverter state GetPartNumber // Get the inverters part number GetVersion // Get the hardware build version GetDSP // Get a value from the DSP GetSerialNumber // Get the inverters serial number GetManufacturingDate // Get the year and month of manufacture GetTime // Get the time from the inverter SetTime // Set the time for the inverter GetFirmwareVersion // Get the inverters firmware version GetLast10SecEnergy // Get the amount of energy exported in the past 10 seconds GetConfiguration // Get the inverter configuration GetCumulatedEnergy // Get a value from the cumulated energy table GetCounters // Get a counter GetLast4Alarms // Get the last 4 alarms )
Command values
type ConfigurationState ¶
type ConfigurationState byte
ConfigurationState is a state of configuration returned by the inverter
const ( ConfigBoth ConfigurationState = iota ConfigString1 ConfigString2 )
Configuration states
func (ConfigurationState) String ¶
func (c ConfigurationState) String() string
type Counter ¶
type Counter byte
Counter is a counter parameter to request from the inverter with the GetCounter command
type CumulationPeriod ¶
type CumulationPeriod byte
CumulationPeriod is a period parameters to request from the inverter
const ( CumulatedDaily CumulationPeriod = iota CumulatedWeekly CumulatedMonthly CumulatedYearly CumulatedTotal CumulatedPartial )
Available cumulation values
type DCDCState ¶
type DCDCState byte
DCDCState is a DCDC status flag from the inverter as part of the State struct
const ( DCDCOff DCDCState = iota DCDCRampStart DCDCMPPT DCDCInputOverCurrent DCDCInputUnderVoltage DCDCInputOverVoltage DCDCInputLow DCDCNoParameters DCDCBulkOverVoltage DCDCCommunicationError DCDCRampFail DCDCInternalError DCDCInputModeError DCDCGroundFault DCDCInverterFail DCDCIGBTSat DCDCILEAKFail DCDCGridFail DCDCCommError )
DCDC states
type DSParameter ¶
type DSParameter byte
DSParameter is a DSP parameter to request from the inverter
const ( DSPGridVoltage DSParameter = (1 + iota) DSPGridCurrent DSPGridPower DSPFrequency DSPVbulk DSPIleakDCDC DSPIleakInverter DSPPin1 DSPPin2 DSPInverterTemperature DSParameter DSPBoosterTemperature DSPInput1Voltage DSPInput1Current DSPInput2Voltage DSPInput2Current DSPGridVoltageDCDC DSPGridFrequencyDCDC DSPIsolationResistance DSPVbulkDCDC DSPAverageGridVoltage DSPVbulkMid DSPPowerPeak DSPPowerPeakToday DSPGridVoltageNeutral DSPWindGeneratorFrequency DSPGridVoltageNeutralPhase DSPGridCurrentPhaseR DSPGridCurrentPhaseS DSPGridCurrentPhaseT DSPFrequencyPhaseR DSPFrequencyPhaseS DSPFrequencyPhaseT DSPVbulkPositive DSPVbulkNegative DSPSupervisorTemperature DSPAlimTemperature DSPHeatSinkTemperature DSPTemperature1 DSPTemperature2 DSPTemperature3 DSPFan1Speed DSPFan2Speed DSPFan3Speed DSPFan4Speed DSPFan5Speed DSPPowerSaturationLimit DSPRiferimentoAnelloBulk DSPVpanelMicro DSPGridVoltagePhaseR DSPGridVoltagePhaseS DSPGridVoltagePhaseT )
Available DSP values
func (DSParameter) String ¶
func (d DSParameter) String() string
type GlobalState ¶
type GlobalState byte
GlobalState is a global status flag returned by the inverter as part of the State sturct
const ( GSSendingParameters GlobalState = iota GSWaitingSunGrid GSCheckingGrid GSMeasuringRiso GSDCDCStart GSInverterTurnOn GSRun GSRecovery GSPause GSGroundFault GSOTHFault GSAddressSetting GSSelfTest GSSelfTestFail GSSensorTestMeasureRiso GSLeakFault GSWaitingManualReset GSInternalErrorE026 GSInternalErrorE027 GSInternalErrorE028 GSInternalErrorE029 GSInternalErrorE030 GSSendingWindTable GSFailedSendingTable GSUTHFault GSRemoteOff GSInterlockFail GSExecutingAutotest GSWaitingSun GSTemperatureFault GSFanStaucked GSIntComFail GSSlaveInsertion GSDCSwitchOpen GSTrasSwitchOpen GSMasterExclusion GSAutoExclusion GSErasingInternalEEprom GlobalState GSErasingExternalEEprom GSCountingEEprom GSFreeze )
Global states
func (GlobalState) String ¶
func (g GlobalState) String() string
type Inverter ¶
type Inverter struct { Conn io.ReadWriter Address byte }
Inverter structure for connecting to an inverter
func (*Inverter) BoosterTemperature ¶
BoosterTemperature returns the current temperature of the booster in celsius
func (*Inverter) CommCheck ¶
CommCheck calls the simplest command supported by the inverter "GetVersion" just as a quick check to make sure it's connected and working. You might want to wrap a deadline around this call.
func (*Inverter) Communicate ¶
Communicate encodes and transmits given commands returning a response having checked the CRC and transmission state if applicable
func (*Inverter) CommunicateVar ¶
CommunicateVar works much like Communicate but expects an interface to write the response to
func (*Inverter) Configuration ¶
func (i *Inverter) Configuration() (ConfigurationState, error)
Configuration returns the current configuration state from the inverter
func (*Inverter) DailyEnergy ¶
DailyEnergy returns the daily cumulated energy
func (*Inverter) FirmwareVersion ¶
FirmwareVersion returns the inverters firmware version
func (*Inverter) GetCounterData ¶
GetCounterData returns the value (seconds?) from one of the counters being total, partial, grid, and reset runtimes.
func (*Inverter) GetCumulatedEnergy ¶
func (i *Inverter) GetCumulatedEnergy(period CumulationPeriod) (uint32, error)
GetCumulatedEnergy returns the cumulated energy for a given period
func (*Inverter) GetDSPData ¶
func (i *Inverter) GetDSPData(parameter DSParameter) (float32, error)
GetDSPData returns data for various DSParameters
func (*Inverter) GetTime ¶
GetTime returns the current timestamp from the inverter, returns as a unix epoch based timestamp
func (*Inverter) GridCurrent ¶
GridCurrent returns the amount of current (in amps) being pushed to the grid.
func (*Inverter) GridPower ¶
GridPower returns the amount of power (in watts) being pushed to the grid.
func (*Inverter) GridRunTime ¶
GridRunTime returns the amount of time the inverter has been on grid
func (*Inverter) GridVoltage ¶
GridVoltage returns the voltage from the grid
func (*Inverter) Input1Current ¶
Input1Current returns the amount of current (in amps) being received from input 1
func (*Inverter) Input1Voltage ¶
Input1Voltage returns the voltage received on input 1 from your solar array/wind turbine
func (*Inverter) Input2Current ¶
Input2Current returns the amount of current (in amps) being received from input 2
func (*Inverter) Input2Voltage ¶
Input2Voltage returns the voltage received on input 2 from your solar array/wind turbine
func (*Inverter) InverterTemperature ¶
InverterTemperature returns the current temperature of the inverter in celsius
func (*Inverter) Joules ¶
Joules returns the amount of power produced in the last 10 seconds as Joules
func (*Inverter) Last4Alarms ¶
func (i *Inverter) Last4Alarms() ([]AlarmState, error)
Last4Alarms returns the last 4 alarm states
func (*Inverter) ManufactureDate ¶
ManufactureDate returns the inverters date of manufacture
func (*Inverter) MonthlyEnergy ¶
MonthlyEnergy returns the monthly cumulated energy
func (*Inverter) PartNumber ¶
PartNumber returns the inverters part number
func (*Inverter) PartialEnergy ¶
PartialEnergy returns the cumulated energy since last reset
func (*Inverter) PartialRunTime ¶
PartialRunTime returns the partial runtime of the inverter...
func (*Inverter) ResetRunTime ¶
ResetRunTime resets the counter
func (*Inverter) SerialNumber ¶
SerialNumber returns the inverters serial number
func (*Inverter) SetTime ¶
SetTime sets the time in the inverter to the given timestamp. Warning: this may result in the resetting of partial counters/cumulaters.
func (*Inverter) TotalEnergy ¶
TotalEnergy returns the total cumulated energy
func (*Inverter) TotalRunTime ¶
TotalRunTime returns the total runtime for the inverter
func (*Inverter) WeeklyEnergy ¶
WeeklyEnergy returns the weekly cumulated energy
func (*Inverter) YearlyEnergy ¶
YearlyEnergy returns the yearly cumulated energy
type InverterState ¶
type InverterState byte
InverterState is a status flag returned by the inverter as part of the State struct
const ( ISStandBy InverterState = iota ISCheckingGrid ISRun ISBulkOverVoltage ISOutOverCurrent ISIGBTSat ISBulkUnderVoltage ISDegaussError ISNoParameters ISBulkLow ISGridOverVoltage ISCommunicationError ISDegaussing ISStarting ISBulkCapFail ISLeakFail ISDCDCFail ISIleakSensorFail ISSelfTestRelayInverter ISSelfTestWaitSensorTest ISSelfTestTestRelayDCDCSensor ISSelfTestRelayInverterFail ISSelfTestTimeoutFail ISSelfTestRelayDCDCFail ISSelfTest1 ISWaitingSelfTestStart ISDCInjection ISSelfTest2 ISSelfTest3 ISSelfTest4 ISInternalError30 ISInternalError31 ISForbiddenState InverterState ISInputUC ISZeroPower ISGridNotPresent ISWaitingStart ISMPPT ISGRIDFAIL ISINPUTOC )
Inverter states
func (InverterState) String ¶
func (i InverterState) String() string
type InverterType ¶
type InverterType byte
InverterType is a value returned as part of the Version struct
const ( InverterTransformerless InverterType = 78 InverterTransformer InverterType = 84 )
Inverter types
func (InverterType) String ¶
func (i InverterType) String() string
type Product ¶
type Product byte
Product is a product/model as returned by the inverter as part of the Version struct
const ( Product2kWIndoor Product = 'i' Product2kWOutdoor Product = 'o' Product3_6kWIndoor Product = 'I' Product3_6kWOutdoor Product = 'O' Product5kWOutdoor Product = '5' Product6kWOutdoor Product = '6' Product3PhaseInterface Product = 'P' Product50kWModule Product = 'C' Product4_2kWNew Product = '4' Product3_6kWNew Product = '3' Product3_3kWNew Product = '2' Product3_0kWNew Product = '1' Product12kW Product = 'D' Product10kW Product = 'X' )
Known products/models
type ProductSpec ¶
type ProductSpec byte
ProductSpec is a product specification/standard returned by the inverter as part of the Version struct
const ( ProductSpecUL1741 ProductSpec = 'A' ProductSpecVDE0126 ProductSpec = 'E' ProductSpecDR1663_2000 ProductSpec = 'S' ProductSpecENELDK5950 ProductSpec = 'I' ProductSpecUKG83 ProductSpec = 'U' ProductSpecAS4777 ProductSpec = 'K' ProductSpecVDEFrench ProductSpec = 'F' )
Known product specifications/regulations
func (ProductSpec) String ¶
func (p ProductSpec) String() string
type State ¶
type State struct { Global GlobalState Inverter InverterState Channel1 DCDCState Channel2 DCDCState Alarm AlarmState }
State holds the structure for the inverter state, returned by the State() func
type TransmissionState ¶
type TransmissionState byte
TransmissionState is a status flag returned by the inverter
const ( TSOk TransmissionState = 0 TSCommandNotImplemented TransmissionState = (51 + iota) TSVariableDoesNotExist TSValueOutOfRange TSEEpromNotAccessible TSMicroError TSNotExecuted TSVariableNotAvailable )
Transmission states
func (TransmissionState) String ¶
func (t TransmissionState) String() string
type Version ¶
type Version struct { Model Product Regulation ProductSpec Transformer InverterType Type InputType }
Version holds the structure for the inverter version/model, returned byt he Version() func