public class InfluxTimedataImpl extends AbstractOpenemsComponent implements InfluxTimedata, Timedata, OpenemsComponent, org.osgi.service.event.EventHandler
InfluxTimedata.ChannelId
Modifier and Type | Field and Description |
---|---|
protected ComponentManager |
componentManager |
Constructor and Description |
---|
InfluxTimedataImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
collectAndWriteChannelValues() |
protected void |
deactivate()
Handles @Deactivate of implementations.
|
java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.Object>> |
getLatestValue(ChannelAddress channelAddress)
Gets the latest known value for the given
ChannelAddress . |
void |
handleEvent(org.osgi.service.event.Event event) |
java.util.SortedMap<java.time.ZonedDateTime,java.util.SortedMap<ChannelAddress,com.google.gson.JsonElement>> |
queryHistoricData(java.lang.String edgeId,
java.time.ZonedDateTime fromDate,
java.time.ZonedDateTime toDate,
java.util.Set<ChannelAddress> channels,
int resolution)
Queries historic data.
|
java.util.SortedMap<ChannelAddress,com.google.gson.JsonElement> |
queryHistoricEnergy(java.lang.String edgeId,
java.time.ZonedDateTime fromDate,
java.time.ZonedDateTime toDate,
java.util.Set<ChannelAddress> channels)
Queries historic energy.
|
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)
Queries historic energy per period.
|
_channel, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calculateResolution, handleQueryHistoricTimeseriesExportXlxsRequest, queryHistoricData
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getModbusSlaveNatureTable, getState, getStateChannel, hasFaults, id, isEnabled, logDebug, logError, logInfo, logWarn, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
protected ComponentManager componentManager
protected void deactivate()
AbstractOpenemsComponent
deactivate
in class AbstractOpenemsComponent
public void handleEvent(org.osgi.service.event.Event event)
handleEvent
in interface org.osgi.service.event.EventHandler
protected void collectAndWriteChannelValues()
public java.util.SortedMap<java.time.ZonedDateTime,java.util.SortedMap<ChannelAddress,com.google.gson.JsonElement>> queryHistoricData(java.lang.String edgeId, java.time.ZonedDateTime fromDate, java.time.ZonedDateTime toDate, java.util.Set<ChannelAddress> channels, int resolution) throws OpenemsError.OpenemsNamedException
CommonTimedataService
queryHistoricData
in interface CommonTimedataService
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- the Resolution in secondsOpenemsError.OpenemsNamedException
public java.util.SortedMap<ChannelAddress,com.google.gson.JsonElement> queryHistoricEnergy(java.lang.String edgeId, java.time.ZonedDateTime fromDate, java.time.ZonedDateTime toDate, java.util.Set<ChannelAddress> channels) throws OpenemsError.OpenemsNamedException
CommonTimedataService
queryHistoricEnergy
in interface CommonTimedataService
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the ChannelsOpenemsError.OpenemsNamedException
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
CommonTimedataService
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.
queryHistoricEnergyPerPeriod
in interface CommonTimedataService
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- the Resolution in secondsOpenemsError.OpenemsNamedException
public java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.Object>> getLatestValue(ChannelAddress channelAddress)
Timedata
ChannelAddress
.getLatestValue
in interface Timedata
channelAddress
- the ChannelAddress to be queried