Class BatteryFeneconHomeImpl
- All Implemented Interfaces:
Battery
,BatteryFeneconHome
,ModbusComponent
,OpenemsComponent
,ModbusSlave
,StartStoppable
,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.battery.api.Battery
Battery.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.battery.fenecon.home.BatteryFeneconHome
BatteryFeneconHome.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.common.startstop.StartStoppable
StartStoppable.ChannelId
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
buildSerialNumber
(String prefix, Integer value) Build the serial number with prefix.protected void
Handles @Deactivate of implementations.debugLog()
Gets some output that is suitable for a continuous Debug log.protected ModbusProtocol
Defines the Modbus protocol.static String
generateCellVoltageChannelName
(int tower, int module, int cell) Generates Channel names for Cell Voltage Channel-IDs.static String
generateTempBalancingChannelName
(int tower, int module, int value) Generates Channel names for Temperature Balancing Channel-IDs.static String
generateTempSensorChannelName
(int tower, int module, int sensor) Generates Channel names for Temperature Sensor Channel-IDs.getModbusSlaveTable
(AccessMode accessMode) Gets the Modbus-Slave-Table for this OpenEMS-Component.Gets the target Start/Stop mode from config or StartStop-Channel.void
handleEvent
(org.osgi.service.event.Event event) parseHardwareTypeFromRegisterValue
(int value) Get GoodWe hardware version from register value.protected void
setModbus
(BridgeModbus modbus) Set the Modbus bridge.void
setStartStop
(StartStop value) Starts or stops the device or service represented by this OpenEMS Component.protected void
Update Number of towers and modules; called on onChange event.Methods inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
activate, activate, activate, getBridgeModbus, getModbusProtocol, getUnitId, m, m, m, m, m, m, modified, modified, retryModbusCommunication, 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.battery.api.Battery
_setCapacity, _setCapacity, _setChargeMaxCurrent, _setChargeMaxCurrent, _setChargeMaxVoltage, _setChargeMaxVoltage, _setCurrent, _setCurrent, _setDischargeMaxCurrent, _setDischargeMaxCurrent, _setDischargeMinVoltage, _setDischargeMinVoltage, _setMaxCellTemperature, _setMaxCellTemperature, _setMaxCellVoltage, _setMaxCellVoltage, _setMinCellTemperature, _setMinCellTemperature, _setMinCellVoltage, _setMinCellVoltage, _setSoc, _setSoc, _setSoh, _setSoh, _setVoltage, _setVoltage, getCapacity, getCapacityChannel, getChargeMaxCurrent, getChargeMaxCurrentChannel, getChargeMaxVoltage, getChargeMaxVoltageChannel, getCurrent, getCurrentChannel, getDischargeMaxCurrent, getDischargeMaxCurrentChannel, getDischargeMinVoltage, getDischargeMinVoltageChannel, getMaxCellTemperature, getMaxCellTemperatureChannel, getMaxCellVoltage, getMaxCellVoltageChannel, getMinCellTemperature, getMinCellTemperatureChannel, getMinCellVoltage, getMinCellVoltageChannel, getSoc, getSocChannel, getSoh, getSohChannel, getVoltage, getVoltageChannel
Methods inherited from interface io.openems.edge.battery.fenecon.home.BatteryFeneconHome
getBatteryHardwareType, getBatteryHardwareTypeChannel, getBmsControl, getBmsControlChannel, getNumberOfModulesPerTower, getNumberOfModulesPerTowerChannel
Methods inherited from interface io.openems.edge.bridge.modbus.api.ModbusComponent
_setModbusCommunicationFailed, getModbusCommunicationFailed, getModbusCommunicationFailedChannel, retryModbusCommunication
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.common.startstop.StartStoppable
_setStartStop, getStartStop, getStartStopChannel, isStarted, isStopped, start, stop
-
Field Details
-
stateMachine
-
-
Constructor Details
-
BatteryFeneconHomeImpl
public BatteryFeneconHomeImpl()
-
-
Method Details
-
setModbus
Description copied from class:AbstractOpenemsModbusComponent
Set the Modbus bridge. Should be called by @Reference- Overrides:
setModbus
in classAbstractOpenemsModbusComponent
- Parameters:
modbus
- the BridgeModbus Reference
-
deactivate
protected void deactivate()Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsModbusComponent
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
defineModbusProtocol
Description copied from class:AbstractOpenemsModbusComponent
Defines the Modbus protocol.- Specified by:
defineModbusProtocol
in classAbstractOpenemsModbusComponent
- Returns:
- the ModbusProtocol
- Throws:
OpenemsException
- on error
-
parseHardwareTypeFromRegisterValue
Get GoodWe hardware version from register value.- Parameters:
value
- Register value not formated with SCALE_FACTOR_MINUS_1- Returns:
- type as
invalid reference
GoodweHardwareType
-
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
-
getModbusSlaveTable
Description copied from interface:ModbusSlave
Gets the Modbus-Slave-Table for this OpenEMS-Component.- Specified by:
getModbusSlaveTable
in interfaceModbusSlave
- Parameters:
accessMode
- filters the Modbus-Records that should be shown- Returns:
- the Modbus-Slave-Table
-
setStartStop
Description copied from interface:StartStoppable
Starts or stops the device or service represented by this OpenEMS Component.- Specified by:
setStartStop
in interfaceStartStoppable
- Parameters:
value
- targetStartStop
state
-
getStartStopTarget
Description copied from interface:BatteryFeneconHome
Gets the target Start/Stop mode from config or StartStop-Channel.- Specified by:
getStartStopTarget
in interfaceBatteryFeneconHome
- Returns:
StartStop
-
updateNumberOfTowersAndModules
protected void updateNumberOfTowersAndModules()Update Number of towers and modules; called on onChange event.Recalculate the number of towers and modules. Unfortunately the battery may report too small wrong values in the beginning, so we need to recalculate on every change.
As an alternative, these channels may also be introduced in a record, and the associated channel value could be read with the aid of
ChannelUtils.getValues(io.openems.edge.common.component.OpenemsComponent, java.lang.Class<T>)
. However, startup time is once again involved in this process. This indicates that the last callback will have been made before the record is set. Furthermore, there is no certainty that the "software version channel value change" will occur, making it unlikely for this to trigger a callback. -
buildSerialNumber
Build the serial number with prefix.- Parameters:
prefix
- the serial number prefixvalue
- the serial number- Returns:
- The serial number
-
generateCellVoltageChannelName
Generates Channel names for Cell Voltage Channel-IDs."%03d" creates string number with leading zeros
- Parameters:
tower
- number to usemodule
- number to usecell
- number to user- Returns:
- a Channel name e.g. "TOWER_1_MODULE_2_CELL_003_VOLTAGE"
-
generateTempSensorChannelName
Generates Channel names for Temperature Sensor Channel-IDs.- Parameters:
tower
- number to usemodule
- number to usesensor
- number to user- Returns:
- a Channel name e.g. "TOWER_1_MODULE_2_TEMPERATURE_SENSOR_2"
-
generateTempBalancingChannelName
Generates Channel names for Temperature Balancing Channel-IDs.- Parameters:
tower
- number to usemodule
- number to usevalue
- number to user- Returns:
- a Channel name e.g. "TOWER_1_MODULE_2_TEMPERATURE_BALANCING_1"
-