Class EvcsWebastoNextImpl

All Implemented Interfaces:
ModbusComponent, OpenemsComponent, Evcs, ManagedEvcs, EvcsWebastoNext, org.osgi.service.event.EventHandler

public class EvcsWebastoNextImpl extends AbstractOpenemsModbusComponent implements EvcsWebastoNext, Evcs, ManagedEvcs, ModbusComponent, OpenemsComponent, org.osgi.service.event.EventHandler
  • Constructor Details

    • EvcsWebastoNextImpl

      public EvcsWebastoNextImpl()
  • 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() throws OpenemsException
      Description copied from class: AbstractOpenemsModbusComponent
      Defines the Modbus protocol.
      Specified by:
      defineModbusProtocol in class AbstractOpenemsModbusComponent
      Returns:
      the ModbusProtocol
      Throws:
      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
      Returns:
      the debug log output
    • getEvcsPower

      public EvcsPower getEvcsPower()
      Description copied from interface: ManagedEvcs
      Get the EvcsPower.
      Specified by:
      getEvcsPower in interface ManagedEvcs
      Returns:
      the EvcsPower
    • getConfiguredMinimumHardwarePower

      public int getConfiguredMinimumHardwarePower()
      Description copied from interface: ManagedEvcs
      Minimum hardware limit in W given by the configuration.

      This value is taken as a fallback for the

      invalid reference
      ChannelId#FIXED_MINIMUM_HARDWARE_POWER
      channel. As the configuration property should be in mA for AC chargers, make sure that the value is converted to W. Example: Math.round(current / 1000f) * DEFAULT_VOLTAGE * Phases.THREE_PHASE.getValue();
      Specified by:
      getConfiguredMinimumHardwarePower in interface ManagedEvcs
      Returns:
      minimum hardware limit in W
    • getConfiguredMaximumHardwarePower

      public int getConfiguredMaximumHardwarePower()
      Description copied from interface: ManagedEvcs
      Maximum hardware limit in W given by the configuration.

      This value is taken as a fallback for the

      invalid reference
      ChannelId#FIXED_MAXIMUM_HARDWARE_POWER
      channel. As the configuration property should be in mA for AC chargers, make sure that the value is converted to W. Example: Math.round(current / 1000f) * DEFAULT_VOLTAGE * Phases.THREE_PHASE.getValue();
      Specified by:
      getConfiguredMaximumHardwarePower in interface ManagedEvcs
      Returns:
      maximum hardware limit in W
    • getConfiguredDebugMode

      public boolean getConfiguredDebugMode()
      Description copied from interface: ManagedEvcs
      Configuration if the debug mode is active or not.
      Specified by:
      getConfiguredDebugMode in interface ManagedEvcs
      Returns:
      boolean
    • applyChargePowerLimit

      public boolean applyChargePowerLimit(int power) throws Exception
      Description copied from interface: ManagedEvcs
      Command to send the given power, to the EVCS.

      Example:

       
        // Format the power to the required format and unit
       
              String raw = "currtime " + current + " 1";
       
              byte[] raw = s.getBytes();
              DatagramPacket packet = new DatagramPacket(raw, raw.length, ip, KebaKeContact.UDP_PORT);
              DatagramSocket datagrammSocket = null;
              try {
                      datagrammSocket = new DatagramSocket();
                      datagrammSocket.send(packet);
                      return true;
              } catch (SocketException e) {
                      this.logError(this.log, "Unable to open UDP socket for sending [" + s + "] to [" + ip.getHostAddress()
                                      + "]: " + e.getMessage());
              } catch (IOException e) {
                      this.logError(this.log,
                                      "Unable to send [" + s + "] UDP message to [" + ip.getHostAddress() + "]: " + e.getMessage());
              } finally {
                      if (datagrammSocket != null) {
                              datagrammSocket.close();
                      }
              }
              return false;
       
       
      Specified by:
      applyChargePowerLimit in interface ManagedEvcs
      Parameters:
      power - Power that should be send in watt
      Returns:
      boolean if the power was applied to the EVCS
      Throws:
      Exception
    • pauseChargeProcess

      public boolean pauseChargeProcess() throws Exception
      Description copied from interface: ManagedEvcs
      Command to pause a charge process of the EVCS.

      In most of the cases, it is sufficient to call the method

      invalid reference
      #applyChargePowerLimit(Integer)
      with 0 as power but sometimes it needs extra commands to initiate a pause of charging.
      Specified by:
      pauseChargeProcess in interface ManagedEvcs
      Returns:
      boolean if the command was applied to the EVCS
      Throws:
      Exception
    • applyDisplayText

      public boolean applyDisplayText(String text) throws OpenemsException
      Description copied from interface: ManagedEvcs
      Command to send the specified text to the EVCS display, if supported

      Writes to the display of the charging station, if the EVCS supports that feature - if not, return false.

      Specified by:
      applyDisplayText in interface ManagedEvcs
      Parameters:
      text - Text to display
      Returns:
      boolean if it was sent or not
      Throws:
      OpenemsException - on error
    • getMinimumTimeTillChargingLimitTaken

      public int getMinimumTimeTillChargingLimitTaken()
      Description copied from interface: ManagedEvcs
      Minimum time till a charging limit is taken by the EVCS in seconds.
      Specified by:
      getMinimumTimeTillChargingLimitTaken in interface ManagedEvcs
      Returns:
      time in seconds
    • getChargeStateHandler

      public ChargeStateHandler getChargeStateHandler()
      Description copied from interface: ManagedEvcs
      Get charge state handler.
      Specified by:
      getChargeStateHandler in interface ManagedEvcs
      Returns:
      charge state handler
    • logDebug

      public void logDebug(String message)
      Description copied from interface: ManagedEvcs
      Log debug using ManagedEvcs Logger.
      Specified by:
      logDebug in interface ManagedEvcs
      Parameters:
      message - message
    • handleEvent

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