Class GoodWeGridMeterImpl

All Implemented Interfaces:
ModbusComponent, OpenemsComponent, ModbusSlave, GoodWeGridMeter, ElectricityMeter, TimedataProvider, org.osgi.service.event.EventHandler

public class GoodWeGridMeterImpl extends AbstractOpenemsModbusComponent implements GoodWeGridMeter, ElectricityMeter, ModbusComponent, OpenemsComponent, TimedataProvider, org.osgi.service.event.EventHandler, ModbusSlave
  • Constructor Details

    • GoodWeGridMeterImpl

      public GoodWeGridMeterImpl()
  • Method Details

    • setModbus

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

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

      protected 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
    • setExternalMeterValue

      protected void setExternalMeterValue()
      Set channel for external meter if configured.
    • calculateRatio

      protected static Integer calculateRatio(int valueA, int valueB)
      Calculate a ratio value.

      Ignore impossible values.

      Parameters:
      valueA - value A e.g. 3000A
      valueB - value B e.g. 5A
      Returns:
      ratio value e.g. 600
    • convertMeterConnectStatus

      protected void convertMeterConnectStatus(Integer value)
    • getPhaseConnectionValue

      protected static Integer getPhaseConnectionValue(Phase phase, int value)
      Get the connection value depending on the phase.

      The information of each phase connection is part of a hex. The part of the given phase will be returned.

      For example: 0x0124 means Phase R connect incorrectly´╝îPhase S connect reverse, Phase T connect correctly

      Parameters:
      phase - Phase
      value - Original value with all phase information
      Returns:
      connection information of the given phase
    • getMeterType

      public MeterType getMeterType()
      Description copied from interface: ElectricityMeter
      Gets the type of this Meter.
      Specified by:
      getMeterType in interface ElectricityMeter
      Returns:
      the MeterType
    • 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
      Returns:
      the debug log output
    • getTimedata

      public Timedata getTimedata()
      Description copied from interface: TimedataProvider
      Gets the Timedata service.
      Specified by:
      getTimedata in interface TimedataProvider
      Returns:
      the service or null if it is not (yet) available.
    • 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
      Parameters:
      accessMode - filters the Modbus-Records that should be shown
      Returns:
      the Modbus-Slave-Table