Class QueryHistoricTimeseriesEnergyPerPeriodRequest
java.lang.Object
io.openems.common.jsonrpc.base.JsonrpcMessage
io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
io.openems.common.jsonrpc.base.JsonrpcRequest
io.openems.common.jsonrpc.request.QueryHistoricTimeseriesEnergyPerPeriodRequest
Represents a JSON-RPC Request for 'queryHistoricTimeseriesEnergyPerPeriod'.
This Request 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.
{
"jsonrpc": "2.0",
"id": "UUID",
"method": "queryHistoricTimeseriesEnergyPerPeriod",
"params": {
"fromDate": YYYY-MM-DD,
"toDate": YYYY-MM-DD,
"channels": ChannelAddress[],
"timezone": String,
"resolution": {
"value": Number,
"unit": ChronoUnit
}
}
-
Field Summary
Fields inherited from class io.openems.common.jsonrpc.base.JsonrpcRequest
DEFAULT_TIMEOUT_SECONDS, id, NO_TIMEOUT, timeoutOpt
Fields inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
JSONRPC_VERSION
-
Constructor Summary
ConstructorDescriptionQueryHistoricTimeseriesEnergyPerPeriodRequest
(ZonedDateTime fromDate, ZonedDateTime toDate, Resolution resolution) -
Method Summary
Modifier and TypeMethodDescriptionCreateQueryHistoricTimeseriesEnergyPerPeriodRequest
from a templateJsonrpcRequest
.Gets theChannelAddress
es.Gets the From-Date.com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.Gets the requested Resolution in [s].Gets the To-Date.Methods inherited from class io.openems.common.jsonrpc.base.JsonrpcRequest
getId, getTimeout, toJsonObject
Methods inherited from class io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
getFullyQualifiedMethod, getMethod
Methods inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
from, from, toString
-
Field Details
-
METHOD
- See Also:
-
-
Constructor Details
-
QueryHistoricTimeseriesEnergyPerPeriodRequest
public QueryHistoricTimeseriesEnergyPerPeriodRequest(ZonedDateTime fromDate, ZonedDateTime toDate, Resolution resolution) throws OpenemsError.OpenemsNamedException
-
-
Method Details
-
from
public static QueryHistoricTimeseriesEnergyPerPeriodRequest from(JsonrpcRequest r) throws OpenemsError.OpenemsNamedException CreateQueryHistoricTimeseriesEnergyPerPeriodRequest
from a templateJsonrpcRequest
.- Parameters:
r
- the templateJsonrpcRequest
- Returns:
- the
QueryHistoricTimeseriesEnergyPerPeriodRequest
- Throws:
OpenemsError.OpenemsNamedException
- on parse error
-
getParams
public com.google.gson.JsonObject getParams()Description copied from class:AbstractJsonrpcRequest
Gets the paramsJsonObject
of theJsonrpcRequest
.- Specified by:
getParams
in classAbstractJsonrpcRequest
- Returns:
- the params as
JsonObject
-
getFromDate
Gets the From-Date.- Returns:
- From-Date
-
getToDate
Gets the To-Date.- Returns:
- To-Date
-
getChannels
Gets theChannelAddress
es.- Returns:
- Set of
ChannelAddress
-
getResolution
Gets the requested Resolution in [s].- Returns:
- Resolution
-