Class AbstractSunSpecPvInverter

All Implemented Interfaces:
ModbusComponent, OpenemsComponent, ElectricityMeter, ManagedSymmetricPvInverter, SunSpecPvInverter, org.osgi.service.event.EventHandler
Direct Known Subclasses:
PvInverterFroniusImpl, PvInverterKacoBlueplanetImpl, PvInverterKostalImpl, PvInverterSmaSunnyTripowerImpl, SolarEdgePvInverterImpl

public abstract class AbstractSunSpecPvInverter extends AbstractOpenemsSunSpecComponent implements SunSpecPvInverter, ManagedSymmetricPvInverter, ElectricityMeter, OpenemsComponent, org.osgi.service.event.EventHandler
  • Constructor Details

  • Method Details

    • activate

      protected boolean activate(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, boolean readOnly, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, String modbusReference, String modbusId, int readFromCommonBlockNo, Phase phase) throws OpenemsException
      Make sure to call this method from the inheriting OSGi Component.
      Parameters:
      context - ComponentContext of this component. Receive it from parameter for @Activate
      id - ID of this component. Typically 'config.id()'
      alias - Human-readable name of this Component. Typically 'config.alias()'. Defaults to 'id' if empty
      enabled - Whether the component should be enabled. Typically 'config.enabled()'
      readOnly - In Read-Only mode no power-limitation commands are sent to the inverter
      unitId - Unit-ID of the Modbus target
      cm - An instance of ConfigurationAdmin. Receive it using @Reference
      modbusReference - The name of the @Reference setter method for the Modbus bridge - e.g. 'Modbus' if you have a setModbus()-method
      modbusId - The ID of the Modbus bridge. Typically 'config.modbus_id()'
      readFromCommonBlockNo - the starting block number
      phase - the phase the inverter is connected
      Returns:
      true if the target filter was updated. You may use it to abort the activate() method.
      Throws:
      OpenemsException - on error
    • activate

      protected boolean activate(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, String modbusReference, String modbusId, int readFromCommonBlockNo) throws OpenemsException
      Overrides:
      activate in class AbstractOpenemsSunSpecComponent
      Throws:
      OpenemsException
    • deactivate

      protected void deactivate()
      Make sure to call this method from the inheriting OSGi Component.
      Overrides:
      deactivate in class AbstractOpenemsModbusComponent
    • handleEvent

      public void handleEvent(org.osgi.service.event.Event event)
      Make sure to call this method from the inheriting OSGi Component.

      Requires:

      
       @EventTopics({ //
       	EdgeEventConstants.TOPIC_CYCLE_EXECUTE_WRITE, //
       })
       
      Specified by:
      handleEvent in interface org.osgi.service.event.EventHandler
    • getMeterType

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

      protected void onSunSpecInitializationCompleted()
      Description copied from class: AbstractOpenemsSunSpecComponent
      This method is called after the SunSpec initialization was completed.

      The purpose of this method is to add mappings between SunSpec Channel-Points to OpenEMS Nature Channels.

      Specified by:
      onSunSpecInitializationCompleted in class AbstractOpenemsSunSpecComponent
    • addBlock

      protected void addBlock(int startAddress, SunSpecModel model, Priority priority) throws OpenemsException
      Description copied from class: AbstractOpenemsSunSpecComponent
      Adds the block starting from startAddress.
      Overrides:
      addBlock in class AbstractOpenemsSunSpecComponent
      Parameters:
      startAddress - the address to start reading from
      model - the SunSpecModel
      priority - the reading priority
      Throws:
      OpenemsException - on error
    • getSunSpecChannel

      protected <T extends Channel<?>> Optional<T> getSunSpecChannel(SunSpecPoint point)
      Description copied from class: AbstractOpenemsSunSpecComponent
      Get the Channel for the given Point.
      Overrides:
      getSunSpecChannel in class AbstractOpenemsSunSpecComponent
      Type Parameters:
      T - the Channel type
      Parameters:
      point - the SunSpec Point
      Returns:
      the optional Channel
    • getSunSpecChannelOrError

      protected <T extends Channel<?>> T getSunSpecChannelOrError(SunSpecPoint point) throws OpenemsException
      Description copied from class: AbstractOpenemsSunSpecComponent
      Get the Channel for the given Point or throw an error if it is not available.
      Overrides:
      getSunSpecChannelOrError in class AbstractOpenemsSunSpecComponent
      Type Parameters:
      T - the Channel type
      Parameters:
      point - the SunSpec Point
      Returns:
      the optional Channel
      Throws:
      OpenemsException - if Channel is not available