Package io.openems.edge.goodwe.common
Class AbstractGoodWe
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
io.openems.edge.goodwe.common.AbstractGoodWe
- All Implemented Interfaces:
ModbusComponent
,OpenemsComponent
,GoodWe
,TimedataProvider
,org.osgi.service.event.EventHandler
- Direct Known Subclasses:
GoodWeBatteryInverterImpl
,GoodWeEssImpl
public abstract class AbstractGoodWe
extends AbstractOpenemsModbusComponent
implements GoodWe, OpenemsComponent, TimedataProvider, 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<ELEMENT extends ModbusElement>
Nested classes/interfaces inherited from interface io.openems.edge.goodwe.common.GoodWe
GoodWe.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
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractGoodWe
(ChannelId activePowerChannelId, ChannelId reactivePowerChannelId, ChannelId dcDischargePowerChannelId, ChannelId activeChargeEnergyChannelId, ChannelId activeDischargeEnergyChannelId, ChannelId dcChargeEnergyChannelId, ChannelId dcDischargeEnergyChannelId, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addCharger
(GoodWeCharger charger) Registers a GoodWe Charger.protected void
calculateMaxAcPower
(int maxApparentPower) Calculate and store Max-AC-Export and -Import channels.protected final Integer
Gets the PV production from chargers ACTUAL_POWER.protected final ModbusProtocol
Defines the Modbus protocol.protected static Map
<GoodWe.ChannelId, Boolean> detectDiagStatesH
(Long value) Detect the current diagnostic high states.protected static GoodWeType
getGoodWeTypeFromSerialNr
(String serialNr) Get GoodWe type from serial number.protected static GoodWeType
getGoodWeTypeFromStringValue
(String stringValue) Get GoodWe type from the GoodWe string representation.protected ModbusElement
getSocModbusElement
(int address) abstract Integer
Gets Surplus Power.void
handleEvent
(org.osgi.service.event.Event event) final void
removeCharger
(GoodWeCharger charger) Unregisters a GoodWe Charger.protected void
Methods inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
activate, activate, activate, deactivate, getBridgeModbus, getModbusProtocol, getUnitId, m, m, m, m, m, m, modified, modified, retryModbusCommunication, 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.goodwe.common.GoodWe
_setBmsChargeMaxCurrent, _setBmsChargeMaxVoltage, _setBmsDischargeMaxCurrent, _setBmsDischargeMinVoltage, _setGoodweType, _setImpossibleFeneconHomeCombination, _setMaxAcExport, _setMaxAcImport, getBatteryProtocolArm, getBatteryProtocolArmChannel, getBmsChargeMaxCurrent, getBmsChargeMaxCurrentChannel, getBmsChargeMaxVoltage, getBmsChargeMaxVoltageChannel, getBmsDischargeMaxCurrent, getBmsDischargeMaxCurrentChannel, getBmsDischargeMinVoltage, getBmsDischargeMinVoltageChannel, getGoodweType, getGoodweTypeChannel, getImpossibleFeneconHomeCombinationChannel, getMaxAcExport, getMaxAcExportChannel, getMaxAcImport, getMaxAcImportChannel, getSocStartToForceCharge, getSocStartToForceChargeChannel, getSocStopToForceCharge, getSocStopToForceChargeChannel, getWbmsChargeMaxCurrent, getWbmsChargeMaxCurrentChannel, getWbmsDischargeMaxCurrent, getWbmsDischargeMaxCurrentChannel, getWbmsVoltage, getWbmsVoltageChannel, setBmsChargeMaxCurrent, setBmsChargeMaxVoltage, setBmsDischargeMaxCurrent, setBmsDischargeMinVoltage
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, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
Methods inherited from interface io.openems.edge.timedata.api.TimedataProvider
getTimedata
-
Field Details
-
chargers
-
-
Constructor Details
-
AbstractGoodWe
protected AbstractGoodWe(ChannelId activePowerChannelId, ChannelId reactivePowerChannelId, ChannelId dcDischargePowerChannelId, ChannelId activeChargeEnergyChannelId, ChannelId activeDischargeEnergyChannelId, ChannelId dcChargeEnergyChannelId, ChannelId dcDischargeEnergyChannelId, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds) throws OpenemsError.OpenemsNamedException
-
-
Method Details
-
defineModbusProtocol
Description copied from class:AbstractOpenemsModbusComponent
Defines the Modbus protocol.- Specified by:
defineModbusProtocol
in classAbstractOpenemsModbusComponent
- Returns:
- the ModbusProtocol
- Throws:
OpenemsException
- on error
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
getGoodWeTypeFromStringValue
Get GoodWe type from the GoodWe string representation.- Parameters:
stringValue
- GoodWe type as String- Returns:
- type as
GoodWeType
-
getGoodWeTypeFromSerialNr
Get GoodWe type from serial number.- Parameters:
serialNr
- Serial number- Returns:
- type as
invalid reference
GoodWeHardwareType
-
getSocModbusElement
- Throws:
NotImplementedException
-
addCharger
Description copied from interface:GoodWe
Registers a GoodWe Charger.- Specified by:
addCharger
in interfaceGoodWe
- Parameters:
charger
-GoodWeCharger
charger
-
removeCharger
Description copied from interface:GoodWe
Unregisters a GoodWe Charger.- Specified by:
removeCharger
in interfaceGoodWe
- Parameters:
charger
-GoodWeCharger
charger
-
calculatePvProduction
Gets the PV production from chargers ACTUAL_POWER. Returns null if the PV production is not available.- Returns:
- production power
-
updatePowerAndEnergyChannels
protected void updatePowerAndEnergyChannels() -
calculateMaxAcPower
protected void calculateMaxAcPower(int maxApparentPower) Calculate and store Max-AC-Export and -Import channels.- Parameters:
maxApparentPower
- the max apparent power
-
detectDiagStatesH
Detect the current diagnostic high states.- Parameters:
value
- register value- Returns:
- DiagnosticStates with the information if it is active or not
-
getSurplusPower
Gets Surplus Power.- Returns:
Integer
-