Class AbstractSunSpecPvInverter
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
-
- io.openems.edge.bridge.modbus.sunspec.AbstractOpenemsSunSpecComponent
-
- io.openems.edge.pvinverter.sunspec.AbstractSunSpecPvInverter
-
- All Implemented Interfaces:
ModbusComponent
,OpenemsComponent
,AsymmetricMeter
,SymmetricMeter
,ManagedSymmetricPvInverter
,SunSpecPvInverter
,org.osgi.service.event.EventHandler
- Direct Known Subclasses:
FroniusPvInverter
,KacoBlueplanet
,KostalPvInverter
,SmaPvInverter
,SolarEdgePvInverter
public abstract class AbstractSunSpecPvInverter extends AbstractOpenemsSunSpecComponent implements SunSpecPvInverter, ManagedSymmetricPvInverter, AsymmetricMeter, SymmetricMeter, OpenemsComponent, org.osgi.service.event.EventHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
AbstractOpenemsModbusComponent.BitConverter, AbstractOpenemsModbusComponent.ChannelMapper<T extends AbstractModbusElement<?>>
-
Nested classes/interfaces inherited from interface io.openems.edge.meter.api.AsymmetricMeter
AsymmetricMeter.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.pvinverter.api.ManagedSymmetricPvInverter
ManagedSymmetricPvInverter.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.bridge.modbus.api.ModbusComponent
ModbusComponent.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.pvinverter.sunspec.SunSpecPvInverter
SunSpecPvInverter.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.meter.api.SymmetricMeter
SymmetricMeter.ChannelId
-
-
Field Summary
-
Fields inherited from interface io.openems.edge.meter.api.AsymmetricMeter
POWER_DOC_TEXT
-
-
Constructor Summary
Constructors Constructor Description AbstractSunSpecPvInverter(java.util.Map<SunSpecModel,Priority> activeModels, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String modbusReference, java.lang.String modbusId, int readFromCommonBlockNo)
protected boolean
activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String modbusReference, java.lang.String modbusId, int readFromCommonBlockNo, Phase phase)
Make sure to call this method from the inheriting OSGi Component.protected void
addBlock(int startAddress, SunSpecModel model, Priority priority)
Adds the block starting from startAddress.protected void
deactivate()
Make sure to call this method from the inheriting OSGi Component.java.lang.String
debugLog()
Gets some output that is suitable for a continuous Debug log.MeterType
getMeterType()
Gets the type of this Meter.protected <T extends Channel<?>>
java.util.Optional<T>getSunSpecChannel(SunSpecPoint point)
Get the Channel for the given Point.protected <T extends Channel<?>>
TgetSunSpecChannelOrError(SunSpecPoint point)
Get the Channel for the given Point or throw an error if it is not available.void
handleEvent(org.osgi.service.event.Event event)
Make sure to call this method from the inheriting OSGi Component.protected boolean
isSinglePhase()
protected void
onSunSpecInitializationCompleted()
This method is called after the SunSpec initialization was completed.-
Methods inherited from class io.openems.edge.bridge.modbus.sunspec.AbstractOpenemsSunSpecComponent
activate, defineModbusProtocol, getSunSpecModel, isSunSpecInitializationCompleted, mapFirstPointToChannel
-
Methods inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
activate, activate, getBridgeModbus, getModbusProtocol, getUnitId, m, m, m, m, m, m, modified, modified, setModbus, unsetModbus
-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, removeChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.openems.edge.meter.api.AsymmetricMeter
_setActiveConsumptionEnergyL1, _setActiveConsumptionEnergyL1, _setActiveConsumptionEnergyL2, _setActiveConsumptionEnergyL2, _setActiveConsumptionEnergyL3, _setActiveConsumptionEnergyL3, _setActivePowerL1, _setActivePowerL1, _setActivePowerL2, _setActivePowerL2, _setActivePowerL3, _setActivePowerL3, _setActiveProductionEnergyL1, _setActiveProductionEnergyL1, _setActiveProductionEnergyL2, _setActiveProductionEnergyL2, _setActiveProductionEnergyL3, _setActiveProductionEnergyL3, _setCurrentL1, _setCurrentL1, _setCurrentL2, _setCurrentL2, _setCurrentL3, _setCurrentL3, _setReactivePowerL1, _setReactivePowerL1, _setReactivePowerL2, _setReactivePowerL2, _setReactivePowerL3, _setReactivePowerL3, _setVoltageL1, _setVoltageL1, _setVoltageL2, _setVoltageL2, _setVoltageL3, _setVoltageL3, getActiveConsumptionEnergyL1, getActiveConsumptionEnergyL1Channel, getActiveConsumptionEnergyL2, getActiveConsumptionEnergyL2Channel, getActiveConsumptionEnergyL3, getActiveConsumptionEnergyL3Channel, getActivePowerL1, getActivePowerL1Channel, getActivePowerL2, getActivePowerL2Channel, getActivePowerL3, getActivePowerL3Channel, getActiveProductionEnergyL1, getActiveProductionEnergyL1Channel, getActiveProductionEnergyL2, getActiveProductionEnergyL2Channel, getActiveProductionEnergyL3, getActiveProductionEnergyL3Channel, getCurrentL1, getCurrentL1Channel, getCurrentL2, getCurrentL2Channel, getCurrentL3, getCurrentL3Channel, getReactivePowerL1, getReactivePowerL1Channel, getReactivePowerL2, getReactivePowerL2Channel, getReactivePowerL3, getReactivePowerL3Channel, getVoltageL1, getVoltageL1Channel, getVoltageL2, getVoltageL2Channel, getVoltageL3, getVoltageL3Channel
-
Methods inherited from interface io.openems.edge.pvinverter.api.ManagedSymmetricPvInverter
_setActivePowerLimit, _setActivePowerLimit, _setMaxApparentPower, _setMaxApparentPower, getActivePowerLimit, getActivePowerLimitChannel, getMaxApparentPower, getMaxApparentPowerChannel, setActivePowerLimit, setActivePowerLimit
-
Methods inherited from interface io.openems.edge.bridge.modbus.api.ModbusComponent
_setModbusCommunicationFailed, getModbusCommunicationFailed, getModbusCommunicationFailedChannel
-
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
Methods inherited from interface io.openems.edge.meter.api.SymmetricMeter
_setActiveConsumptionEnergy, _setActiveConsumptionEnergy, _setActivePower, _setActivePower, _setActiveProductionEnergy, _setActiveProductionEnergy, _setCurrent, _setCurrent, _setFrequency, _setFrequency, _setMaxActivePower, _setMaxActivePower, _setMinActivePower, _setMinActivePower, _setReactivePower, _setReactivePower, _setVoltage, _setVoltage, getActiveConsumptionEnergy, getActiveConsumptionEnergyChannel, getActivePower, getActivePowerChannel, getActiveProductionEnergy, getActiveProductionEnergyChannel, getCurrent, getCurrentChannel, getFrequency, getFrequencyChannel, getMaxActivePower, getMaxActivePowerChannel, getMinActivePower, getMinActivePowerChannel, getReactivePower, getReactivePowerChannel, getVoltage, getVoltageChannel
-
-
-
-
Constructor Detail
-
AbstractSunSpecPvInverter
public AbstractSunSpecPvInverter(java.util.Map<SunSpecModel,Priority> activeModels, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds) throws OpenemsException
- Throws:
OpenemsException
-
-
Method Detail
-
activate
protected boolean activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String modbusReference, java.lang.String modbusId, int readFromCommonBlockNo, Phase phase) throws OpenemsException
Make sure to call this method from the inheriting OSGi Component.- Parameters:
context
- ComponentContext of this component. Receive it from parameter for @Activateid
- ID of this component. Typically 'config.id()'alias
- Human-readable name of this Component. Typically 'config.alias()'. Defaults to 'id' if emptyenabled
- Whether the component should be enabled. Typically 'config.enabled()'unitId
- Unit-ID of the Modbus targetcm
- An instance of ConfigurationAdmin. Receive it using @ReferencemodbusReference
- The name of the @Reference setter method for the Modbus bridge - e.g. 'Modbus' if you have a setModbus()-methodmodbusId
- The ID of the Modbus bridge. Typically 'config.modbus_id()'readFromCommonBlockNo
- the starting block numberphase
- the phase the inverter is connected- Returns:
- true if the target filter was updated. You may use it to abort the activate() method.
- Throws:
OpenemsException
- on error
-
activate
protected boolean activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String modbusReference, java.lang.String modbusId, int readFromCommonBlockNo) throws OpenemsException
- Overrides:
activate
in classAbstractOpenemsSunSpecComponent
- Throws:
OpenemsException
-
deactivate
protected void deactivate()
Make sure to call this method from the inheriting OSGi Component.- Overrides:
deactivate
in classAbstractOpenemsModbusComponent
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event)
Make sure to call this method from the inheriting OSGi Component.Requires:
property = { // EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_EXECUTE_WRITE // }
- Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
getMeterType
public MeterType getMeterType()
Description copied from interface:ManagedSymmetricPvInverter
Gets the type of this Meter.- Specified by:
getMeterType
in interfaceManagedSymmetricPvInverter
- Specified by:
getMeterType
in interfaceSymmetricMeter
- Returns:
- the MeterType
-
debugLog
public java.lang.String debugLog()
Description copied from interface:OpenemsComponent
Gets some output that is suitable for a continuous Debug log. Returns 'null' by default which causes no output.- Specified by:
debugLog
in interfaceOpenemsComponent
- Returns:
- the debug log output
-
onSunSpecInitializationCompleted
protected void onSunSpecInitializationCompleted()
Description copied from class:AbstractOpenemsSunSpecComponent
This method is called after the SunSpec initialization was completed.The purpose of this method is to add mappings between SunSpec Channel-Points to OpenEMS Nature Channels.
- Specified by:
onSunSpecInitializationCompleted
in classAbstractOpenemsSunSpecComponent
-
addBlock
protected void addBlock(int startAddress, SunSpecModel model, Priority priority) throws OpenemsException
Description copied from class:AbstractOpenemsSunSpecComponent
Adds the block starting from startAddress.- Overrides:
addBlock
in classAbstractOpenemsSunSpecComponent
- Parameters:
startAddress
- the address to start reading frommodel
- the SunSpecModelpriority
- the reading priority- Throws:
OpenemsException
- on error
-
isSinglePhase
protected final boolean isSinglePhase()
-
getSunSpecChannel
protected <T extends Channel<?>> java.util.Optional<T> getSunSpecChannel(SunSpecPoint point)
Description copied from class:AbstractOpenemsSunSpecComponent
Get the Channel for the given Point.- Overrides:
getSunSpecChannel
in classAbstractOpenemsSunSpecComponent
- Type Parameters:
T
- the Channel type- Parameters:
point
- the SunSpec Point- Returns:
- the optional Channel
-
getSunSpecChannelOrError
protected <T extends Channel<?>> T getSunSpecChannelOrError(SunSpecPoint point) throws OpenemsException
Description copied from class:AbstractOpenemsSunSpecComponent
Get the Channel for the given Point or throw an error if it is not available.- Overrides:
getSunSpecChannelOrError
in classAbstractOpenemsSunSpecComponent
- Type Parameters:
T
- the Channel type- Parameters:
point
- the SunSpec Point- Returns:
- the optional Channel
- Throws:
OpenemsException
- if Channel is not available
-
-