Package net.solarnetwork.domain.datum
Interface EnergyDatum
- All Superinterfaces:
Datum
- All Known Subinterfaces:
AcDcEnergyDatum,AcEnergyDatum,DcEnergyDatum
Standardized API for energy related datum to implement.
By "energy" we simply mean this datum represents information tracked during the production or consumption of energy. For example current sensors can provide approximate instantaneous watt readings, watt-hour meters can provide accumulated Wh readings, and usually solar inverters can provide instantaneous generated power and accumulated energy production readings.
- Version:
- 2.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA tag for "consumption" of energy.static final StringA tag for "generation" of energy.static final StringAn accumulating sample key forgetWattHourReading()values.static final StringAn instantaneous sample key forgetWatts()values.Fields inherited from interface net.solarnetwork.domain.datum.Datum
DATUM_TYPE_PROPERTY, DATUM_TYPES_PROPERTY, OP_STATE, OP_STATES, REVERSE_ACCUMULATING_SUFFIX_KEY, SOURCE_ID, TIMESTAMP -
Method Summary
Modifier and TypeMethodDescriptiondefault LongGet a reverse watt-hour reading.default LongGet a watt-hour reading.default IntegergetWatts()Get the instantaneous watts.default booleanReturn true if this datum is tagged withTAG_CONSUMPTION.default booleanReturn true if this datum is tagged withTAG_GENERATION.Methods inherited from interface net.solarnetwork.domain.datum.Datum
asSampleOperations, asSimpleMap, copyWithId, copyWithSamples, getKind, getObjectId, getSampleData, getSourceId, getTimestamp
-
Field Details
-
WATT_HOUR_READING_KEY
An accumulating sample key forgetWattHourReading()values.- See Also:
-
WATTS_KEY
An instantaneous sample key forgetWatts()values.- See Also:
-
TAG_CONSUMPTION
A tag for "consumption" of energy.- See Also:
-
TAG_GENERATION
A tag for "generation" of energy.- See Also:
-
-
Method Details
-
getWattHourReading
Get a watt-hour reading.Generally this is an accumulating value and represents the overall energy used or produced since some reference date. Often the reference date if fixed, but it could also shift, for example shift to the last time a reading was taken.
- Returns:
- the watt hour reading, or null if not available
-
getReverseWattHourReading
Get a reverse watt-hour reading.- Returns:
- the reverse watt hour reading
-
getWatts
Get the instantaneous watts.- Returns:
- watts, or null if not available
-
isConsumption
default boolean isConsumption()Return true if this datum is tagged withTAG_CONSUMPTION.- Returns:
- true if this datum has the consumption tag
-
isGeneration
default boolean isGeneration()Return true if this datum is tagged withTAG_GENERATION.- Returns:
- true if this datum has the generation tag
-