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()
      Description copied from class: AbstractOpenemsModbusComponent
      Defines the Modbus protocol.
      Specified by:
      defineModbusProtocol in class AbstractOpenemsModbusComponent
      Returns:
      the ModbusProtocol
    • 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)
    • 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()
    • postprocessPBattery1

      protected static Integer postprocessPBattery1(Integer pBattery, Integer dcVoltage, Integer maxDcCurrent, Consumer<Boolean> setState, Optional<Integer> prevPBattery)
      Postprocess PBattery1 value.

      Impossible battery power values will be ignored.

      The total max DC current including a buffer of 10A is used to identify an impossible power value, as WBMS_VOLTAGE has lower priority than pBattery and the battery could charge even if the BmsChargeMaxCurrent is 0.

      Parameters:
      pBattery - battery power
      dcVoltage - dc voltage
      maxDcCurrent - max dc current
      setState - consume state
      prevPBattery - previous battery power
      Returns:
      possible battery power
    • 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