Class TimedataDummy

    • Constructor Detail

      • TimedataDummy

        public TimedataDummy()
    • Method Detail

      • getChannelValue

        public java.util.Optional<com.google.gson.JsonElement> getChannelValue​(java.lang.String edgeId,
                                                                               ChannelAddress channelAddress)
        Description copied from interface: Timedata
        Gets the latest value for the given ChannelAddress.
        Specified by:
        getChannelValue in interface Timedata
        Parameters:
        edgeId - The unique Edge-ID
        channelAddress - The Channel-Address
        Returns:
      • write

        public void write​(java.lang.String edgeId,
                          com.google.common.collect.TreeBasedTable<java.lang.Long,​ChannelAddress,​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
      • 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,
                                                                                                                                                                     int 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 length '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 in seconds
        Throws:
        OpenemsError.OpenemsNamedException