100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Electricity assettypes update
Don2ff0869be416
diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleAsset.javaindex 97d39d34b..406578a67 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleAsset.java@@ -23,8 +23,10 @@ import org.openremote.model.asset.Asset;import org.openremote.model.asset.AssetDescriptor;import org.openremote.model.attribute.Attribute;import org.openremote.model.attribute.AttributeMap;+import org.openremote.model.attribute.MetaItem;import org.openremote.model.geo.GeoJSONPoint;import org.openremote.model.value.AttributeDescriptor;+import org.openremote.model.value.MetaItemType;import org.openremote.model.value.ValueType;import javax.persistence.Entity;@@ -37,9 +39,23 @@ import static org.openremote.model.Constants.*;public class ElectricVehicleAsset extends ElectricityStorageAsset {public static final AttributeDescriptor<ElectricityChargerAsset.ConnectorType> CONNECTOR_TYPE = new AttributeDescriptor<>("connectorType", ElectricityChargerAsset.CONNECTOR_TYPE_VALUE);- public static final AttributeDescriptor<Integer> ODOMETER = new AttributeDescriptor<>("odometer", ValueType.POSITIVE_INTEGER)+ public static final AttributeDescriptor<Integer> ODOMETER = new AttributeDescriptor<>("odometer", ValueType.POSITIVE_INTEGER,+ new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_METRE);- public static final AttributeDescriptor<Boolean> CHARGER_CONNECTED = new AttributeDescriptor<>("chargerConnected", ValueType.BOOLEAN);+ public static final AttributeDescriptor<Boolean> CHARGER_CONNECTED = new AttributeDescriptor<>("chargerConnected", ValueType.BOOLEAN,+ new MetaItem<>(MetaItemType.READ_ONLY));+ public static final AttributeDescriptor<String> CHARGER_ID = new AttributeDescriptor<>("chargerID", ValueType.TEXT,+ new MetaItem<>(MetaItemType.READ_ONLY));+ public static final AttributeDescriptor<Integer> MILEAGE_CAPACITY = new AttributeDescriptor<>("mileageCapacity", ValueType.POSITIVE_INTEGER)+ .withUnits(UNITS_KILO, UNITS_METRE);+ public static final AttributeDescriptor<Double> MILEAGE_CHARGED = new AttributeDescriptor<>("mileageCharged", ValueType.POSITIVE_NUMBER,+ new MetaItem<>(MetaItemType.READ_ONLY)+ ).withUnits(UNITS_KILO, UNITS_METRE);+ public static final AttributeDescriptor<Integer> MILEAGE_MIN = new AttributeDescriptor<>("mileageMin", ValueType.POSITIVE_INTEGER)+ .withUnits(UNITS_KILO, UNITS_METRE);+ public static final AttributeDescriptor<String> VEHICLE_CATEGORY = new AttributeDescriptor<>("vehicleCategory", ValueType.TEXT);++ public static final AttributeDescriptor<Integer> CHARGE_CYCLES = ElectricityStorageAsset.CHARGE_CYCLES.withOptional(true);public static final AssetDescriptor<ElectricVehicleAsset> DESCRIPTOR = new AssetDescriptor<>("car-electric", "49B0D8", ElectricVehicleAsset.class);@@ -81,6 +97,25 @@ public class ElectricVehicleAsset extends ElectricityStorageAsset {return this;}+ public Optional<String> getChargerId() {+ return getAttributes().getValue(CHARGER_ID);+ }++ public Optional<Integer> getMileageCapacity() {+ return getAttributes().getValue(MILEAGE_CAPACITY);+ }++ public Optional<Double> getMileageCharged() {+ return getAttributes().getValue(MILEAGE_CHARGED);+ }++ public Optional<Integer> getMileageMin() {+ return getAttributes().getValue(MILEAGE_MIN);+ }++ public Optional<String> getVehicleCategory() {+ return getAttributes().getValue(VEHICLE_CATEGORY);+ }@Overridepublic ElectricVehicleAsset setPower(Double value) {diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleFleetGroupAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleFleetGroupAsset.javaindex 8bc344d69..a8e370ae0 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleFleetGroupAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleFleetGroupAsset.java@@ -31,6 +31,8 @@ import javax.persistence.Entity;import java.util.Collection;import java.util.Optional;+import static org.openremote.model.Constants.*;+@Entitypublic class ElectricVehicleFleetGroupAsset extends GroupAsset {@@ -40,6 +42,9 @@ public class ElectricVehicleFleetGroupAsset extends GroupAsset {public static final AttributeDescriptor<Integer> POWER_IMPORT_MAX = new AttributeDescriptor<>("powerImportMax", ValueType.POSITIVE_INTEGER);public static final AttributeDescriptor<Integer> POWER_EXPORT_MAX = new AttributeDescriptor<>("powerExportMax", ValueType.POSITIVE_INTEGER);+ public static final AttributeDescriptor<Integer> MILEAGE_MINIMUM = new AttributeDescriptor<>("mileageMinimum", ValueType.POSITIVE_INTEGER)+ .withUnits(UNITS_KILO, UNITS_METRE);+public static final AssetDescriptor<ElectricVehicleFleetGroupAsset> DESCRIPTOR = new AssetDescriptor<>("car-multiple", "49B0D8", ElectricVehicleFleetGroupAsset.class);ElectricVehicleFleetGroupAsset() {@@ -69,6 +74,8 @@ public class ElectricVehicleFleetGroupAsset extends GroupAsset {return getAttributes().getValue(POWER_EXPORT_MAX);}+ public Optional<Integer> getMileageMinimum() { return getAttributes().getValue(MILEAGE_MINIMUM); }+@Overridepublic ElectricVehicleFleetGroupAsset setId(String id) {super.setId(id);diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityAsset.javaindex f14ee0152..2ce189666 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityAsset.java@@ -33,7 +33,7 @@ public abstract class ElectricityAsset<T extends ElectricityAsset<?>> extends Asnew MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> POWER_SETPOINT = new AttributeDescriptor<>("powerSetpoint", ValueType.NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)).withUnits(UNITS_KILO, UNITS_WATT).withFormat(ValueFormat.NUMBER_1_DP());public static final AttributeDescriptor<Double> POWER_IMPORT_MIN = new AttributeDescriptor<>("powerImportMin", ValueType.POSITIVE_NUMBER).withUnits(UNITS_KILO, UNITS_WATT);@@ -41,25 +41,28 @@ public abstract class ElectricityAsset<T extends ElectricityAsset<?>> extends As.withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> POWER_EXPORT_MIN = new AttributeDescriptor<>("powerExportMin", ValueType.POSITIVE_NUMBER).withUnits(UNITS_KILO, UNITS_WATT);- public static final AttributeDescriptor<Double> POWER_EXPORT_MAX = new AttributeDescriptor<>("powerExportMax", ValueType.POSITIVE_NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)- ).withUnits(UNITS_KILO, UNITS_WATT);+ public static final AttributeDescriptor<Double> POWER_EXPORT_MAX = new AttributeDescriptor<>("powerExportMax", ValueType.POSITIVE_NUMBER)+ .withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> ENERGY_IMPORT_TOTAL = new AttributeDescriptor<>("energyImportTotal", ValueType.POSITIVE_NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)+ new MetaItem<>(MetaItemType.READ_ONLY),+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)).withUnits(UNITS_KILO, UNITS_WATT, UNITS_HOUR);public static final AttributeDescriptor<Double> ENERGY_EXPORT_TOTAL = new AttributeDescriptor<>("energyExportTotal", ValueType.POSITIVE_NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)+ new MetaItem<>(MetaItemType.READ_ONLY),+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)).withUnits(UNITS_KILO, UNITS_WATT, UNITS_HOUR);public static final AttributeDescriptor<Double> ENERGY_LEVEL = new AttributeDescriptor<>("energyLevel", ValueType.POSITIVE_NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)+ new MetaItem<>(MetaItemType.READ_ONLY),+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)).withUnits(UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Double> ENERGY_CAPACITY = new AttributeDescriptor<>("energyCapacity", ValueType.POSITIVE_NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)- ).withUnits(UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE = new AttributeDescriptor<>("energyLevelPercentage", ValueType.POSITIVE_INTEGER)- .withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100));+ public static final AttributeDescriptor<Double> ENERGY_CAPACITY = new AttributeDescriptor<>("energyCapacity", ValueType.POSITIVE_NUMBER)+ .withUnits(UNITS_KILO, UNITS_WATT, UNITS_HOUR);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE = new AttributeDescriptor<>("energyLevelPercentage", ValueType.POSITIVE_INTEGER,+ new MetaItem<>(MetaItemType.READ_ONLY),+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)+ ).withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100));public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MAX = new AttributeDescriptor<>("energyLevelPercentageMax", ValueType.POSITIVE_INTEGER).withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100));public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MIN = new AttributeDescriptor<>("energyLevelPercentageMin", ValueType.POSITIVE_INTEGER)@@ -79,10 +82,12 @@ public abstract class ElectricityAsset<T extends ElectricityAsset<?>> extends Aspublic static final AttributeDescriptor<Double> CARBON_EXPORT = new AttributeDescriptor<>("carbonExport", ValueType.POSITIVE_NUMBER).withUnits(UNITS_KILO, UNITS_GRAM, UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);public static final AttributeDescriptor<Integer> CARBON_IMPORT_TOTAL = new AttributeDescriptor<>("carbonImportTotal", ValueType.POSITIVE_INTEGER,- new MetaItem<>(MetaItemType.READ_ONLY, true)+ new MetaItem<>(MetaItemType.READ_ONLY, true),+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)).withUnits(UNITS_KILO, UNITS_GRAM);public static final AttributeDescriptor<Integer> CARBON_EXPORT_TOTAL = new AttributeDescriptor<>("carbonExportTotal", ValueType.POSITIVE_INTEGER,- new MetaItem<>(MetaItemType.READ_ONLY, true)+ new MetaItem<>(MetaItemType.READ_ONLY, true),+ new MetaItem<>(MetaItemType.STORE_DATA_POINTS, true)).withUnits(UNITS_KILO, UNITS_GRAM);/**diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityChargerAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityChargerAsset.javaindex e86673ec0..2894d9d4f 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityChargerAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityChargerAsset.java@@ -20,8 +20,11 @@package org.openremote.model.asset.impl;import org.openremote.model.asset.AssetDescriptor;+import org.openremote.model.attribute.MetaItem;import org.openremote.model.value.AttributeDescriptor;+import org.openremote.model.value.MetaItemType;import org.openremote.model.value.ValueDescriptor;+import org.openremote.model.value.ValueType;import javax.persistence.Entity;import java.util.Optional;@@ -42,6 +45,27 @@ public class ElectricityChargerAsset extends ElectricityAsset<ElectricityChargerpublic static final ValueDescriptor<ConnectorType> CONNECTOR_TYPE_VALUE = new ValueDescriptor<>("connectorType", ConnectorType.class);public static final AttributeDescriptor<ConnectorType> CONNECTOR_TYPE = new AttributeDescriptor<>("connectorType", CONNECTOR_TYPE_VALUE);+ public static final AttributeDescriptor<Boolean> VEHICLE_CONNECTED = new AttributeDescriptor<>("vehicleConnected", ValueType.BOOLEAN,+ new MetaItem<>(MetaItemType.READ_ONLY));+ public static final AttributeDescriptor<String> VEHICLE_ID = new AttributeDescriptor<>("vehicleID", ValueType.TEXT,+ new MetaItem<>(MetaItemType.READ_ONLY, true)).withOptional(true);++ public static final AttributeDescriptor<Double> POWER_IMPORT_MIN = ElectricityAsset.POWER_IMPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_EXPORT_MIN = ElectricityAsset.POWER_EXPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_EXPORT_TOTAL = ElectricityAsset.ENERGY_EXPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_LEVEL = ElectricityAsset.ENERGY_LEVEL.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_CAPACITY = ElectricityAsset.ENERGY_CAPACITY.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MAX = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE_MAX.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MIN = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE_MIN.withOptional(true);+ public static final AttributeDescriptor<Integer> EFFICIENCY_IMPORT = ElectricityAsset.EFFICIENCY_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> EFFICIENCY_EXPORT = ElectricityAsset.EFFICIENCY_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Double> TARIFF_IMPORT = ElectricityAsset.TARIFF_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> TARIFF_EXPORT = ElectricityAsset.TARIFF_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_IMPORT = ElectricityAsset.CARBON_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_EXPORT = ElectricityAsset.CARBON_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_IMPORT_TOTAL = ElectricityAsset.CARBON_IMPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_EXPORT_TOTAL = ElectricityAsset.CARBON_EXPORT_TOTAL.withOptional(true);public static final AssetDescriptor<ElectricityChargerAsset> DESCRIPTOR = new AssetDescriptor<>("ev-station", "8A293D", ElectricityChargerAsset.class);@@ -60,9 +84,16 @@ public class ElectricityChargerAsset extends ElectricityAsset<ElectricityChargerreturn getAttributes().getValue(CONNECTOR_TYPE);}-public ElectricityChargerAsset setConnectorType(ConnectorType value) {getAttributes().getOrCreate(CONNECTOR_TYPE).setValue(value);return this;}++ public Optional<Boolean> getVehicleConnected() {+ return getAttributes().getValue(VEHICLE_CONNECTED);+ }++ public Optional<String> getVehicleID() {+ return getAttributes().getValue(VEHICLE_ID);+ }}diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityConsumerAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityConsumerAsset.javaindex dfd0e229e..87b424694 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityConsumerAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityConsumerAsset.java@@ -20,14 +20,39 @@package org.openremote.model.asset.impl;import org.openremote.model.asset.AssetDescriptor;+import org.openremote.model.attribute.MetaItem;+import org.openremote.model.value.*;import javax.persistence.Entity;+import static org.openremote.model.Constants.*;+import static org.openremote.model.Constants.UNITS_GRAM;+@Entitypublic class ElectricityConsumerAsset extends ElectricityAsset<ElectricityConsumerAsset> {public static final AssetDescriptor<ElectricityConsumerAsset> DESCRIPTOR = new AssetDescriptor<>("power-plug", "8A293D", ElectricityConsumerAsset.class);+ public static final AttributeDescriptor<Double> POWER_SETPOINT = ElectricityAsset.POWER_SETPOINT.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_IMPORT_MIN = ElectricityAsset.POWER_IMPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_IMPORT_MAX = ElectricityAsset.POWER_IMPORT_MAX.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_EXPORT_MIN = ElectricityAsset.POWER_EXPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_EXPORT_MAX = ElectricityAsset.POWER_EXPORT_MAX.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_EXPORT_TOTAL = ElectricityAsset.ENERGY_EXPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_LEVEL = ElectricityAsset.ENERGY_LEVEL.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_CAPACITY = ElectricityAsset.ENERGY_CAPACITY.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MAX = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE_MAX.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MIN = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE_MIN.withOptional(true);+ public static final AttributeDescriptor<Integer> EFFICIENCY_IMPORT = ElectricityAsset.EFFICIENCY_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> EFFICIENCY_EXPORT = ElectricityAsset.EFFICIENCY_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Double> TARIFF_IMPORT = ElectricityAsset.TARIFF_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> TARIFF_EXPORT = ElectricityAsset.TARIFF_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_IMPORT = ElectricityAsset.CARBON_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_EXPORT = ElectricityAsset.CARBON_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_IMPORT_TOTAL = ElectricityAsset.CARBON_IMPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_EXPORT_TOTAL = ElectricityAsset.CARBON_EXPORT_TOTAL.withOptional(true);+/*** For use by hydrators (i.e. JPA/Jackson)*/diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.javaindex 2d0979fe7..2de275146 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerAsset.java@@ -20,12 +20,32 @@package org.openremote.model.asset.impl;import org.openremote.model.asset.AssetDescriptor;+import org.openremote.model.value.AttributeDescriptor;import javax.persistence.Entity;@Entitypublic class ElectricityProducerAsset extends ElectricityAsset<ElectricityProducerAsset> {+ public static final AttributeDescriptor<Double> POWER_SETPOINT = ElectricityAsset.POWER_SETPOINT.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_IMPORT_MIN = ElectricityAsset.POWER_IMPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_IMPORT_MAX = ElectricityAsset.POWER_IMPORT_MAX.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_EXPORT_MIN = ElectricityAsset.POWER_EXPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_IMPORT_TOTAL = ElectricityAsset.ENERGY_IMPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_LEVEL = ElectricityAsset.ENERGY_LEVEL.withOptional(true);+ public static final AttributeDescriptor<Double> ENERGY_CAPACITY = ElectricityAsset.ENERGY_CAPACITY.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MAX = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE_MAX.withOptional(true);+ public static final AttributeDescriptor<Integer> ENERGY_LEVEL_PERCENTAGE_MIN = ElectricityAsset.ENERGY_LEVEL_PERCENTAGE_MIN.withOptional(true);+ public static final AttributeDescriptor<Integer> EFFICIENCY_IMPORT = ElectricityAsset.EFFICIENCY_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> EFFICIENCY_EXPORT = ElectricityAsset.EFFICIENCY_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Double> TARIFF_IMPORT = ElectricityAsset.TARIFF_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> TARIFF_EXPORT = ElectricityAsset.TARIFF_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_IMPORT = ElectricityAsset.CARBON_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_EXPORT = ElectricityAsset.CARBON_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_IMPORT_TOTAL = ElectricityAsset.CARBON_IMPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_EXPORT_TOTAL = ElectricityAsset.CARBON_EXPORT_TOTAL.withOptional(true);+public static final AssetDescriptor<ElectricityProducerAsset> DESCRIPTOR = new AssetDescriptor<>("flash", "EABB4D", ElectricityProducerAsset.class);/**diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.javaindex 28d050fcc..23374f551 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerSolarAsset.java@@ -45,12 +45,12 @@ public class ElectricityProducerSolarAsset extends ElectricityProducerAsset {public static final ValueDescriptor<PanelOrientation> PANEL_ORIENTATION_VALUE = new ValueDescriptor<>("panelOrientation", PanelOrientation.class);public static final AttributeDescriptor<PanelOrientation> PANEL_ORIENTATION = new AttributeDescriptor<>("panelOrientation", PANEL_ORIENTATION_VALUE);- public static final AttributeDescriptor<Integer> PANEL_AZIMUTH = new AttributeDescriptor<>("panelAzimuth", ValueType.POSITIVE_INTEGER+ public static final AttributeDescriptor<Integer> PANEL_AZIMUTH = new AttributeDescriptor<>("panelAzimuth", ValueType.INTEGER).withUnits(UNITS_DEGREE);public static final AttributeDescriptor<Integer> PANEL_PITCH = new AttributeDescriptor<>("panelPitch", ValueType.POSITIVE_INTEGER).withUnits(UNITS_DEGREE);- public static final AssetDescriptor<ElectricityProducerSolarAsset> DESCRIPTOR = new AssetDescriptor<>("white-balance-sunny", "8A293D", ElectricityProducerSolarAsset.class);+ public static final AssetDescriptor<ElectricityProducerSolarAsset> DESCRIPTOR = new AssetDescriptor<>("white-balance-sunny", "EABB4D", ElectricityProducerSolarAsset.class);/*** For use by hydrators (i.e. JPA/Jackson)diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.javaindex 2506108d9..436f58ab2 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityProducerWindAsset.java@@ -24,13 +24,21 @@ import org.openremote.model.asset.AssetDescriptor;import org.openremote.model.attribute.Attribute;import org.openremote.model.attribute.AttributeMap;import org.openremote.model.geo.GeoJSONPoint;+import org.openremote.model.value.AttributeDescriptor;+import org.openremote.model.value.ValueType;import javax.persistence.Entity;import java.util.Collection;+import java.util.Optional;++import static org.openremote.model.Constants.*;@Entitypublic class ElectricityProducerWindAsset extends ElectricityProducerAsset {+ public static final AttributeDescriptor<Double> WIND_SPEED_REFERENCE = new AttributeDescriptor<>("windSpeedReference", ValueType.POSITIVE_NUMBER+ ).withUnits(UNITS_METRE, UNITS_PER, UNITS_SECOND);+public static final AssetDescriptor<ElectricityProducerWindAsset> DESCRIPTOR = new AssetDescriptor<>("wind-turbine", "4B87EA", ElectricityProducerWindAsset.class);ElectricityProducerWindAsset() {@@ -40,6 +48,9 @@ public class ElectricityProducerWindAsset extends ElectricityProducerAsset {super(name);}+ public Optional<Double> getWindSpeedReference() {+ return getAttributes().getValue(WIND_SPEED_REFERENCE);+ }@Overridepublic ElectricityProducerWindAsset setPower(Double value) {diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricityStorageAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricityStorageAsset.javaindex 3c77287e7..996176268 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricityStorageAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricityStorageAsset.java@@ -35,6 +35,13 @@ public class ElectricityStorageAsset extends ElectricityAsset<ElectricityStoragenew MetaItem<>(MetaItemType.READ_ONLY));+ public static final AttributeDescriptor<Double> POWER_IMPORT_MIN = ElectricityAsset.POWER_IMPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> POWER_EXPORT_MIN = ElectricityAsset.POWER_EXPORT_MIN.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_IMPORT = ElectricityAsset.CARBON_IMPORT.withOptional(true);+ public static final AttributeDescriptor<Double> CARBON_EXPORT = ElectricityAsset.CARBON_EXPORT.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_IMPORT_TOTAL = ElectricityAsset.CARBON_IMPORT_TOTAL.withOptional(true);+ public static final AttributeDescriptor<Integer> CARBON_EXPORT_TOTAL = ElectricityAsset.CARBON_EXPORT_TOTAL.withOptional(true);+public static final AssetDescriptor<ElectricityStorageAsset> DESCRIPTOR = new AssetDescriptor<>("battery-charging", "1B7C89", ElectricityStorageAsset.class);/**diff --git a/model/src/main/java/org/openremote/model/asset/impl/ElectricitySupplierAsset.java b/model/src/main/java/org/openremote/model/asset/impl/ElectricitySupplierAsset.javaindex 7d2d6d7c5..740d34d28 100644--- a/model/src/main/java/org/openremote/model/asset/impl/ElectricitySupplierAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricitySupplierAsset.java@@ -40,8 +40,8 @@ public class ElectricitySupplierAsset extends ElectricityAsset<ElectricitySupplipublic static final AttributeDescriptor<Double> ENERGY_EXPORT_INCOME = new AttributeDescriptor<>("energyExportIncome", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY, true)).withUnits("EUR");- public static final AttributeDescriptor<Double> FINANCIAL_WALLET = new AttributeDescriptor<>("financialWallet", ValueType.POSITIVE_NUMBER).withUnits("EUR");- public static final AttributeDescriptor<Integer> CARBON_WALLET = new AttributeDescriptor<>("carbonWallet", ValueType.POSITIVE_INTEGER,+ public static final AttributeDescriptor<Double> FINANCIAL_WALLET = new AttributeDescriptor<>("financialWallet", ValueType.NUMBER).withUnits("EUR");+ public static final AttributeDescriptor<Integer> CARBON_WALLET = new AttributeDescriptor<>("carbonWallet", ValueType.INTEGER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_GRAM);