Class QueryHistoricTimeseriesEnergyRequest
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.QueryHistoricTimeseriesEnergyRequest
Represents a JSON-RPC Request for 'queryHistoricTimeseriesEnergy'.
This Request is for use-cases where you want to get the energy for one period per Channel, e.g. to show the entire energy over a period as a text. The energy is calculated by subtracting first value of the period ('fromDate') from the last value of the period ('toDate').
{
"jsonrpc": "2.0",
"id": "UUID",
"method": "queryHistoricTimeseriesEnergy",
"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
ConstructorDescriptionQueryHistoricTimeseriesEnergyRequest
(ZonedDateTime fromDate, ZonedDateTime toDate) -
Method Summary
Modifier and TypeMethodDescriptionCreateAuthenticateWithPasswordRequest
from a templateJsonrpcRequest
.Gets theChannelAddress
es.Gets the From-Date.com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.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
-
QueryHistoricTimeseriesEnergyRequest
public QueryHistoricTimeseriesEnergyRequest(ZonedDateTime fromDate, ZonedDateTime toDate) throws OpenemsError.OpenemsNamedException
-
-
Method Details
-
from
public static QueryHistoricTimeseriesEnergyRequest from(JsonrpcRequest r) throws OpenemsError.OpenemsNamedException CreateAuthenticateWithPasswordRequest
from a templateJsonrpcRequest
.- Parameters:
r
- the templateJsonrpcRequest
- Returns:
- the
AuthenticateWithPasswordRequest
- 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
-