Class AggregatedInflux
java.lang.Object
io.openems.backend.common.component.AbstractOpenemsBackendComponent
io.openems.backend.timedata.aggregatedinflux.AggregatedInflux
- All Implemented Interfaces:
DebugLoggable
,BackendTimedata
,Timedata
,CommonTimedataService
,org.osgi.service.event.EventHandler
public class AggregatedInflux
extends AbstractOpenemsBackendComponent
implements Timedata, DebugLoggable, org.osgi.service.event.EventHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondebugLog()
Gets some output that is suitable for a continuous Debug log.Gets some output that is suitable for a debug metrics to write down asTimedata
.void
handleEvent
(org.osgi.service.event.Event event) id()
Returns a unique ID for this OpenEMS component.SortedMap
<ChannelAddress, com.google.gson.JsonElement> queryFirstValueBefore
(String edgeId, ZonedDateTime date, Set<ChannelAddress> channels) Queries the latest values which are before the givenZonedDateTime
.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.void
write
(String edgeId, AggregatedDataNotification notification) Sends the data points to the Timedata service.void
write
(String edgeId, ResendDataNotification notification) Sends the data points to the Timedata service.void
write
(String edgeId, TimestampedDataNotification notification) Sends the data points to the Timedata service.Methods inherited from class io.openems.backend.common.component.AbstractOpenemsBackendComponent
getName, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarn, logWarn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.common.timedata.CommonTimedataService
handleQueryHistoricTimeseriesExportXlxsRequest, queryHistoricData
-
Constructor Details
-
AggregatedInflux
public AggregatedInflux()
-
-
Method Details
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
queryHistoricData
public SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricDatacom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException Description copied from interface:CommonTimedataService
Queries historic data.- Specified by:
queryHistoricData
in interfaceCommonTimedataService
- 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
public SortedMap<ChannelAddress,com.google.gson.JsonElement> queryHistoricEnergy(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) throws OpenemsError.OpenemsNamedException Description copied from interface:CommonTimedataService
Queries historic energy.- Specified by:
queryHistoricEnergy
in interfaceCommonTimedataService
- 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
public SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricEnergyPerPeriodcom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, 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 interfaceCommonTimedataService
- 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
-
queryFirstValueBefore
public SortedMap<ChannelAddress,com.google.gson.JsonElement> queryFirstValueBefore(String edgeId, ZonedDateTime date, Set<ChannelAddress> channels) throws OpenemsError.OpenemsNamedException Description copied from interface:BackendTimedata
Queries the latest values which are before the givenZonedDateTime
.- Specified by:
queryFirstValueBefore
in interfaceBackendTimedata
- Parameters:
edgeId
- the id of the edgedate
- the bounding date exclusivechannels
- the channels- Returns:
- the channel values
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
id
Description copied from interface:Timedata
Returns a unique ID for this OpenEMS component. -
write
Description copied from interface:BackendTimedata
Sends the data points to the Timedata service.- Specified by:
write
in interfaceBackendTimedata
- Parameters:
edgeId
- The unique Edge-IDnotification
- Table of timestamp (epoch in milliseconds), Channel-Address and the Channel value as AggregatedData. Sorted by timestamp.
-
write
Description copied from interface:BackendTimedata
Sends the data points to the Timedata service.- Specified by:
write
in interfaceBackendTimedata
- Parameters:
edgeId
- The unique Edge-IDnotification
- Table of timestamp (epoch in milliseconds), Channel-Address and the Channel value as ResendData. Sorted by timestamp.
-
write
Description copied from interface:BackendTimedata
Sends the data points to the Timedata service.- Specified by:
write
in interfaceBackendTimedata
- Parameters:
edgeId
- The unique Edge-IDnotification
- Table of timestamp (epoch in milliseconds), Channel-Address and the Channel value as JsonElement. Sorted by timestamp.
-
debugLog
Description copied from interface:DebugLoggable
Gets some output that is suitable for a continuous Debug log.- Specified by:
debugLog
in interfaceDebugLoggable
- Returns:
- the debug log output; null for no log
-
debugMetrics
Description copied from interface:DebugLoggable
Gets some output that is suitable for a debug metrics to write down asTimedata
.- Specified by:
debugMetrics
in interfaceDebugLoggable
- Returns:
- the key value entries to write down; null or emptyMap for no metrics
-