Class InfluxImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Metadata metadata  
    • Constructor Summary

      Constructors 
      Constructor Description
      InfluxImpl()  
    • Field Detail

      • metadata

        protected volatile Metadata metadata
    • Constructor Detail

      • InfluxImpl

        public InfluxImpl()
    • Method Detail

      • write

        public void write​(java.lang.String edgeId,
                          com.google.common.collect.TreeBasedTable<java.lang.Long,​java.lang.String,​com.google.gson.JsonElement> data)
                   throws OpenemsException
        Description copied from interface: Timedata
        Sends the data points to the Timedata service.
        Specified by:
        write in interface Timedata
        Parameters:
        edgeId - The unique Edge-ID
        data - Table of timestamp (epoch in milliseconds), Channel-Address and the Channel value as JsonElement. Sorted by timestamp.
        Throws:
        OpenemsException - on error
      • parseNumberFromName

        public static java.lang.Integer parseNumberFromName​(java.lang.String name)
                                                     throws OpenemsException
        Parses the number of an Edge from its name string.

        e.g. translates "edge0" to "0".

        Parameters:
        name - the edge name
        Returns:
        the number
        Throws:
        OpenemsException - on error
      • queryHistoricEnergyPerPeriod

        public java.util.SortedMap<java.time.ZonedDateTime,​java.util.SortedMap<ChannelAddress,​com.google.gson.JsonElement>> queryHistoricEnergyPerPeriod​(java.lang.String edgeId,
                                                                                                                                                                     java.time.ZonedDateTime fromDate,
                                                                                                                                                                     java.time.ZonedDateTime toDate,
                                                                                                                                                                     java.util.Set<ChannelAddress> channels,
                                                                                                                                                                     Resolution resolution)
                                                                                                                                                              throws OpenemsError.OpenemsNamedException
        Description copied from interface: CommonTimedataService
        Queries historic energy per period.

        This is for use-cases where you want to get the energy for each period (with Resolution) per Channel, e.g. to visualize energy in a histogram chart. For each period the energy is calculated by subtracting first value of the period from the last value of the period.

        Specified by:
        queryHistoricEnergyPerPeriod in interface CommonTimedataService
        Parameters:
        edgeId - the Edge-ID; or null query all
        fromDate - the From-Date
        toDate - the To-Date
        channels - the Channels
        resolution - the Resolution
        Returns:
        the query result
        Throws:
        OpenemsError.OpenemsNamedException
      • logInfo

        protected void logInfo​(org.slf4j.Logger log,
                               java.lang.String message)
        Description copied from class: AbstractOpenemsBackendComponent
        Log an info message including the Component ID.
        Overrides:
        logInfo in class AbstractOpenemsBackendComponent
        Parameters:
        log - the Logger that is used for writing the log
        message - the Info-message
      • logWarn

        protected void logWarn​(org.slf4j.Logger log,
                               java.lang.String message)
        Description copied from class: AbstractOpenemsBackendComponent
        Log a warn message including the Component ID.
        Overrides:
        logWarn in class AbstractOpenemsBackendComponent
        Parameters:
        log - the Logger that is used for writing the log
        message - the Warn-message
      • id

        public java.lang.String id()
        Description copied from interface: Timedata
        Returns a unique ID for this OpenEMS component.
        Specified by:
        id in interface Timedata
        Returns:
        the unique ID