Class FeneconHomeBatteryImpl

All Implemented Interfaces:
Battery, FeneconHomeBattery, ModbusComponent, OpenemsComponent, ModbusSlave, StartStoppable, org.osgi.service.event.EventHandler

public class FeneconHomeBatteryImpl extends AbstractOpenemsModbusComponent implements ModbusComponent, OpenemsComponent, Battery, org.osgi.service.event.EventHandler, ModbusSlave, StartStoppable, FeneconHomeBattery
  • Field Details

    • cm

      protected cm
    • componentManager

      protected ComponentManager componentManager
  • Constructor Details

    • FeneconHomeBatteryImpl

      public FeneconHomeBatteryImpl()
  • Method Details

    • setModbus

      protected void setModbus(BridgeModbus modbus)
      Description copied from class: AbstractOpenemsModbusComponent
      Set the Modbus bridge. Should be called by @Reference
      setModbus in class AbstractOpenemsModbusComponent
      modbus - the BridgeModbus Reference
    • deactivate

      protected void deactivate()
      Description copied from class: AbstractOpenemsComponent
      Handles @Deactivate of implementations. Prints log output.
      deactivate in class AbstractOpenemsModbusComponent
    • handleEvent

      public void handleEvent(org.osgi.service.event.Event event)
      Specified by:
      handleEvent in interface org.osgi.service.event.EventHandler
    • defineModbusProtocol

      protected ModbusProtocol defineModbusProtocol() throws OpenemsException
      Description copied from class: AbstractOpenemsModbusComponent
      Defines the Modbus protocol.
      Specified by:
      defineModbusProtocol in class AbstractOpenemsModbusComponent
      the ModbusProtocol
      OpenemsException - on error
    • debugLog

      public 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 interface OpenemsComponent
      the debug log output
    • getModbusSlaveTable

      public ModbusSlaveTable getModbusSlaveTable(AccessMode accessMode)
      Description copied from interface: ModbusSlave
      Gets the Modbus-Slave-Table for this OpenEMS-Component.
      Specified by:
      getModbusSlaveTable in interface ModbusSlave
      accessMode - filters the Modbus-Records that should be shown
      the Modbus-Slave-Table
    • setStartStop

      public void setStartStop(StartStop value)
      Description copied from interface: StartStoppable
      Starts or stops the device or service represented by this OpenEMS Component.
      Specified by:
      setStartStop in interface StartStoppable
      value - target StartStop state
    • getStartStopTarget

      public StartStop getStartStopTarget()
      Description copied from interface: FeneconHomeBattery
      Gets the target Start/Stop mode from config or StartStop-Channel.
      Specified by:
      getStartStopTarget in interface FeneconHomeBattery
    • 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.

    • buildSerialNumber

      protected static String buildSerialNumber(String prefix, Integer value)
      Build the serial number with prefix.
      prefix - the serial number prefix
      value - the serial number
      The serial number