Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Updated stuff for demo purposes

Michael Rademaker7924f21b300b
diff --git a/manager/src/main/java/org/openremote/manager/setup/AbstractManagerSetup.java b/manager/src/main/java/org/openremote/manager/setup/AbstractManagerSetup.java
index 9e18f4dce..23c0b6719 100644
--- a/manager/src/main/java/org/openremote/manager/setup/AbstractManagerSetup.java
+++ b/manager/src/main/java/org/openremote/manager/setup/AbstractManagerSetup.java
@@ -509,86 +509,60 @@ public abstract class AbstractManagerSetup implements Setup {
);
}
- protected Asset createDemoCameraAsset(String name, Asset area, GeoJSON location, Supplier<MetaItem[]> agentLinker) {
- Asset cameraAsset = new Asset(name, CAMERA, area);
- cameraAsset.addAttributes(
+ protected Asset createDemoPeopleCounterAsset(String name, Asset area, GeoJSON location, Supplier<MetaItem[]> agentLinker) {
+ Asset peopleCounterAsset = new Asset(name, PEOPLE_COUNTER, area);
+ peopleCounterAsset.setAttributes(
new AssetAttribute(AttributeType.LOCATION, location.toValue()),
- new AssetAttribute("cameraCountIn", NUMBER)
+ new AssetAttribute("peopleCountIn", NUMBER)
.setMeta(
- new MetaItem(LABEL, Values.create("Camera Count In")),
+ new MetaItem(LABEL, Values.create("People Count In")),
new MetaItem(DESCRIPTION, Values.create("Cumulative number of people going into area")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("cameraCountOut", NUMBER)
+ new AssetAttribute("peopleCountOut", NUMBER)
.setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Out")),
+ new MetaItem(LABEL, Values.create("People Count Out")),
new MetaItem(DESCRIPTION, Values.create("Cumulative number of people leaving area")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("cameraCountInMinute", NUMBER)
+ new AssetAttribute("peopleCountInMinute", NUMBER)
.setMeta(
- new MetaItem(LABEL, Values.create("Camera Count In Minute")),
+ new MetaItem(LABEL, Values.create("People Count In Minute")),
new MetaItem(DESCRIPTION, Values.create("Number of people going into area per minute")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("cameraCountOutMinute", NUMBER)
+ new AssetAttribute("peopleCountOutMinute", NUMBER)
.setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Out Minute")),
+ new MetaItem(LABEL, Values.create("People Count Out Minute")),
new MetaItem(DESCRIPTION, Values.create("Number of people leaving area per minute")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("cameraCountTotal", NUMBER)
+ new AssetAttribute("peopleCountTotal", NUMBER)
.setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Total")),
+ new MetaItem(LABEL, Values.create("People Count Total")),
new MetaItem(DESCRIPTION, Values.create("cameraCountIn - cameraCountOut")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
),
- new AssetAttribute("cameraCountGrowth", NUMBER)
+ new AssetAttribute("peopleCountGrowth", NUMBER)
.setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Growth")),
+ new MetaItem(LABEL, Values.create("People Count Growth")),
new MetaItem(DESCRIPTION, Values.create("cameraCountIn - cameraCountOut")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
- ),
- new AssetAttribute("cameraCountTotalAlertLevel", NUMBER, Values.create(100))
- .setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Total Alert Level")),
- new MetaItem(DESCRIPTION, Values.create("When Camera Count Total equals or passes this value, an alert will be sent")),
- new MetaItem(RULE_STATE, Values.create(true))
- ),
- new AssetAttribute("cameraCountTotalAlert", BOOLEAN)
- .setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Total Alert")),
- new MetaItem(DESCRIPTION, Values.create("True when alert rule is triggered")),
- new MetaItem(READ_ONLY, Values.create(true)),
- new MetaItem(RULE_STATE, Values.create(true))
- ),
- new AssetAttribute("cameraCountGrowthAlertLevel", NUMBER, Values.create(200))
- .setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Growth Alert Level")),
- new MetaItem(DESCRIPTION, Values.create("When Camera Count Growth equals or passes this value, an alert will be sent")),
- new MetaItem(RULE_STATE, Values.create(true))
- ),
- new AssetAttribute("cameraCountGrowthAlert", BOOLEAN)
- .setMeta(
- new MetaItem(LABEL, Values.create("Camera Count Growth Alert")),
- new MetaItem(DESCRIPTION, Values.create("True when alert rule is triggered")),
- new MetaItem(READ_ONLY, Values.create(true)),
- new MetaItem(RULE_STATE, Values.create(true))
)
);
- return cameraAsset;
+ return peopleCounterAsset;
}
protected Asset createDemoMicrophoneAsset(String name, Asset area, GeoJSON location, Supplier<MetaItem[]> agentLinker) {
Asset microphoneAsset = new Asset(name, MICROPHONE, area);
- microphoneAsset.addAttributes(
+ microphoneAsset.setAttributes(
new AssetAttribute(AttributeType.LOCATION, location.toValue()),
new AssetAttribute("microphoneLevel", SOUND_DB)
.setMeta(
@@ -596,55 +570,56 @@ public abstract class AbstractManagerSetup implements Setup {
new MetaItem(DESCRIPTION, Values.create("dB")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
- ).addMeta(agentLinker.get()),
- new AssetAttribute("microphoneLevelAlertLevel", SOUND_DB, Values.create(80))
- .setMeta(
- new MetaItem(LABEL, Values.create("Microphone Level Alert Level")),
- new MetaItem(DESCRIPTION, Values.create("Level of dB when alert will be send")),
- new MetaItem(RULE_STATE, Values.create(true))
- ),
- new AssetAttribute("microphoneLevelAlert", BOOLEAN)
+ ).addMeta(agentLinker.get())
+ );
+ return microphoneAsset;
+ }
+
+ protected Asset createDemoSoundEventAsset(String name, Asset area, GeoJSON location, Supplier<MetaItem[]> agentLinker) {
+ Asset soundEventAsset = new Asset(name, SOUND_EVENT, area);
+ soundEventAsset.setAttributes(
+ new AssetAttribute("lastAgression", OBJECT)
.setMeta(
- new MetaItem(LABEL, Values.create("Microphone Level Alert")),
- new MetaItem(DESCRIPTION, Values.create("True when alert rule is triggered")),
+ new MetaItem(LABEL, Values.create("Last Aggression event")),
+ new MetaItem(DESCRIPTION, Values.create("Input from microphone")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
),
- new AssetAttribute("microphoneGlassAlert", BOOLEAN)
+ new AssetAttribute("lastGunshot", OBJECT)
.setMeta(
- new MetaItem(LABEL, Values.create("Microphone Glass Alert")),
+ new MetaItem(LABEL, Values.create("Last Gunshot event")),
new MetaItem(DESCRIPTION, Values.create("Input from microphone")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("microphoneGunshotAlert", BOOLEAN)
+ new AssetAttribute("lastBreakingGlass", OBJECT)
.setMeta(
- new MetaItem(LABEL, Values.create("Microphone Gunshot Alert")),
+ new MetaItem(LABEL, Values.create("Last Breaking Glass event")),
new MetaItem(DESCRIPTION, Values.create("Input from microphone")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("microphoneScreamAlert", BOOLEAN)
+ new AssetAttribute("lastIntensity", OBJECT)
.setMeta(
- new MetaItem(LABEL, Values.create("Microphone Scream Alert")),
+ new MetaItem(LABEL, Values.create("Last Intensity event")),
new MetaItem(DESCRIPTION, Values.create("Input from microphone")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("microphoneSoundTypeAlert", BOOLEAN)
+ new AssetAttribute("lastEvent", OBJECT)
.setMeta(
- new MetaItem(LABEL, Values.create("Microphone Sound Type Alert")),
- new MetaItem(DESCRIPTION, Values.create("True when alert rule is triggered")),
+ new MetaItem(LABEL, Values.create("Last event")),
+ new MetaItem(DESCRIPTION, Values.create("Input from microphone")),
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
)
);
- return microphoneAsset;
+ return soundEventAsset;
}
- protected Asset createDemoEnviromentAsset(String name, Asset area, GeoJSON location, Supplier<MetaItem[]> agentLinker) {
- Asset enviromentAsset = new Asset(name, ENVIRONMENT_SENSOR, area);
- enviromentAsset.addAttributes(
+ protected Asset createDemoEnvironmentAsset(String name, Asset area, GeoJSON location, Supplier<MetaItem[]> agentLinker) {
+ Asset environmentAsset = new Asset(name, ENVIRONMENT_SENSOR, area);
+ environmentAsset.setAttributes(
new AssetAttribute(AttributeType.LOCATION, location.toValue()),
new AssetAttribute("temperature", TEMPERATURE_CELCIUS)
.setMeta(
@@ -674,19 +649,6 @@ public abstract class AbstractManagerSetup implements Setup {
new MetaItem(READ_ONLY, Values.create(true)),
new MetaItem(RULE_STATE, Values.create(true))
).addMeta(agentLinker.get()),
- new AssetAttribute("ozonAlertLevel", NUMBER, Values.create(300))
- .setMeta(
- new MetaItem(LABEL, Values.create("Ozon Alert Level")),
- new MetaItem(DESCRIPTION, Values.create("µg/m3")),
- new MetaItem(RULE_STATE, Values.create(true))
- ),
- new AssetAttribute("ozonAlert", BOOLEAN)
- .setMeta(
- new MetaItem(LABEL, Values.create("Ozon Alert")),
- new MetaItem(DESCRIPTION, Values.create("True when alert rule is triggered")),
- new MetaItem(READ_ONLY, Values.create(true)),
- new MetaItem(RULE_STATE, Values.create(true))
- ),
new AssetAttribute("particlesPM1", NUMBER)
.setMeta(
new MetaItem(LABEL, Values.create("Particles PM 1")),
@@ -710,12 +672,12 @@ public abstract class AbstractManagerSetup implements Setup {
).addMeta(agentLinker.get())
);
- return enviromentAsset;
+ return environmentAsset;
}
protected Asset createDemoLightAsset(String name, Asset area, GeoJSON location) {
Asset lightAsset = new Asset(name, LIGHT, area);
- lightAsset.addAttributes(
+ lightAsset.setAttributes(
new AssetAttribute(AttributeType.LOCATION, location.toValue()),
new AssetAttribute("lightStatus", BOOLEAN)
.setMeta(
@@ -729,10 +691,10 @@ public abstract class AbstractManagerSetup implements Setup {
new MetaItem(DESCRIPTION, Values.create("The level of dimming of the light")),
new MetaItem(RULE_STATE, Values.create(true))
),
- new AssetAttribute("colorRGB", COLOR_RGB)
+ new AssetAttribute("colorRGBW", OBJECT)
.setMeta(
- new MetaItem(LABEL, Values.create("Color RGB")),
- new MetaItem(DESCRIPTION, Values.create("The RGB color of the light")),
+ new MetaItem(LABEL, Values.create("Color RGBW")),
+ new MetaItem(DESCRIPTION, Values.create("The RGBW color of the light")),
new MetaItem(RULE_STATE, Values.create(true))
),
new AssetAttribute("groupNumber", NUMBER)
@@ -741,10 +703,43 @@ public abstract class AbstractManagerSetup implements Setup {
new MetaItem(DESCRIPTION, Values.create("Which group this lights belongs to")),
new MetaItem(RULE_STATE, Values.create(true))
),
- new AssetAttribute("scene", STRING)
+ new AssetAttribute("scenario", STRING)
+ .setMeta(
+ new MetaItem(LABEL, Values.create("Scenario")),
+ new MetaItem(DESCRIPTION, Values.create("The scenario this light is setup to")),
+ new MetaItem(RULE_STATE, Values.create(true))
+ )
+ );
+
+ return lightAsset;
+ }
+
+ protected Asset createDemoLightControllerAsset(String name, Asset area, GeoJSON location) {
+ Asset lightAsset = new Asset(name, LIGHT_CONTROLLER, area);
+ lightAsset.setAttributes(
+ new AssetAttribute(AttributeType.LOCATION, location.toValue()),
+ new AssetAttribute("lightAllStatus", BOOLEAN)
+ .setMeta(
+ new MetaItem(LABEL, Values.create("Light Status")),
+ new MetaItem(DESCRIPTION, Values.create("On or off")),
+ new MetaItem(RULE_STATE, Values.create(true))
+ ),
+ new AssetAttribute("lightAllDimLevel", PERCENTAGE)
+ .setMeta(
+ new MetaItem(LABEL, Values.create("Light Dim Level")),
+ new MetaItem(DESCRIPTION, Values.create("The level of dimming of all the lights")),
+ new MetaItem(RULE_STATE, Values.create(true))
+ ),
+ new AssetAttribute("colorAllRGBW", OBJECT)
+ .setMeta(
+ new MetaItem(LABEL, Values.create("Color RGBW")),
+ new MetaItem(DESCRIPTION, Values.create("The RGBW color of all the lights")),
+ new MetaItem(RULE_STATE, Values.create(true))
+ ),
+ new AssetAttribute("scenario", STRING)
.setMeta(
- new MetaItem(LABEL, Values.create("Scene")),
- new MetaItem(DESCRIPTION, Values.create("The scene this light is setup to")),
+ new MetaItem(LABEL, Values.create("Scenario")),
+ new MetaItem(DESCRIPTION, Values.create("The scenario the lights are setup to")),
new MetaItem(RULE_STATE, Values.create(true))
)
);
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.java
index 4cb03fb19..b6054b15f 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
@@ -69,9 +69,9 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
public static GeoJSONPoint SMART_OFFICE_LOCATION = new GeoJSONPoint(5.460315214821094, 51.44541688237109);
public static GeoJSONPoint SMART_BUILDING_LOCATION = new GeoJSONPoint(5.454027, 51.446308);
public static GeoJSONPoint SMART_CITY_LOCATION = new GeoJSONPoint(5.3814711, 51.4484647);
- public static GeoJSONPoint AREA_1_LOCATION = new GeoJSONPoint(5.4760743, 51.4392638);
- public static GeoJSONPoint AREA_2_LOCATION = new GeoJSONPoint(5.4719061, 51.4385647);
- public static GeoJSONPoint AREA_3_LOCATION = new GeoJSONPoint(5.4533245, 51.4467305);
+ public static GeoJSONPoint AREA_1_LOCATION = new GeoJSONPoint(5.478478, 51.439272);
+ public static GeoJSONPoint AREA_2_LOCATION = new GeoJSONPoint(5.473829, 51.438744);
+ public static GeoJSONPoint AREA_3_LOCATION = new GeoJSONPoint(5.487478, 51.446979);
public static final String agentProtocolConfigName = "simulator123";
public static final String thingLightToggleAttributeName = "light1Toggle";
final protected boolean importDemoScenes;
@@ -401,7 +401,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
/* ############################ ROOMS ############################## */
- Asset apartment1Livingroom = createDemoApartmentRoom(apartment1, "Living Room")
+ Asset apartment1Livingroom = createDemoApartmentRoom(apartment1, "Living Room 1")
.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454213, 51.446884).toValue()),
new AssetAttribute("lightsCeiling", NUMBER, Values.create(0))
@@ -444,7 +444,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment1Livingroom = assetStorageService.merge(apartment1Livingroom);
apartment1LivingroomId = apartment1Livingroom.getId();
- Asset apartment1Kitchen = createDemoApartmentRoom(apartment1, "Kitchen")
+ Asset apartment1Kitchen = createDemoApartmentRoom(apartment1, "Kitchen 1")
.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454122, 51.446800).toValue()),
new AssetAttribute("lights", AttributeValueType.BOOLEAN, Values.create(true))
@@ -491,7 +491,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment1Kitchen = assetStorageService.merge(apartment1Kitchen);
apartment1KitchenId = apartment1Kitchen.getId();
- Asset apartment1Hallway = createDemoApartmentRoom(apartment1, "Hallway")
+ Asset apartment1Hallway = createDemoApartmentRoom(apartment1, "Hallway 1")
.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454342, 51.446762).toValue()),
new AssetAttribute("lights", AttributeValueType.BOOLEAN, Values.create(true))
@@ -506,7 +506,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment1Hallway = assetStorageService.merge(apartment1Hallway);
apartment1HallwayId = apartment1Hallway.getId();
- Asset apartment1Bedroom1 = createDemoApartmentRoom(apartment1, "Bedroom")
+ Asset apartment1Bedroom1 = createDemoApartmentRoom(apartment1, "Bedroom 1")
.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454332, 51.446830).toValue()),
new AssetAttribute("lights", AttributeValueType.BOOLEAN, Values.create(true))
@@ -533,7 +533,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment1Bedroom1 = assetStorageService.merge(apartment1Bedroom1);
apartment1Bedroom1Id = apartment1Bedroom1.getId();
- Asset apartment1Bathroom = new Asset("Bathroom", ROOM, apartment1);
+ Asset apartment1Bathroom = new Asset("Bathroom 1", ROOM, apartment1);
apartment1Bathroom.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454227,51.446753).toValue()),
new AssetAttribute("lights", AttributeValueType.BOOLEAN, Values.create(true))
@@ -595,7 +595,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment2 = assetStorageService.merge(apartment2);
apartment2Id = apartment2.getId();
- Asset apartment2Livingroom = new Asset("Living Room", ROOM, apartment2);
+ Asset apartment2Livingroom = new Asset("Living Room 2", ROOM, apartment2);
apartment2Livingroom.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454109, 51.446631).toValue()),
new AssetAttribute("motionSensor", AttributeValueType.BOOLEAN, Values.create(false))
@@ -651,7 +651,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment2Livingroom = assetStorageService.merge(apartment2Livingroom);
apartment2LivingroomId = apartment2Livingroom.getId();
- Asset apartment2Bathroom = new Asset("Bathroom", ROOM, apartment2);
+ Asset apartment2Bathroom = new Asset("Bathroom 2", ROOM, apartment2);
apartment2Bathroom.addAttributes(
new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.454015, 51.446665).toValue()),
new AssetAttribute("motionSensor", AttributeValueType.BOOLEAN, Values.create(false))
@@ -693,7 +693,7 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
apartment3 = assetStorageService.merge(apartment3);
apartment3Id = apartment3.getId();
- Asset apartment3Livingroom = new Asset("Living Room", ROOM, apartment3)
+ Asset apartment3Livingroom = new Asset("Living Room 3", ROOM, apartment3)
.addAttributes(new AssetAttribute(AttributeType.LOCATION, new GeoJSONPoint(5.453932, 51.446422).toValue()));
apartment3Livingroom.addAttributes(
new AssetAttribute("lightSwitch", AttributeValueType.BOOLEAN)
@@ -790,27 +790,30 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
);
assetArea1 = assetStorageService.merge(assetArea1);
- Asset camera1Asset = createDemoCameraAsset("Camera1", assetArea1, new GeoJSONPoint(5.477126, 51.439137), () -> new MetaItem[]{
+ Asset peopleCounter1Asset = createDemoPeopleCounterAsset("PeopleCounter 1", assetArea1, new GeoJSONPoint(5.477126, 51.439137), () -> new MetaItem[]{
new MetaItem(AGENT_LINK, new AttributeRef(smartCityServiceAgentId, "citySimulator").toArrayValue()),
new MetaItem(SimulatorProtocol.SIMULATOR_ELEMENT, Values.create(NumberSimulatorElement.ELEMENT_NAME))
});
- camera1Asset = assetStorageService.merge(camera1Asset);
+ peopleCounter1Asset = assetStorageService.merge(peopleCounter1Asset);
- Asset microPhone1Asset = createDemoMicrophoneAsset("Microphone1", assetArea1, new GeoJSONPoint(5.478092, 51.438655), () -> new MetaItem[]{
+ Asset microPhone1Asset = createDemoMicrophoneAsset("Microphone 1", assetArea1, new GeoJSONPoint(5.478092, 51.438655), () -> new MetaItem[]{
new MetaItem(AGENT_LINK, new AttributeRef(smartCityServiceAgentId, "citySimulator").toArrayValue()),
new MetaItem(SimulatorProtocol.SIMULATOR_ELEMENT, Values.create(NumberSimulatorElement.ELEMENT_NAME))
});
microPhone1Asset = assetStorageService.merge(microPhone1Asset);
- Asset enviroment1Asset = createDemoEnviromentAsset("Enviroment1", assetArea1, new GeoJSONPoint(5.478907, 51.438943),() -> new MetaItem[]{
+ Asset enviroment1Asset = createDemoEnvironmentAsset("Environment 1", assetArea1, new GeoJSONPoint(5.478907, 51.438943),() -> new MetaItem[]{
new MetaItem(AGENT_LINK, new AttributeRef(smartCityServiceAgentId, "citySimulator").toArrayValue()),
new MetaItem(SimulatorProtocol.SIMULATOR_ELEMENT, Values.create(NumberSimulatorElement.ELEMENT_NAME))
});
enviroment1Asset = assetStorageService.merge(enviroment1Asset);
- Asset light1Asset = createDemoLightAsset("Light1", assetArea1, new GeoJSONPoint(5.477126, 51.439137));
+ Asset light1Asset = createDemoLightAsset("Light 1", assetArea1, new GeoJSONPoint(5.477126, 51.439137));
light1Asset = assetStorageService.merge(light1Asset);
+ Asset light2Asset = createDemoLightAsset("Light 2", assetArea1, new GeoJSONPoint(5.477126, 51.439137));
+ light2Asset = assetStorageService.merge(light2Asset);
+
// ################################ Realm B Area 2 ###################################
Asset assetArea2 = new Asset("Area 2", AREA, smartCity)
@@ -822,17 +825,17 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
);
assetArea2 = assetStorageService.merge(assetArea2);
- Asset camera2Asset = createDemoCameraAsset("Camera2", assetArea2, new GeoJSONPoint(5.473108, 51.438331), () -> new MetaItem[]{
+ Asset peopleCounter2Asset = createDemoPeopleCounterAsset("PeopleCounter 2", assetArea2, new GeoJSONPoint(5.473686, 51.438603), () -> new MetaItem[]{
new MetaItem(AGENT_LINK, new AttributeRef(smartCityServiceAgentId, "citySimulator").toArrayValue()),
new MetaItem(SimulatorProtocol.SIMULATOR_ELEMENT, Values.create(NumberSimulatorElement.ELEMENT_NAME))
});
- camera2Asset = assetStorageService.merge(camera2Asset);
+ peopleCounter2Asset = assetStorageService.merge(peopleCounter2Asset);
- Asset enviroment2Asset = createDemoEnviromentAsset("Enviroment2", assetArea2, new GeoJSONPoint(5.474277, 51.438698), () -> new MetaItem[]{
+ Asset environment2Asset = createDemoEnvironmentAsset("Environment 2", assetArea2, new GeoJSONPoint(5.473552, 51.438412), () -> new MetaItem[]{
new MetaItem(AGENT_LINK, new AttributeRef(smartCityServiceAgentId, "citySimulator").toArrayValue()),
new MetaItem(SimulatorProtocol.SIMULATOR_ELEMENT, Values.create(NumberSimulatorElement.ELEMENT_NAME))
});
- enviroment2Asset = assetStorageService.merge(enviroment2Asset);
+ environment2Asset = assetStorageService.merge(environment2Asset);
// ################################ Realm B Area 3 ###################################
@@ -846,18 +849,18 @@ public class ManagerDemoSetup extends AbstractManagerSetup {
);
assetArea3 = assetStorageService.merge(assetArea3);
- Asset camera3Asset = createDemoCameraAsset("Camera3", assetArea3, new GeoJSONPoint(5.455934, 51.447097), () -> new MetaItem[]{
+ Asset peopleCounter3Asset = createDemoPeopleCounterAsset("PeopleCounter 3", assetArea3, new GeoJSONPoint(5.487234, 51.447065), () -> new MetaItem[]{
new MetaItem(AGENT_LINK, new AttributeRef(smartCityServiceAgentId, "citySimulator").toArrayValue()),
new MetaItem(SimulatorProtocol.SIMULATOR_ELEMENT, Values.create(NumberSimulatorElement.ELEMENT_NAME))
});
- camera3Asset = assetStorageService.merge(camera3Asset);
+ peopleCounter3Asset = assetStorageService.merge(peopleCounter3Asset);
- AssetRuleset camera3Rules = new AssetRuleset(
- camera3Asset.getId(), "Camera3_Rules", GROOVY, IOUtils.toString(getClass().getResource("/demo/rules/DemoSmartCityCamera.groovy"), StandardCharsets.UTF_8)
+ AssetRuleset peopleCounter3Rules = new AssetRuleset(
+ peopleCounter3Asset.getId(), "PeopleCounter 3 Rules", GROOVY, IOUtils.toString(getClass().getResource("/demo/rules/DemoSmartCityCamera.groovy"), StandardCharsets.UTF_8)
);
- camera3Rules = rulesetStorageService.merge(camera3Rules);
+ peopleCounter3Rules = rulesetStorageService.merge(peopleCounter3Rules);
- Asset light3Asset = createDemoLightAsset("Light3", assetArea3, new GeoJSONPoint(5.454318, 51.447623));
- light3Asset = assetStorageService.merge(light3Asset);
+ Asset lightController_3Asset = createDemoLightControllerAsset("LightController_3", assetArea3, new GeoJSONPoint(5.487478, 51.446979));
+ lightController_3Asset = assetStorageService.merge(lightController_3Asset);
}
}
diff --git a/manager/src/main/java/org/openremote/manager/setup/builtin/RulesDemoSetup.java b/manager/src/main/java/org/openremote/manager/setup/builtin/RulesDemoSetup.java
index cf59f6469..76e3ca1dc 100644
--- a/manager/src/main/java/org/openremote/manager/setup/builtin/RulesDemoSetup.java
+++ b/manager/src/main/java/org/openremote/manager/setup/builtin/RulesDemoSetup.java
@@ -85,6 +85,7 @@ public class RulesDemoSetup extends AbstractManagerSetup {
Ruleset ruleset = new AssetRuleset(
managerDemoSetup.apartment1Id, "Demo Residence - Smart Start Switch", Ruleset.Lang.GROOVY, rules
);
+ ruleset.setEnabled(false);
apartmentActionsRulesetId = rulesetStorageService.merge(ruleset).getId();
}
diff --git a/model/src/main/java/org/openremote/model/asset/AssetType.java b/model/src/main/java/org/openremote/model/asset/AssetType.java
index 021f9f0c3..df89ca151 100644
--- a/model/src/main/java/org/openremote/model/asset/AssetType.java
+++ b/model/src/main/java/org/openremote/model/asset/AssetType.java
@@ -27,7 +27,7 @@ import java.util.Optional;
import static org.openremote.model.Constants.ASSET_NAMESPACE;
import static org.openremote.model.attribute.AttributeType.*;
-import static org.openremote.model.attribute.AttributeValueType.SOUND_DB;
+import static org.openremote.model.attribute.AttributeValueType.*;
import static org.openremote.model.attribute.MetaItemType.*;
/**
@@ -38,18 +38,18 @@ import static org.openremote.model.attribute.MetaItemType.*;
*/
public enum AssetType implements AssetDescriptor {
- BUILDING(ASSET_NAMESPACE + ":building", "office-building", null,
- SURFACE_AREA,
- GEO_STREET,
- GEO_CITY,
- GEO_COUNTRY,
- GEO_POSTAL_CODE),
+ BUILDING(ASSET_NAMESPACE + ":building", "office-building", "4b5966",
+ SURFACE_AREA,
+ GEO_STREET,
+ GEO_CITY,
+ GEO_COUNTRY,
+ GEO_POSTAL_CODE),
CITY(ASSET_NAMESPACE + ":city", "city", null,
GEO_CITY,
GEO_COUNTRY),
- AREA(ASSET_NAMESPACE + ":area", "home-city", null,
+ AREA(ASSET_NAMESPACE + ":area", "home-city", "095F6B",
GEO_CITY,
GEO_COUNTRY,
GEO_POSTAL_CODE),
@@ -64,17 +64,188 @@ public enum AssetType implements AssetDescriptor {
CONSOLE(ASSET_NAMESPACE + ":console", "monitor-cellphone", null),
- MICROPHONE(ASSET_NAMESPACE + ":microphone", "microphone", "5bbbd1",
- new AttributeDescriptorImpl("soundLevel", SOUND_DB, Values.create(0),
- LABEL.withInitialValue(Values.create("Sound level")),
+ MICROPHONE(ASSET_NAMESPACE + ":microphone", "microphone", "47A5FF",
+ new AttributeDescriptorImpl("microphoneLevel", SOUND_DB, Values.create(0),
+ LABEL.withInitialValue(Values.create("Microphone Level")),
+ DESCRIPTION.withInitialValue(Values.create("DB")),
+ READ_ONLY,
+ RULE_STATE
+ )
+ ),
+
+ SOUND_EVENT(ASSET_NAMESPACE + ":soundEvent", "microphone-variant", "5BBBD1",
+ new AttributeDescriptorImpl("lastAgression", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Last Aggression event")),
+ DESCRIPTION.withInitialValue(Values.create("Input from microphone")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("lastGunshot", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Last Gunshot event")),
+ DESCRIPTION.withInitialValue(Values.create("Input from microphone")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("lastBreakingGlass", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Last Breaking Glass event")),
+ DESCRIPTION.withInitialValue(Values.create("Input from microphone")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("lastIntensity", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Last Intensity event")),
+ DESCRIPTION.withInitialValue(Values.create("Input from microphone")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("lastEvent", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Last event")),
+ DESCRIPTION.withInitialValue(Values.create("Input from microphone")),
+ READ_ONLY,
+ RULE_STATE
+ )
+ ),
+
+ ENVIRONMENT_SENSOR(ASSET_NAMESPACE + ":enviroment", "periodic-table-co2", "f18546",
+ new AttributeDescriptorImpl("temperature", TEMPERATURE_CELCIUS, Values.create(0),
+ LABEL.withInitialValue(Values.create("Temperature")),
+ DESCRIPTION.withInitialValue(Values.create("Temperature in celcius")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("nO2", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Nitrogen Level")),
+ DESCRIPTION.withInitialValue(Values.create("µg/m3")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("relHumidity", PERCENTAGE, Values.create(0),
+ LABEL.withInitialValue(Values.create("Humidity")),
+ DESCRIPTION.withInitialValue(Values.create("Humidity in area")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("ozon", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Ozon Level")),
+ DESCRIPTION.withInitialValue(Values.create("µg/m3")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("particlesPM1", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Particles PM 1")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("particlesPM2_5", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Particles PM 2.5")),
READ_ONLY,
- DESCRIPTION.withInitialValue(Values.create("Current sound level")))),
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("particlesPM10", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Particles PM 10")),
+ READ_ONLY,
+ RULE_STATE
+ )
+ ),
- ENVIRONMENT_SENSOR(ASSET_NAMESPACE + ":enviroment", "periodic-table-co2", null),
+ LIGHT(ASSET_NAMESPACE + ":light", "lightbulb", "e6688a",
+ new AttributeDescriptorImpl("lightStatus", BOOLEAN, Values.create(false),
+ LABEL.withInitialValue(Values.create("Light status")),
+ DESCRIPTION.withInitialValue(Values.create("Indicates if the light is on or off")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("lightDimLevel", PERCENTAGE, Values.create(0),
+ LABEL.withInitialValue(Values.create("Light Dim Level")),
+ DESCRIPTION.withInitialValue(Values.create("The level of dimming of the light")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("colorGBW", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Color RGBW")),
+ DESCRIPTION.withInitialValue(Values.create("The RGBW color of the light")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("groupNumber", STRING, Values.create(""),
+ LABEL.withInitialValue(Values.create("Group number")),
+ DESCRIPTION.withInitialValue(Values.create("Which group this light belongs to")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("Scenario", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Scenario")),
+ DESCRIPTION.withInitialValue(Values.create("The scenario the light are setup to")),
+ READ_ONLY,
+ RULE_STATE
+ )
+ ),
- LIGHT(ASSET_NAMESPACE + ":light", "lightbulb", null),
+ LIGHT_CONTROLLER(ASSET_NAMESPACE + ":lightController", "light-switch", "9e5de2",
+ new AttributeDescriptorImpl("lightAllStatus", BOOLEAN, Values.create(false),
+ LABEL.withInitialValue(Values.create("Light all status")),
+ DESCRIPTION.withInitialValue(Values.create("Indicates if all lights are on or off")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("lightAllDimLevel", PERCENTAGE, Values.create(0),
+ LABEL.withInitialValue(Values.create("Light Dim Level")),
+ DESCRIPTION.withInitialValue(Values.create("The level of dimming of all the lights")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("colorAllRGBW", OBJECT, Values.createObject(),
+ LABEL.withInitialValue(Values.create("Color RGBW")),
+ DESCRIPTION.withInitialValue(Values.create("The RGBW color of all the lights")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("Scenario", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("Scenario")),
+ DESCRIPTION.withInitialValue(Values.create("The scenario the lights are setup to")),
+ READ_ONLY,
+ RULE_STATE
+ )
+ ),
- CAMERA(ASSET_NAMESPACE + ":camera", "camera", null),
+ PEOPLE_COUNTER(ASSET_NAMESPACE + ":peopleCounter", "account-multiple", "4b5966", false,
+ new AttributeDescriptorImpl("peopleCountIn", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("People Count In")),
+ DESCRIPTION.withInitialValue(Values.create("Cumulative number of people going into area")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("peopleCountOut", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("People Count Out")),
+ DESCRIPTION.withInitialValue(Values.create("Cumulative number of people leaving area")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("peopleCountInMinute", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("People Count In Minute")),
+ DESCRIPTION.withInitialValue(Values.create("Number of people going into area per minute")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("peopleCountOutMinute", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("People Count Out Minute")),
+ DESCRIPTION.withInitialValue(Values.create("Number of people leaving area per minute")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("peopleCountTotal", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("People Count Total")),
+ DESCRIPTION.withInitialValue(Values.create("cameraCountIn - cameraCountOut")),
+ READ_ONLY,
+ RULE_STATE
+ ),
+ new AttributeDescriptorImpl("peopleCountGrowth", NUMBER, Values.create(0),
+ LABEL.withInitialValue(Values.create("People Count Growth")),
+ DESCRIPTION.withInitialValue(Values.create("cameraCountIn - cameraCountOut")),
+ READ_ONLY,
+ RULE_STATE
+ )
+ ),
THING(ASSET_NAMESPACE + ":thing", "cube-outline", null);
diff --git a/test/src/test/groovy/org/openremote/test/assets/AssetModelResourceTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetModelResourceTest.groovy
index a3c007df8..e6d5c94b9 100644
--- a/test/src/test/groovy/org/openremote/test/assets/AssetModelResourceTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/assets/AssetModelResourceTest.groovy
@@ -32,7 +32,7 @@ import static org.openremote.model.Constants.MASTER_REALM
import static org.openremote.model.asset.AssetType.AGENT
import static org.openremote.model.asset.AssetType.AREA
import static org.openremote.model.asset.AssetType.BUILDING
-import static org.openremote.model.asset.AssetType.CAMERA
+import static org.openremote.model.asset.AssetType.PEOPLE_COUNTER
import static org.openremote.model.asset.AssetType.CITY
import static org.openremote.model.asset.AssetType.CONSOLE
import static org.openremote.model.asset.AssetType.ENVIRONMENT_SENSOR
@@ -83,7 +83,7 @@ class AssetModelResourceTest extends Specification implements ManagerContainerTr
assetDescriptors[8].name == MICROPHONE.name
assetDescriptors[9].name == ENVIRONMENT_SENSOR.name
assetDescriptors[10].name == LIGHT.name
- assetDescriptors[11].name == CAMERA.name
+ assetDescriptors[11].name == PEOPLE_COUNTER.name
assetDescriptors[12].name == THING.name
when: "a request for Attribute types is made"
diff --git a/ui/app/main/images/logo.png b/ui/app/main/images/logo.png
index bbcbd480f..2179b259d 100644
Binary files a/ui/app/main/images/logo.png and b/ui/app/main/images/logo.png differ
diff --git a/ui/app/main/images/openremote-logo.png b/ui/app/main/images/openremote-logo.png
deleted file mode 100644
index 3b956532f..000000000
Binary files a/ui/app/main/images/openremote-logo.png and /dev/null differ
diff --git a/ui/app/main/src/components/my-app.ts b/ui/app/main/src/components/my-app.ts
index 9a6039f12..79bbe8ab6 100644
--- a/ui/app/main/src/components/my-app.ts
+++ b/ui/app/main/src/components/my-app.ts
@@ -15,7 +15,7 @@ import {connect} from "pwa-helpers/connect-mixin";
// Declare require method which we'll use for importing webpack resources (using ES6 imports will confuse typescript parser)
declare function require(name: string): any;
-const logoImage = require("../../images/openremote-logo.png");
+const logoImage = require("../../images/logo.png");
const logoMobileImage = require("../../images/logo-mobile.png");
@customElement("my-app")
@@ -35,7 +35,7 @@ class MyApp extends connect(store)(LitElement) {
:host {
--or-app-color2: ${unsafeCSS(DefaultColor2)};
--or-app-color3: #22211f;
- --or-app-color4: #07601F;
+ --or-app-color4: #4D9D2A;
color: ${unsafeCSS(DefaultColor3)};
fill: ${unsafeCSS(DefaultColor3)};
font-size: 14px;
diff --git a/ui/app/main/src/components/pages/page-assets.ts b/ui/app/main/src/components/pages/page-assets.ts
index 647b35d6d..882c1b54f 100644
--- a/ui/app/main/src/components/pages/page-assets.ts
+++ b/ui/app/main/src/components/pages/page-assets.ts
@@ -59,72 +59,91 @@ const viewerConfig: ViewerConfig = {
"urn:openremote:asset:residence": {
panels: {
"attributes": {
- exclude: ["dayScene",
- "daySceneEnabledFRIDAY",
- "daySceneEnabledMONDAY",
- "daySceneEnabledTUESDAY",
- "daySceneEnabledWEDNESDAY",
- "daySceneEnabledTHURSDAY",
- "daySceneEnabledSATURDAY",
- "daySceneEnabledSUNDAY",
- "daySceneTimeFRIDAY",
- "daySceneTimeMONDAY",
- "daySceneTimeTUESDAY",
- "daySceneTimeWEDNESDAY",
- "daySceneTimeTHURSDAY",
- "daySceneTimeSATURDAY",
- "daySceneTimeSUNDAY",
- "disableSceneTimer",
- "enableSceneTimer",
- "eveningScene",
- "dayScene",
- "eveningSceneEnabledFRIDAY",
- "eveningSceneEnabledMONDAY",
- "eveningSceneEnabledTUESDAY",
- "eveningSceneEnabledWEDNESDAY",
- "eveningSceneEnabledTHURSDAY",
- "eveningSceneEnabledSATURDAY",
- "eveningSceneEnabledSUNDAY",
- "eveningSceneTimeFRIDAY",
- "eveningSceneTimeMONDAY",
- "eveningSceneTimeTUESDAY",
- "eveningSceneTimeWEDNESDAY",
- "eveningSceneTimeTHURSDAY",
- "eveningSceneTimeSATURDAY",
- "eveningSceneTimeSUNDAY",
- "morningScene",
- "nightscene",
- "morningSceneEnabledFRIDAY",
- "morningSceneEnabledMONDAY",
- "morningSceneEnabledTUESDAY",
- "morningSceneEnabledWEDNESDAY",
- "morningSceneEnabledTHURSDAY",
- "morningSceneEnabledSATURDAY",
- "morningSceneEnabledSUNDAY",
- "morningSceneTimeFRIDAY",
- "morningSceneTimeMONDAY",
- "morningSceneTimeTUESDAY",
- "morningSceneTimeWEDNESDAY",
- "morningSceneTimeTHURSDAY",
- "morningSceneTimeSATURDAY",
- "morningSceneTimeSUNDAY",
- "nightSceneEnabledFRIDAY",
- "nightSceneEnabledMONDAY",
- "nightSceneEnabledTUESDAY",
- "nightSceneEnabledWEDNESDAY",
- "nightSceneEnabledTHURSDAY",
- "nightSceneEnabledSATURDAY",
- "nightSceneEnabledSUNDAY",
- "nightSceneTimeFRIDAY",
- "nightSceneTimeMONDAY",
- "nightSceneTimeTUESDAY",
- "nightSceneTimeWEDNESDAY",
- "nightSceneTimeTHURSDAY",
- "nightSceneTimeSATURDAY",
- "nightSceneTimeSUNDAY",
- "vacationUntil",
- "ventilationLevel",
- "location"]
+ exclude: [
+ "dayScene",
+ "daySceneEnabledFRIDAY",
+ "daySceneEnabledMONDAY",
+ "daySceneEnabledTUESDAY",
+ "daySceneEnabledWEDNESDAY",
+ "daySceneEnabledTHURSDAY",
+ "daySceneEnabledSATURDAY",
+ "daySceneEnabledSUNDAY",
+ "daySceneTimeFRIDAY",
+ "daySceneTimeMONDAY",
+ "daySceneTimeTUESDAY",
+ "daySceneTimeWEDNESDAY",
+ "daySceneTimeTHURSDAY",
+ "daySceneTimeSATURDAY",
+ "daySceneTimeSUNDAY",
+ "disableSceneTimer",
+ "enableSceneTimer",
+ "eveningScene",
+ "dayScene",
+ "eveningSceneEnabledFRIDAY",
+ "eveningSceneEnabledMONDAY",
+ "eveningSceneEnabledTUESDAY",
+ "eveningSceneEnabledWEDNESDAY",
+ "eveningSceneEnabledTHURSDAY",
+ "eveningSceneEnabledSATURDAY",
+ "eveningSceneEnabledSUNDAY",
+ "eveningSceneTimeFRIDAY",
+ "eveningSceneTimeMONDAY",
+ "eveningSceneTimeTUESDAY",
+ "eveningSceneTimeWEDNESDAY",
+ "eveningSceneTimeTHURSDAY",
+ "eveningSceneTimeSATURDAY",
+ "eveningSceneTimeSUNDAY",
+ "morningScene",
+ "nightscene",
+ "morningSceneEnabledFRIDAY",
+ "morningSceneEnabledMONDAY",
+ "morningSceneEnabledTUESDAY",
+ "morningSceneEnabledWEDNESDAY",
+ "morningSceneEnabledTHURSDAY",
+ "morningSceneEnabledSATURDAY",
+ "morningSceneEnabledSUNDAY",
+ "morningSceneTimeFRIDAY",
+ "morningSceneTimeMONDAY",
+ "morningSceneTimeTUESDAY",
+ "morningSceneTimeWEDNESDAY",
+ "morningSceneTimeTHURSDAY",
+ "morningSceneTimeSATURDAY",
+ "morningSceneTimeSUNDAY",
+ "nightSceneEnabledFRIDAY",
+ "nightSceneEnabledMONDAY",
+ "nightSceneEnabledTUESDAY",
+ "nightSceneEnabledWEDNESDAY",
+ "nightSceneEnabledTHURSDAY",
+ "nightSceneEnabledSATURDAY",
+ "nightSceneEnabledSUNDAY",
+ "nightSceneTimeFRIDAY",
+ "nightSceneTimeMONDAY",
+ "nightSceneTimeTUESDAY",
+ "nightSceneTimeWEDNESDAY",
+ "nightSceneTimeTHURSDAY",
+ "nightSceneTimeSATURDAY",
+ "nightSceneTimeSUNDAY",
+ "vacationUntil",
+ "ventilationLevel",
+ "location",
+ "firstPresenceDetected",
+ "lastPresenceDetected",
+ "smartSwitchStartTimeA",
+ "smartSwitchStartTimeB",
+ "smartSwitchStartTimeC",
+ "smartSwitchEnabledA",
+ "smartSwitchEnabledB",
+ "smartSwitchEnabledC",
+ "smartSwitchStopTimeA",
+ "smartSwitchStopTimeB",
+ "smartSwitchStopTimeC",
+ "smartSwitchBeginEndA",
+ "smartSwitchBeginEndB",
+ "smartSwitchBeginEndC",
+ "smartSwitchModeA",
+ "smartSwitchModeB",
+ "smartSwitchModeC"
+ ]
}
}
}
diff --git a/ui/app/main/src/components/pages/page-rules.ts b/ui/app/main/src/components/pages/page-rules.ts
index c0b16069d..0e635906d 100644
--- a/ui/app/main/src/components/pages/page-rules.ts
+++ b/ui/app/main/src/components/pages/page-rules.ts
@@ -2,6 +2,38 @@ import {html, LitElement, property, css, query, customElement, PropertyValues} f
import {store} from "../../store";
import {connect} from "pwa-helpers/connect-mixin";
import "@openremote/or-rules";
+import {RulesConfig} from "@openremote/or-rules";
+import {RulesetLang, AssetType, AttributeType} from "@openremote/model";
+
+const rulesConfig: RulesConfig = {
+ controls: {
+ allowedLanguages: [RulesetLang.JSON]
+ },
+ descriptors: {
+ all: {
+ excludeAssets: [
+ AssetType.BUILDING.type,
+ AssetType.CITY.type,
+ AssetType.AREA.type,
+ AssetType.FLOOR.type,
+ ],
+ assets: {
+ "*": {
+ excludeAttributes: [
+ AttributeType.LOCATION.attributeName
+ ]
+ }
+ }
+ }
+ },
+ json: {
+ rule: {
+ reset: {
+ timer: "1h"
+ }
+ }
+ }
+};
@customElement("page-rules")
class PageRules extends connect(store)(LitElement) {
@@ -21,7 +53,7 @@ class PageRules extends connect(store)(LitElement) {
protected render() {
return html`
- <or-rules></or-rules>
+ <or-rules .config="${rulesConfig}"></or-rules>
`;
}
}