Class DummyTimedata

    • Constructor Detail

      • DummyTimedata

        public DummyTimedata​(java.lang.String id)
    • Method Detail

      • add

        public void add​(java.time.ZonedDateTime timestamp,
                        ChannelAddress channelAddress,
                        java.lang.Integer value)
        Adds a value to the Dummy Timedata.
        Parameters:
        timestamp - the ZonedDateTime
        channelAddress - the ChannelAddress
        value - the value as Integer
      • add

        public void add​(java.time.ZonedDateTime timestamp,
                        ChannelAddress channelAddress,
                        com.google.gson.JsonElement value)
        Adds a value to the Dummy Timedata.
        Parameters:
        timestamp - the ZonedDateTime
        channelAddress - the ChannelAddress
        value - the value as JsonElement
      • 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
      • getLatestValue

        public java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.Object>> getLatestValue​(ChannelAddress channelAddress)
        Description copied from interface: Timedata
        Gets the latest known value for the given ChannelAddress.
        Specified by:
        getLatestValue in interface Timedata
        Parameters:
        channelAddress - the ChannelAddress to be queried
        Returns:
        the latest known value or Empty