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
Asset types update
Rich Turner5bfb1bf1d0c2
diff --git a/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerDemoSetup.java b/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerDemoSetup.javaindex 0c63613c4..2830391b4 100644--- a/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerDemoSetup.java+++ b/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerDemoSetup.java@@ -414,8 +414,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {production3Asset = assetStorageService.merge(production3Asset);ElectricityChargerAsset charger1Asset = createDemoElectricityChargerAsset("Charger 1 Markthal", building3Asset, new GeoJSONPoint(4.486143, 51.920058));- charger1Asset.setPowerTotal(0d);- charger1Asset.getAttribute(ElectricityConsumerAsset.TARIFF_IMPORT).ifPresent(attr -> attr.setValue(0.15));+ charger1Asset.setPower(0d);charger1Asset.getAttributes().getOrCreate(ElectricityChargerAsset.POWER_TOTAL).addMeta(new MetaItem<>(AGENT_LINK,@@ -456,7 +455,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {charger1Asset = assetStorageService.merge(charger1Asset);ElectricityChargerAsset charger2Asset = createDemoElectricityChargerAsset("Charger 2 Markthal", building3Asset, new GeoJSONPoint(4.486188, 51.919957));- charger2Asset.setPowerTotal(0d);+ charger2Asset.setPower(0d);charger2Asset.getAttributes().getOrCreate(ElectricityChargerAsset.POWER_TOTAL).addMeta(new MetaItem<>(@@ -498,7 +497,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {charger2Asset = assetStorageService.merge(charger2Asset);ElectricityChargerAsset charger3Asset = createDemoElectricityChargerAsset("Charger 3 Markthal", building3Asset, new GeoJSONPoint(4.486232, 51.919856));- charger3Asset.setPowerTotal(0d);+ charger3Asset.setPower(0d);charger3Asset.getAttributes().getOrCreate(ElectricityChargerAsset.POWER_TOTAL).addMeta(new MetaItem<>(@@ -540,7 +539,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {charger3Asset = assetStorageService.merge(charger3Asset);ElectricityChargerAsset charger4Asset = createDemoElectricityChargerAsset("Charger 4 Markthal", building3Asset, new GeoJSONPoint(4.486286, 51.919733));- charger4Asset.setPowerTotal(0d);+ charger4Asset.setPower(0d);charger4Asset.getAttributes().getOrCreate(ElectricityChargerAsset.POWER_TOTAL).addMeta(new MetaItem<>(diff --git a/manager/src/main/resources/demo/rules/smartcity/RotterdamPowerBalance.flow b/manager/src/main/resources/demo/rules/smartcity/RotterdamPowerBalance.flowindex 020659d84..c5467498a 100644--- a/manager/src/main/resources/demo/rules/smartcity/RotterdamPowerBalance.flow+++ b/manager/src/main/resources/demo/rules/smartcity/RotterdamPowerBalance.flow@@ -26,7 +26,7 @@},"value": {"assetId": "6DW7WWYVtOybr7W1BWREc3",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -60,7 +60,7 @@},"value": {"assetId": "3Mj9yiC6bcH4MoIYDY2T35",- "attributeName": "powerTotal"+ "attributeName": "power"}}],diff --git a/manager/src/main/resources/demo/rules/smartcity/TotalPowerConsumption.flow b/manager/src/main/resources/demo/rules/smartcity/TotalPowerConsumption.flowindex 4867c6bce..332a9bfd5 100644--- a/manager/src/main/resources/demo/rules/smartcity/TotalPowerConsumption.flow+++ b/manager/src/main/resources/demo/rules/smartcity/TotalPowerConsumption.flow@@ -42,7 +42,7 @@},"value": {"assetId": "3Mj9yiC6bcH4MoIYDY2T35",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -76,7 +76,7 @@},"value": {"assetId": "4jBtdIZOtA7pLxPNSwWCVa",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -110,7 +110,7 @@},"value": {"assetId": "6L8hVlM1fQ4dDHFM6HYA6O",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -144,7 +144,7 @@},"value": {"assetId": "4oio0T4DX9lxeBsZVNIpEN",- "attributeName": "powerTotal"+ "attributeName": "power"}}],diff --git a/manager/src/main/resources/demo/rules/smartcity/TotalSolarProduction.flow b/manager/src/main/resources/demo/rules/smartcity/TotalSolarProduction.flowindex c57588855..8d1effe71 100644--- a/manager/src/main/resources/demo/rules/smartcity/TotalSolarProduction.flow+++ b/manager/src/main/resources/demo/rules/smartcity/TotalSolarProduction.flow@@ -42,7 +42,7 @@},"value": {"assetId": "6DW7WWYVtOybr7W1BWREc3",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -76,7 +76,7 @@},"value": {"assetId": "4Fnz8pxxdtDobuDGWYwRNp",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -110,7 +110,7 @@},"value": {"assetId": "2RIt5xuSj1BSyaRhwU3z3I",- "attributeName": "powerTotal"+ "attributeName": "power"}}],@@ -144,7 +144,7 @@},"value": {"assetId": "5xgMdcrVWORYWpUKuP2Mo0",- "attributeName": "powerTotal"+ "attributeName": "power"}}],diff --git a/model/src/main/java/org/openremote/model/asset/impl/BuildingAsset.java b/model/src/main/java/org/openremote/model/asset/impl/BuildingAsset.javaindex 1a4119499..d7461cfee 100644--- a/model/src/main/java/org/openremote/model/asset/impl/BuildingAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/BuildingAsset.java@@ -19,11 +19,17 @@*/package org.openremote.model.asset.impl;+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.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.Date;import java.util.Optional;@Entity@@ -52,4 +58,106 @@ public class BuildingAsset extends CityAsset {public Optional<String> getPostalCode() {return getAttributes().getValue(POSTAL_CODE);}++ @Override+ public BuildingAsset setId(String id) {+ super.setId(id);+ return this;+ }++ @Override+ public BuildingAsset setName(String name) throws IllegalArgumentException {+ super.setName(name);+ return this;+ }++ @Override+ public BuildingAsset setAccessPublicRead(boolean accessPublicRead) {+ super.setAccessPublicRead(accessPublicRead);+ return this;+ }++ @Override+ public BuildingAsset setParent(Asset<?> parent) {+ super.setParent(parent);+ return this;+ }++ @Override+ public BuildingAsset setParentId(String parentId) {+ super.setParentId(parentId);+ return this;+ }++ @Override+ public BuildingAsset setRealm(String realm) {+ super.setRealm(realm);+ return this;+ }++ @Override+ public BuildingAsset setAttributes(AttributeMap attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public Asset<?> setAttributes(Attribute<?>... attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public BuildingAsset setAttributes(Collection<Attribute<?>> attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public BuildingAsset setLocation(GeoJSONPoint location) {+ super.setLocation(location);+ return this;+ }++ @Override+ public BuildingAsset setTags(String[] tags) {+ super.setTags(tags);+ return this;+ }++ @Override+ public BuildingAsset setEmail(String email) {+ super.setEmail(email);+ return this;+ }++ @Override+ public BuildingAsset setNotes(String notes) {+ super.setNotes(notes);+ return this;+ }++ @Override+ public BuildingAsset setModel(String model) {+ super.setModel(model);+ return this;+ }++ @Override+ public BuildingAsset addAttributes(Attribute<?>... attributes) {+ super.addAttributes(attributes);+ return this;+ }++ @Override+ public BuildingAsset addOrReplaceAttributes(Attribute<?>... attributes) {+ super.addOrReplaceAttributes(attributes);+ return this;+ }++ @Override+ public BuildingAsset setManufacturer(String manufacturer) {+ super.setManufacturer(manufacturer);+ return this;+ }}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.javanew file mode 100644index 000000000..f38d829a4--- /dev/null+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleAsset.java@@ -0,0 +1,202 @@+/*+ * Copyright 2020, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+package org.openremote.model.asset.impl;++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.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.*;++@Entity+public class ElectricVehicleAsset extends ElectricityStorageAsset {++ public static final AttributeDescriptor<ElectricityChargerAsset.ConnectorType> CONNECTOR_TYPE = new AttributeDescriptor<>("connectorType", ElectricityChargerAsset.CONNECTOR_TYPE_VALUE);+ public static final AttributeDescriptor<Double> EFFICIENCY = new AttributeDescriptor<>("efficiency", ValueType.POSITIVE_NUMBER)+ .withUnits(UNITS_KILO, UNITS_METRE, UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);+ public static final AttributeDescriptor<Integer> ODOMETER = new AttributeDescriptor<>("odometer", ValueType.POSITIVE_INTEGER)+ .withUnits(UNITS_KILO, UNITS_METRE);+ public static final AttributeDescriptor<Boolean> CHARGER_CONNECTED = new AttributeDescriptor<>("chargerConnected", ValueType.BOOLEAN);++ public static final AssetDescriptor<ElectricVehicleAsset> DESCRIPTOR = new AssetDescriptor<>("car-electric", "49B0D8", ElectricVehicleAsset.class);++ /**+ * For use by hydrators (i.e. JPA/Jackson)+ */+ ElectricVehicleAsset() {+ this(null);+ }++ public ElectricVehicleAsset(String name) {+ super(name);+ }++ @Override+ public ElectricVehicleAsset setId(String id) {+ super.setId(id);+ return this;+ }++ @Override+ public ElectricVehicleAsset setName(String name) throws IllegalArgumentException {+ super.setName(name);+ return this;+ }++ @Override+ public ElectricVehicleAsset setAccessPublicRead(boolean accessPublicRead) {+ super.setAccessPublicRead(accessPublicRead);+ return this;+ }++ @Override+ public ElectricVehicleAsset setParent(Asset<?> parent) {+ super.setParent(parent);+ return this;+ }++ @Override+ public ElectricVehicleAsset setParentId(String parentId) {+ super.setParentId(parentId);+ return this;+ }++ @Override+ public ElectricVehicleAsset setRealm(String realm) {+ super.setRealm(realm);+ return this;+ }++ @Override+ protected ElectricityStorageAsset setPath(String[] path) {+ super.setPath(path);+ return this;+ }++ @Override+ public ElectricVehicleAsset setAttributes(AttributeMap attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public Asset<?> setAttributes(Attribute<?>... attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleAsset setAttributes(Collection<Attribute<?>> attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleAsset setLocation(GeoJSONPoint location) {+ super.setLocation(location);+ return this;+ }++ @Override+ public ElectricVehicleAsset setEmail(String email) {+ super.setEmail(email);+ return this;+ }++ @Override+ public ElectricVehicleAsset setNotes(String notes) {+ super.setNotes(notes);+ return this;+ }++ @Override+ public ElectricVehicleAsset setManufacturer(String manufacturer) {+ super.setManufacturer(manufacturer);+ return this;+ }++ @Override+ public ElectricVehicleAsset setModel(String model) {+ super.setModel(model);+ return this;+ }++ @Override+ public ElectricVehicleAsset addAttributes(Attribute<?>... attributes) {+ super.addAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleAsset addOrReplaceAttributes(Attribute<?>... attributes) {+ super.addOrReplaceAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleAsset setTags(String[] tags) {+ super.setTags(tags);+ return this;+ }++ public Optional<ElectricityChargerAsset.ConnectorType> getConnectorType() {+ return getAttributes().getValue(CONNECTOR_TYPE);+ }++ public ElectricVehicleAsset setConnectorType(ElectricityChargerAsset.ConnectorType value) {+ getAttributes().getOrCreate(CONNECTOR_TYPE).setValue(value);+ return this;+ }++ public Optional<Double> getEfficiency() {+ return getAttributes().getValue(EFFICIENCY);+ }++ public ElectricVehicleAsset setEfficiency(Double value) {+ getAttributes().getOrCreate(EFFICIENCY).setValue(value);+ return this;+ }++ public Optional<Integer> getOdometer() {+ return getAttributes().getValue(ODOMETER);+ }++ public ElectricVehicleAsset setOdometer(Integer value) {+ getAttributes().getOrCreate(ODOMETER).setValue(value);+ return this;+ }++ public Optional<Boolean> getChargerConnected() {+ return getAttributes().getValue(CHARGER_CONNECTED);+ }++ public ElectricVehicleAsset setChargerConnected(Boolean value) {+ getAttributes().getOrCreate(CHARGER_CONNECTED).setValue(value);+ return this;+ }+}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.javanew file mode 100644index 000000000..47de7a2f1--- /dev/null+++ b/model/src/main/java/org/openremote/model/asset/impl/ElectricVehicleFleetGroupAsset.java@@ -0,0 +1,185 @@+/*+ * Copyright 2021, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+package org.openremote.model.asset.impl;++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.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;++@Entity+public class ElectricVehicleFleetGroupAsset extends GroupAsset {++ public static final AttributeDescriptor<String> FLEET_CATEGORY = new AttributeDescriptor<>("fleetCategory", ValueType.TEXT);+ public static final AttributeDescriptor<Integer> AVAILABLE_CHARGING_SPACES = new AttributeDescriptor<>("availableChargingSpaces", ValueType.POSITIVE_INTEGER);+ public static final AttributeDescriptor<Integer> AVAILABLE_DISCHARGING_SPACES = new AttributeDescriptor<>("availableDischargingSpaces", ValueType.POSITIVE_INTEGER);+ 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 AssetDescriptor<ElectricVehicleFleetGroupAsset> DESCRIPTOR = new AssetDescriptor<>("car-multiple", "49B0D8", ElectricVehicleFleetGroupAsset.class);++ ElectricVehicleFleetGroupAsset() {+ }++ public ElectricVehicleFleetGroupAsset(String name) {+ super(name, ElectricVehicleAsset.DESCRIPTOR);+ }++ public Optional<String> getFleetCategory() {+ return getAttributes().getValue(FLEET_CATEGORY);+ }++ public Optional<Integer> getAvailableChargingSpaces() {+ return getAttributes().getValue(AVAILABLE_CHARGING_SPACES);+ }++ public Optional<Integer> getAvailableDischargingSpaces() {+ return getAttributes().getValue(AVAILABLE_DISCHARGING_SPACES);+ }++ public Optional<Integer> getPowerImportMax() {+ return getAttributes().getValue(POWER_IMPORT_MAX);+ }++ public Optional<Integer> getPowerExportMax() {+ return getAttributes().getValue(POWER_EXPORT_MAX);+ }++ @Override+ public ElectricVehicleFleetGroupAsset setId(String id) {+ super.setId(id);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setVersion(long version) {+ super.setVersion(version);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setName(String name) throws IllegalArgumentException {+ super.setName(name);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setAccessPublicRead(boolean accessPublicRead) {+ super.setAccessPublicRead(accessPublicRead);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setParent(Asset<?> parent) {+ super.setParent(parent);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setParentId(String parentId) {+ super.setParentId(parentId);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setRealm(String realm) {+ super.setRealm(realm);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setAttributes(AttributeMap attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public Asset<?> setAttributes(Attribute<?>... attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setAttributes(Collection<Attribute<?>> attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset addAttributes(Attribute<?>... attributes) {+ super.addAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset addOrReplaceAttributes(Attribute<?>... attributes) {+ super.addOrReplaceAttributes(attributes);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setLocation(GeoJSONPoint location) {+ super.setLocation(location);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setTags(String[] tags) {+ super.setTags(tags);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setEmail(String email) {+ super.setEmail(email);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setNotes(String notes) {+ super.setNotes(notes);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setManufacturer(String manufacturer) {+ super.setManufacturer(manufacturer);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setModel(String model) {+ super.setModel(model);+ return this;+ }++ @Override+ public ElectricVehicleFleetGroupAsset setChildAssetType(String childAssetType) {+ super.setChildAssetType(childAssetType);+ return this;+ }+}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 1564fe635..9bcb8dca4 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@@ -47,23 +47,18 @@ public class ElectricityChargerAsset extends Asset<ElectricityChargerAsset> {public static final AttributeDescriptor<String> STATUS = new AttributeDescriptor<>("status", ValueType.TEXT,new MetaItem<>(MetaItemType.READ_ONLY));- public static final AttributeDescriptor<ConnectorType> CHARGER_TYPE = new AttributeDescriptor<>("chargerType", CONNECTOR_TYPE_VALUE);+ public static final AttributeDescriptor<ConnectorType> CONNECTOR_TYPE = new AttributeDescriptor<>("connectorType", CONNECTOR_TYPE_VALUE);public static final AttributeDescriptor<Double> POWER_CAPACITY_IMPORT = new AttributeDescriptor<>("powerCapacityImport", ValueType.POSITIVE_NUMBER).withUnits(UNITS_KILO, UNITS_WATT).withFormat(ValueFormat.NUMBER_0_DP());public static final AttributeDescriptor<Double> POWER_CAPACITY_EXPORT = new AttributeDescriptor<>("powerCapacityExport", ValueType.POSITIVE_NUMBER).withUnits(UNITS_KILO, UNITS_WATT).withFormat(ValueFormat.NUMBER_0_DP());- public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("powerTotal", ValueType.NUMBER,+ public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("power", ValueType.NUMBER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_WATT).withFormat(ValueFormat.NUMBER_1_DP());public static final AttributeDescriptor<Double> POWER_SETPOINT = new AttributeDescriptor<>("powerSetpoint", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_WATT).withFormat(ValueFormat.NUMBER_1_DP());- public static final AttributeDescriptor<Double> TARIFF_IMPORT = new AttributeDescriptor<>("tariffImport", ValueType.NUMBER)- .withUnits("EUR", UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR).withFormat(ValueFormat.NUMBER_2_DP());- public static final AttributeDescriptor<Double> TARIFF_EXPORT = new AttributeDescriptor<>("tariffExport", ValueType.NUMBER)- .withUnits("EUR", UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR).withFormat(ValueFormat.NUMBER_2_DP());- public static final AttributeDescriptor<Double> TARIFF_START = new AttributeDescriptor<>("tariffStart", ValueType.NUMBER)- .withUnits("EUR").withFormat(ValueFormat.NUMBER_2_DP());+public static final AssetDescriptor<ElectricityChargerAsset> DESCRIPTOR = new AssetDescriptor<>("ev-station", "8A293D", ElectricityChargerAsset.class);@@ -88,13 +83,13 @@ public class ElectricityChargerAsset extends Asset<ElectricityChargerAsset> {return (T)this;}- public Optional<ConnectorType> getChargerType() {- return getAttributes().getValue(CHARGER_TYPE);+ public Optional<ConnectorType> getConnectorType() {+ return getAttributes().getValue(CONNECTOR_TYPE);}- public <T extends ElectricityChargerAsset> T setChargerType(ConnectorType value) {- getAttributes().getOrCreate(CHARGER_TYPE).setValue(value);+ public <T extends ElectricityChargerAsset> T setConnectorType(ConnectorType value) {+ getAttributes().getOrCreate(CONNECTOR_TYPE).setValue(value);return (T)this;}@@ -117,11 +112,11 @@ public class ElectricityChargerAsset extends Asset<ElectricityChargerAsset> {return (T)this;}- public Optional<Double> getPowerTotal() {+ public Optional<Double> getPower() {return getAttributes().getValue(POWER_TOTAL);}- public <T extends ElectricityChargerAsset> T setPowerTotal(Double value) {+ public <T extends ElectricityChargerAsset> T setPower(Double value) {getAttributes().getOrCreate(POWER_TOTAL).setValue(value);return (T)this;}@@ -134,31 +129,4 @@ public class ElectricityChargerAsset extends Asset<ElectricityChargerAsset> {getAttributes().getOrCreate(POWER_SETPOINT).setValue(value);return (T)this;}-- public Optional<Double> getTariffImport() {- return getAttributes().getValue(TARIFF_IMPORT);- }-- public <T extends ElectricityChargerAsset> T setTariffImport(Double value) {- getAttributes().getOrCreate(TARIFF_IMPORT).setValue(value);- return (T)this;- }-- public Optional<Double> getTariffExport() {- return getAttributes().getValue(TARIFF_EXPORT);- }-- public <T extends ElectricityChargerAsset> T setTariffExport(Double value) {- getAttributes().getOrCreate(TARIFF_EXPORT).setValue(value);- return (T)this;- }-- public Optional<Double> getTariffStart() {- return getAttributes().getValue(TARIFF_START);- }-- public <T extends ElectricityChargerAsset> T setTariffStart(Double value) {- getAttributes().getOrCreate(TARIFF_START).setValue(value);- return (T)this;- }}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 19486707f..a5408ffe6 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@@ -36,33 +36,10 @@ import static org.openremote.model.Constants.*;@Entitypublic class ElectricityConsumerAsset extends Asset<ElectricityConsumerAsset> {- public enum DemandResponseType {- NONE,- FORECAST,- SETPOINT- }-- public static final ValueDescriptor<DemandResponseType> DEMAND_RESPONSE_TYPE_VALUE = new ValueDescriptor<>("demandResponseType", DemandResponseType.class);-public static final AttributeDescriptor<String> STATUS = new AttributeDescriptor<>("status", ValueType.TEXT,new MetaItem<>(MetaItemType.READ_ONLY));- public static final AttributeDescriptor<DemandResponseType> DEMAND_RESPONSE_TYPE = new AttributeDescriptor<>("demandResponseType", DEMAND_RESPONSE_TYPE_VALUE);- public static final AttributeDescriptor<Double> TARIFF_IMPORT = new AttributeDescriptor<>("tariffImport", ValueType.NUMBER)- .withUnits("EUR", UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Double> TARIFF_EXPORT = new AttributeDescriptor<>("tariffExport", ValueType.NUMBER)- .withUnits("EUR", UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Integer> CARBON_IMPORT = new AttributeDescriptor<>("carbonTariffImport", ValueType.POSITIVE_INTEGER)- .withUnits(UNITS_KILO, UNITS_GRAM, UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Integer> CARBON_EXPORT = new AttributeDescriptor<>("carbonTariffExport", ValueType.POSITIVE_INTEGER)- .withUnits(UNITS_KILO, UNITS_GRAM, UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("powerTotal", ValueType.POSITIVE_NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)- ).withUnits(UNITS_KILO, UNITS_WATT);- public static final AttributeDescriptor<Double> POWER_FORECAST_DEVIATION = new AttributeDescriptor<>("powerForecastDeviation", ValueType.NUMBER,- new MetaItem<>(MetaItemType.READ_ONLY)- ).withUnits(UNITS_KILO, UNITS_WATT);- public static final AttributeDescriptor<Double> POWER_SETPOINT = new AttributeDescriptor<>("powerSetpoint", ValueType.NUMBER,+ public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("power", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> POWER_AVAILABLE_MAX = new AttributeDescriptor<>("powerAvailableMax", ValueType.POSITIVE_NUMBER,@@ -97,78 +74,15 @@ public class ElectricityConsumerAsset extends Asset<ElectricityConsumerAsset> {return (T)this;}- public Optional<DemandResponseType> getDemandResponseType() {- return getAttributes().getValue(DEMAND_RESPONSE_TYPE);- }-- public <T extends ElectricityConsumerAsset> T setDemandResponseType(DemandResponseType value) {- getAttributes().getOrCreate(DEMAND_RESPONSE_TYPE).setValue(value);- return (T)this;- }-- public Optional<Double> getTariffImport() {- return getAttributes().getValue(TARIFF_IMPORT);- }-- public <T extends ElectricityConsumerAsset> T setTariffImport(Double value) {- getAttributes().getOrCreate(TARIFF_IMPORT).setValue(value);- return (T)this;- }-- public Optional<Double> getTariffExport() {- return getAttributes().getValue(TARIFF_EXPORT);- }-- public <T extends ElectricityConsumerAsset> T setTariffExport(Double value) {- getAttributes().getOrCreate(TARIFF_EXPORT).setValue(value);- return (T)this;- }-- public Optional<Integer> getCarbonImport() {- return getAttributes().getValue(CARBON_IMPORT);- }-- public <T extends ElectricityConsumerAsset> T setCarbonImport(Integer value) {- getAttributes().getOrCreate(CARBON_IMPORT).setValue(value);- return (T)this;- }-- public Optional<Integer> getCarbonExport() {- return getAttributes().getValue(CARBON_EXPORT);- }-- public <T extends ElectricityConsumerAsset> T setCarbonExport(Integer value) {- getAttributes().getOrCreate(CARBON_EXPORT).setValue(value);- return (T)this;- }-- public Optional<Double> getPowerTotal() {+ public Optional<Double> getPower() {return getAttributes().getValue(POWER_TOTAL);}- public <T extends ElectricityConsumerAsset> T setPowerTotal(Double value) {+ public <T extends ElectricityConsumerAsset> T setPower(Double value) {getAttributes().getOrCreate(POWER_TOTAL).setValue(value);return (T)this;}- public Optional<Double> getPowerForecastDeviation() {- return getAttributes().getValue(POWER_FORECAST_DEVIATION);- }-- public <T extends ElectricityConsumerAsset> T setPowerForecastDeviation(Double value) {- getAttributes().getOrCreate(POWER_FORECAST_DEVIATION).setValue(value);- return (T)this;- }-- public Optional<Double> getPowerSetpoint() {- return getAttributes().getValue(POWER_SETPOINT);- }-- public <T extends ElectricityConsumerAsset> T setPowerSetpoint(Double value) {- getAttributes().getOrCreate(POWER_SETPOINT).setValue(value);- return (T)this;- }-public Optional<Double> getPowerAvailableMax() {return getAttributes().getValue(POWER_AVAILABLE_MAX);}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 e0f5af26d..6396bd33c 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@@ -39,7 +39,7 @@ public class ElectricityProducerAsset extends Asset<ElectricityProducerAsset> {.withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Integer> EFFICIENCY = new AttributeDescriptor<>("efficiency", ValueType.POSITIVE_INTEGER).withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100));- public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("powerTotal", ValueType.POSITIVE_NUMBER,+ public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("power", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> POWER_FORECAST_DEVIATION = new AttributeDescriptor<>("powerForecastDeviation", ValueType.NUMBER,@@ -71,11 +71,11 @@ public class ElectricityProducerAsset extends Asset<ElectricityProducerAsset> {return this;}- public Optional<Double> getPowerTotal() {+ public Optional<Double> getPower() {return getAttributes().getValue(POWER_TOTAL);}- public ElectricityProducerAsset setPowerTotal(Double value) {+ public ElectricityProducerAsset setPower(Double value) {getAttributes().getOrCreate(POWER_TOTAL).setValue(value);return this;}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 95c810b6e..25f5403af 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@@ -19,12 +19,17 @@*/package org.openremote.model.asset.impl;+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.geo.GeoJSONPoint;import org.openremote.model.value.AttributeDescriptor;import org.openremote.model.value.ValueDescriptor;import org.openremote.model.value.ValueType;import javax.persistence.Entity;+import java.util.Collection;import java.util.Optional;import static org.openremote.model.Constants.UNITS_DEGREE;@@ -63,7 +68,7 @@ public class ElectricityProducerSolarAsset extends ElectricityProducerAsset {return this;}- public ElectricityProducerSolarAsset setPowerTotal(Double value) {+ public ElectricityProducerSolarAsset setPower(Double value) {getAttributes().getOrCreate(POWER_TOTAL).setValue(value);return this;}@@ -114,4 +119,106 @@ public class ElectricityProducerSolarAsset extends ElectricityProducerAsset {getAttributes().getOrCreate(PANEL_PITCH).setValue(value);return this;}++ @Override+ public ElectricityProducerSolarAsset setId(String id) {+ super.setId(id);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setName(String name) throws IllegalArgumentException {+ super.setName(name);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setAccessPublicRead(boolean accessPublicRead) {+ super.setAccessPublicRead(accessPublicRead);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setParent(Asset<?> parent) {+ super.setParent(parent);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setParentId(String parentId) {+ super.setParentId(parentId);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setRealm(String realm) {+ super.setRealm(realm);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setAttributes(AttributeMap attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public Asset<?> setAttributes(Attribute<?>... attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setAttributes(Collection<Attribute<?>> attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset addAttributes(Attribute<?>... attributes) {+ super.addAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset addOrReplaceAttributes(Attribute<?>... attributes) {+ super.addOrReplaceAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setLocation(GeoJSONPoint location) {+ super.setLocation(location);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setTags(String[] tags) {+ super.setTags(tags);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setEmail(String email) {+ super.setEmail(email);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setNotes(String notes) {+ super.setNotes(notes);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setManufacturer(String manufacturer) {+ super.setManufacturer(manufacturer);+ return this;+ }++ @Override+ public ElectricityProducerSolarAsset setModel(String model) {+ super.setModel(model);+ return this;+ }}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 c2412a01d..a958d3f90 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@@ -19,9 +19,14 @@*/package org.openremote.model.asset.impl;+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.geo.GeoJSONPoint;import javax.persistence.Entity;+import java.util.Collection;@Entitypublic class ElectricityProducerWindAsset extends ElectricityProducerAsset {@@ -34,4 +39,107 @@ public class ElectricityProducerWindAsset extends ElectricityProducerAsset {public ElectricityProducerWindAsset(String name) {super(name);}+++ @Override+ public ElectricityProducerWindAsset setId(String id) {+ super.setId(id);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setName(String name) throws IllegalArgumentException {+ super.setName(name);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setAccessPublicRead(boolean accessPublicRead) {+ super.setAccessPublicRead(accessPublicRead);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setParent(Asset<?> parent) {+ super.setParent(parent);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setParentId(String parentId) {+ super.setParentId(parentId);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setRealm(String realm) {+ super.setRealm(realm);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setAttributes(AttributeMap attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public Asset<?> setAttributes(Attribute<?>... attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setAttributes(Collection<Attribute<?>> attributes) {+ super.setAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset addAttributes(Attribute<?>... attributes) {+ super.addAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset addOrReplaceAttributes(Attribute<?>... attributes) {+ super.addOrReplaceAttributes(attributes);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setLocation(GeoJSONPoint location) {+ super.setLocation(location);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setTags(String[] tags) {+ super.setTags(tags);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setEmail(String email) {+ super.setEmail(email);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setNotes(String notes) {+ super.setNotes(notes);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setManufacturer(String manufacturer) {+ super.setManufacturer(manufacturer);+ return this;+ }++ @Override+ public ElectricityProducerWindAsset setModel(String model) {+ super.setModel(model);+ return this;+ }}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 3c990904a..05987d538 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@@ -62,18 +62,14 @@ public class ElectricityStorageAsset extends Asset<ElectricityStorageAsset> {.withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> POWER_CAPACITY_EXPORT = new AttributeDescriptor<>("powerCapacityExport", ValueType.POSITIVE_NUMBER).withUnits(UNITS_KILO, UNITS_WATT);- public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("powerTotal", ValueType.POSITIVE_NUMBER,+ public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("power", ValueType.NUMBER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_KILO, UNITS_WATT);- public static final AttributeDescriptor<Double> POWER_SETPOINT = new AttributeDescriptor<>("powerSetpoint", ValueType.POSITIVE_NUMBER)+ public static final AttributeDescriptor<Double> POWER_SETPOINT = new AttributeDescriptor<>("powerSetpoint", ValueType.NUMBER).withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Integer> CHARGE_CYCLES = new AttributeDescriptor<>("chargeCycles", ValueType.POSITIVE_INTEGER,new MetaItem<>(MetaItemType.READ_ONLY));- 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,- new MetaItem<>(MetaItemType.READ_ONLY)- ).withUnits(UNITS_KILO, UNITS_GRAM);public static final AssetDescriptor<ElectricityStorageAsset> DESCRIPTOR = new AssetDescriptor<>("battery-charging", "1B7C89", ElectricityStorageAsset.class);@@ -132,7 +128,7 @@ public class ElectricityStorageAsset extends Asset<ElectricityStorageAsset> {return getAttributes().getValue(POWER_CAPACITY_EXPORT);}- public Optional<Double> getPowerTotal() {+ public Optional<Double> getPower() {return getAttributes().getValue(POWER_TOTAL);}@@ -143,12 +139,4 @@ public class ElectricityStorageAsset extends Asset<ElectricityStorageAsset> {public Optional<Integer> getChargeCycles() {return getAttributes().getValue(CHARGE_CYCLES);}-- public Optional<Double> getFinancialWallet() {- return getAttributes().getValue(FINANCIAL_WALLET);- }-- public Optional<Integer> getCarbonWallet() {- return getAttributes().getValue(CARBON_WALLET);- }}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 e5f274bd2..7d9e32a62 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@@ -45,14 +45,15 @@ public class ElectricitySupplierAsset extends Asset<ElectricitySupplierAsset> {.withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Integer> POWER_EDR_MIN_PERIOD = new AttributeDescriptor<>("powerEDRMinPeriod", ValueType.POSITIVE_INTEGER).withUnits(UNITS_SECOND);- public static final AttributeDescriptor<Double> TARIFF_IMPORT = new AttributeDescriptor<>("energyTariffImport", ValueType.POSITIVE_NUMBER)+ public static final AttributeDescriptor<Double> TARIFF_IMPORT = new AttributeDescriptor<>("tariffImport", ValueType.POSITIVE_NUMBER).withUnits("EUR", UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Double> TARIFF_EXPORT = new AttributeDescriptor<>("energyTariffExport", ValueType.POSITIVE_NUMBER)+ public static final AttributeDescriptor<Double> TARIFF_EXPORT = new AttributeDescriptor<>("tariffExport", ValueType.POSITIVE_NUMBER).withUnits("EUR", UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);- public static final AttributeDescriptor<Double> ENERGY_TARIFF_IMPORT_FORECAST_DEVIATION = new AttributeDescriptor<>("energyTariffImportForecastDeviation", ValueType.POSITIVE_NUMBER,++ public static final AttributeDescriptor<Double> ENERGY_TARIFF_IMPORT_FORECAST_DEVIATION = new AttributeDescriptor<>("tariffImportForecastDeviation", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY));- public static final AttributeDescriptor<Double> ENERGY_TARIFF_EXPORT_FORECAST_DEVIATION = new AttributeDescriptor<>("energyTariffExportForecastDeviation", ValueType.POSITIVE_NUMBER,+ public static final AttributeDescriptor<Double> ENERGY_TARIFF_EXPORT_FORECAST_DEVIATION = new AttributeDescriptor<>("tariffExportForecastDeviation", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY));public static final AttributeDescriptor<Double> ENERGY_TAX = new AttributeDescriptor<>("energyTax", ValueType.POSITIVE_NUMBER)@@ -65,7 +66,7 @@ public class ElectricitySupplierAsset extends Asset<ElectricitySupplierAsset> {.withUnits(UNITS_KILO, UNITS_GRAM, UNITS_PER, UNITS_KILO, UNITS_WATT, UNITS_HOUR);public 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<Double> POWER_TOTAL = new AttributeDescriptor<>("powerTotal", ValueType.POSITIVE_NUMBER,+ public static final AttributeDescriptor<Double> POWER_TOTAL = new AttributeDescriptor<>("power", ValueType.POSITIVE_NUMBER,new MetaItem<>(MetaItemType.READ_ONLY, true)).withUnits(UNITS_KILO, UNITS_WATT);public static final AttributeDescriptor<Double> POWER_FORECAST_DEVIATION = new AttributeDescriptor<>("powerForecastDeviation", ValueType.NUMBER,@@ -86,6 +87,10 @@ public class ElectricitySupplierAsset extends Asset<ElectricitySupplierAsset> {public static final AttributeDescriptor<Integer> CARBON_TOTAL = new AttributeDescriptor<>("carbonTotal", ValueType.POSITIVE_INTEGER,new MetaItem<>(MetaItemType.READ_ONLY, true)).withUnits(UNITS_KILO, UNITS_GRAM);+ 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,+ new MetaItem<>(MetaItemType.READ_ONLY)+ ).withUnits(UNITS_KILO, UNITS_GRAM);public static final AssetDescriptor<ElectricitySupplierAsset> DESCRIPTOR = new AssetDescriptor<>("upload-network", "9257A9", ElectricitySupplierAsset.class);@@ -156,7 +161,7 @@ public class ElectricitySupplierAsset extends Asset<ElectricitySupplierAsset> {return getAttributes().getValue(CARBON_EXPORT);}- public Optional<Double> getPowerTotal() {+ public Optional<Double> getPower() {return getAttributes().getValue(POWER_TOTAL);}diff --git a/model/src/main/java/org/openremote/model/asset/impl/GroupAsset.java b/model/src/main/java/org/openremote/model/asset/impl/GroupAsset.javaindex 919e9a908..b50923fcc 100644--- a/model/src/main/java/org/openremote/model/asset/impl/GroupAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/GroupAsset.java@@ -36,7 +36,6 @@ import java.util.Optional;public class GroupAsset extends Asset<GroupAsset> {public static final AttributeDescriptor<String> CHILD_ASSET_TYPE = new AttributeDescriptor<>("childAssetType", ValueType.TEXT);- public static final String t = GroupAsset.class.getSimpleName();public static final AssetDescriptor<GroupAsset> DESCRIPTOR = new AssetDescriptor<>("folder", "B3B3B3", GroupAsset.class);/**