Package io.openems.edge.meter.discovergy
Class DiscovergyApiClient
java.lang.Object
io.openems.edge.meter.discovergy.DiscovergyApiClient
Client for the Discovergy API (https://api.discovergy.com/docs/).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonArray
getFieldNames
(String meterId) Returns the available measurement field names for the specified meter.com.google.gson.JsonObject
getLastReading
(String meterId, Field... fields) Returns the last measurement for the specified meter.com.google.gson.JsonArray
Returns all meters that the user has access to.
-
Constructor Details
-
DiscovergyApiClient
-
-
Method Details
-
getMeters
Returns all meters that the user has access to.See https://api.discovergy.com/docs/ for details.
- Returns:
- the Meters as a JsonArray.
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getFieldNames
public com.google.gson.JsonArray getFieldNames(String meterId) throws OpenemsError.OpenemsNamedException Returns the available measurement field names for the specified meter.See https://api.discovergy.com/docs/ for details.
- Parameters:
meterId
- the Discovergy Meter-ID- Returns:
- the Meters as a JsonArray.
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getLastReading
public com.google.gson.JsonObject getLastReading(String meterId, Field... fields) throws OpenemsError.OpenemsNamedException Returns the last measurement for the specified meter.See https://api.discovergy.com/docs/ for details.
- Parameters:
meterId
- the Discovergy Meter-IDfields
- the fields to be queried- Returns:
- the Meters as a JsonArray.
- Throws:
OpenemsError.OpenemsNamedException
- on error
-