Class 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
  • Field Details

  • Constructor Details

  • Method Details

    • defineModbusProtocol

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

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

      protected static GoodWeType getGoodWeTypeFromStringValue(String stringValue)
      Get GoodWe type from the GoodWe string representation.
      Parameters:
      stringValue - GoodWe type as String
      Returns:
      type as GoodWeType
    • getGoodWeTypeFromSerialNr

      protected static GoodWeType getGoodWeTypeFromSerialNr(String serialNr)
      Get GoodWe type from serial number.
      Parameters:
      serialNr - Serial number
      Returns:
      type as
      invalid reference
      GoodWeHardwareType
    • getSocModbusElement

      protected ModbusElement getSocModbusElement(int address) throws NotImplementedException
      Throws:
      NotImplementedException
    • addCharger

      public final void addCharger(GoodWeCharger charger)
      Description copied from interface: GoodWe
      Registers a GoodWe Charger.
      Specified by:
      addCharger in interface GoodWe
      Parameters:
      charger - GoodWeCharger charger
    • removeCharger

      public final void removeCharger(GoodWeCharger charger)
      Description copied from interface: GoodWe
      Unregisters a GoodWe Charger.
      Specified by:
      removeCharger in interface GoodWe
      Parameters:
      charger - GoodWeCharger charger
    • calculatePvProduction

      protected final Integer 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

      protected static Map<GoodWe.ChannelId,Boolean> detectDiagStatesH(Long value)
      Detect the current diagnostic high states.
      Parameters:
      value - register value
      Returns:
      DiagnosticStates with the information if it is active or not
    • getSurplusPower

      public abstract Integer getSurplusPower()
      Gets Surplus Power.
      Returns:
      Integer