Package io.openems.common.timedata
Interface CommonTimedataService
- All Known Subinterfaces:
BackendTimedata
,SimulatorApp
,SimulatorTimedata
,Timedata
,Timedata
,TimedataInfluxDb
,TimedataManager
,TimedataRrd4j
- All Known Implementing Classes:
AggregatedInflux
,DummyTimedata
,SimulatorAppImpl
,SimulatorTimedataImpl
,TimedataDummy
,TimedataInfluxDb
,TimedataInfluxDbImpl
,TimedataManagerImpl
,TimedataRrd4jImpl
,TimedataTimescaleDb
public interface CommonTimedataService
-
Method Summary
Modifier and TypeMethodDescriptionstatic Resolution
calculateResolution
(ZonedDateTime fromDate, ZonedDateTime toDate) Calculates the timeResolution
for the period.handleQueryHistoricTimeseriesExportXlxsRequest
(String edgeId, QueryHistoricTimeseriesExportXlxsRequest request, Language language) Handles aQueryHistoricTimeseriesExportXlxsRequest
.default SortedMap
<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricData
(String edgeId, QueryHistoricTimeseriesDataRequest request) Queries historic data.SortedMap
<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricData
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) Queries historic data.SortedMap
<ChannelAddress, com.google.gson.JsonElement> queryHistoricEnergy
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) Queries historic energy.SortedMap
<ZonedDateTime, SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricEnergyPerPeriod
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) Queries historic energy per period.
-
Method Details
-
handleQueryHistoricTimeseriesExportXlxsRequest
default QueryHistoricTimeseriesExportXlsxResponse handleQueryHistoricTimeseriesExportXlxsRequest(String edgeId, QueryHistoricTimeseriesExportXlxsRequest request, Language language) throws OpenemsError.OpenemsNamedException Handles aQueryHistoricTimeseriesExportXlxsRequest
. Exports historic data to an Excel file.- Parameters:
edgeId
- the Edge-IDrequest
- theQueryHistoricTimeseriesExportXlxsRequest
requestlanguage
- theLanguage
- Returns:
- the
QueryHistoricTimeseriesExportXlsxResponse
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
calculateResolution
Calculates the timeResolution
for the period.- Parameters:
fromDate
- the From-DatetoDate
- the To-Date- Returns:
- the resolution
-
queryHistoricData
default SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricDatacom.google.gson.JsonElement>> (String edgeId, QueryHistoricTimeseriesDataRequest request) throws OpenemsError.OpenemsNamedException Queries historic data. The 'resolution' of the query is calculated dynamically according to the length of the period.- Parameters:
edgeId
- the Edge-IDrequest
- theQueryHistoricTimeseriesDataRequest
- Returns:
- the query result; possibly null
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricData
SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricDatacom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException Queries historic data.- Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- theResolution
- Returns:
- the query result; possibly null
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricEnergy
SortedMap<ChannelAddress,com.google.gson.JsonElement> queryHistoricEnergy(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) throws OpenemsError.OpenemsNamedException Queries historic energy.- Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channels- Returns:
- the query result; possibly null
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricEnergyPerPeriod
SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricEnergyPerPeriodcom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException 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.- Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- theResolution
- Returns:
- the query result; possibly null
- Throws:
OpenemsError.OpenemsNamedException
-