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
Add Modbus TCP/RTU Agent (#1760)
Panos Kalogeropoulos04e06743d42d
diff --git a/agent/build.gradle b/agent/build.gradleindex acef7f598..8cdd07cde 100644--- a/agent/build.gradle+++ b/agent/build.gradle@@ -21,6 +21,9 @@ dependencies {api "net.sf.saxon:Saxon-HE:$saxonHEVersion"+ implementation "org.apache.plc4x:plc4j-api:$plc4xVersion"+ runtimeOnly "org.apache.plc4x:plc4j-driver-modbus:$plc4xVersion"+//IKEA Tradfri agent dependenciesapi "org.eclipse.californium:californium-core:$californiumCoreVersion"api "org.eclipse.californium:scandium:$californiumScandiumVersion"diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/AbstractModbusProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/AbstractModbusProtocol.javanew file mode 100644index 000000000..8d0f93091--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/AbstractModbusProtocol.java@@ -0,0 +1,167 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import org.apache.plc4x.java.api.PlcConnection;+import org.apache.plc4x.java.api.messages.PlcReadRequest;+import org.apache.plc4x.java.api.messages.PlcReadResponse;+import org.apache.plc4x.java.api.messages.PlcWriteRequest;+import org.apache.plc4x.java.api.messages.PlcWriteResponse;+import org.apache.plc4x.java.api.types.PlcResponseCode;+import org.openremote.agent.protocol.AbstractProtocol;+import org.openremote.model.Container;+import org.openremote.model.asset.agent.ConnectionStatus;+import org.openremote.model.attribute.Attribute;+import org.openremote.model.attribute.AttributeEvent;+import org.openremote.model.attribute.AttributeRef;+import org.openremote.model.syslog.SyslogCategory;++import java.util.HashMap;+import java.util.Map;+import java.util.concurrent.ScheduledFuture;+import java.util.concurrent.TimeUnit;+import java.util.logging.Level;+import java.util.logging.Logger;++import static org.openremote.model.asset.agent.AgentLink.getOrThrowAgentLinkProperty;+import static org.openremote.model.syslog.SyslogCategory.PROTOCOL;++public abstract class AbstractModbusProtocol<S extends AbstractModbusProtocol<S,T>, T extends ModbusAgent<T, S>>+ extends AbstractProtocol<T, ModbusAgentLink>{++ public static final Logger LOG = SyslogCategory.getLogger(PROTOCOL, AbstractModbusProtocol.class);++ protected final Map<AttributeRef, ScheduledFuture<?>> pollingMap = new HashMap<>();++ PlcConnection client = null;++ public AbstractModbusProtocol(T agent) {+ super(agent);+ }++ @Override+ protected void doStart(Container container) throws Exception {++ try {+ setConnectionStatus(ConnectionStatus.CONNECTING);++ client = createIoClient(agent);++ client.connect();++ setConnectionStatus(client.isConnected() ? ConnectionStatus.CONNECTED : ConnectionStatus.ERROR);+ } catch (Exception e) {+ LOG.log(Level.SEVERE, "Failed to create PLC4X connection for protocol instance: " + agent, e);+ setConnectionStatus(ConnectionStatus.ERROR);+ throw e;+ }+ }+ @Override+ protected void doStop(Container container) throws Exception {+ pollingMap.forEach((key, value) -> value.cancel(false));++ client.close();+ }++ @Override+ protected void doLinkAttribute(String assetId, Attribute<?> attribute, ModbusAgentLink agentLink) throws RuntimeException {+ AttributeRef ref = new AttributeRef(assetId, attribute.getName());+ pollingMap.put(ref,+ scheduleModbusPollingReadRequest(+ ref,+ agentLink.getPollingMillis(),+ agentLink.getReadMemoryArea(),+ agentLink.getReadValueType(),+ agentLink.getReadAddress()+ )+ );+ }++ @Override+ protected void doUnlinkAttribute(String assetId, Attribute<?> attribute, ModbusAgentLink agentLink) {+ AttributeRef attributeRef = new AttributeRef(assetId, attribute.getName());+ ScheduledFuture<?> pollTask = pollingMap.remove(attributeRef);+ if (pollTask != null) {+ pollTask.cancel(false);+ }+ }++ @Override+ protected void doLinkedAttributeWrite(ModbusAgentLink agentLink, AttributeEvent event, Object processedValue) {++ // Look at comment in schedulePollingRequest for an explanation to this+ int writeAddress = getOrThrowAgentLinkProperty(agentLink.getWriteAddress(), "write address");++ PlcWriteRequest.Builder builder = client.writeRequestBuilder();++ switch (agentLink.getWriteMemoryArea()){+ case COIL -> builder.addTagAddress("coil", "coil:" + writeAddress, processedValue);+ case HOLDING -> builder.addTagAddress("holdingRegisters", "holding-register:" + writeAddress, processedValue);+ default -> throw new IllegalStateException("No other memory area is allowed to write to a Modbus server");+ }++ PlcWriteRequest request = builder.build();++ try {+ PlcWriteResponse response = request.execute().get(3, TimeUnit.SECONDS);+ if (response.getResponseCode(response.getTagNames().stream().findFirst().orElseThrow()) != PlcResponseCode.OK){+ throw new IllegalStateException("PLC Write Response code is something other than \"OK\"");+ }+ } catch (Exception e) {+ throw new RuntimeException(e);+ }+ }++ protected ScheduledFuture<?> scheduleModbusPollingReadRequest(AttributeRef ref,+ long pollingMillis,+ ModbusAgentLink.ReadMemoryArea readType,+ ModbusAgentLink.ModbusDataType dataType,+ int readAddress) {++ PlcReadRequest.Builder builder = client.readRequestBuilder();+ switch (readType) {+ case COIL -> builder.addTagAddress("coils", "coil:" + readAddress + ":" + dataType);+ case DISCRETE -> builder.addTagAddress("discreteInputs", "discrete-input:" + readAddress + ":" + dataType);+ case HOLDING -> builder.addTagAddress("holdingRegisters", "holding-register:" + readAddress + ":" + dataType);+ case INPUT -> builder.addTagAddress("inputRegisters", "input-register:" + readAddress + ":" + dataType);+ default -> throw new IllegalArgumentException("Unsupported read type: " + readType);+ }+ PlcReadRequest readRequest = builder.build();++ LOG.log(Level.FINE,"Scheduling Modbus Read Value polling request '" + "clientRequest" + "' to execute every " + pollingMillis + "ms for attributeRef: " + ref);+ return scheduledExecutorService.scheduleWithFixedDelay(() -> {+ try {+ PlcReadResponse response = readRequest.execute().get(3, TimeUnit.SECONDS);++ // We currently only request one thing (with the above tag), so we get it from there. If it doesn't exist,+ // we can assume that the request failed.+ String responseTag = response.getTagNames().stream().findFirst()+ .orElseThrow(() -> new RuntimeException("Could not retrieve the requested value from the response"));++ Object responseValue = response.getObject(responseTag);+ updateLinkedAttribute(ref, responseValue);+ } catch (Exception e) {+ LOG.log(Level.FINE,"Exception thrown during Modbus Read Value polling request '" + readRequest.toString());+ }+ }, 0, pollingMillis, TimeUnit.MILLISECONDS);+ }++ protected abstract PlcConnection createIoClient(T agent) throws RuntimeException;+}diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusAgent.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusAgent.javanew file mode 100644index 000000000..2d00145c7--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusAgent.java@@ -0,0 +1,49 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import jakarta.persistence.Entity;+import org.openremote.model.asset.agent.Agent;+import org.openremote.model.attribute.MetaItem;+import org.openremote.model.value.AttributeDescriptor;+import org.openremote.model.value.MetaItemType;+import org.openremote.model.value.ValueConstraint;+import org.openremote.model.value.ValueType;++@Entity+public abstract class ModbusAgent<T extends ModbusAgent<T, U>, U extends AbstractModbusProtocol<U, T>> extends Agent<T, U, ModbusAgentLink> {++ public static final AttributeDescriptor<Integer> UNIT_ID = new AttributeDescriptor<>("unitId", ValueType.INTEGER, new MetaItem<>(MetaItemType.CONSTRAINTS, ValueConstraint.constraints(new ValueConstraint.Min(1), new ValueConstraint.Max(255))));++ // For Hydrators+ protected ModbusAgent() {}++ protected ModbusAgent(String name) {+ super(name);+ }++ public Integer getUnitId(){+ return getAttributes().getValue(UNIT_ID).get();+ }++ public void setUnitId(Integer unitId) {+ getAttributes().getOrCreate(UNIT_ID).setValue(unitId);+ }+}diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusAgentLink.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusAgentLink.javanew file mode 100644index 000000000..ada923eff--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusAgentLink.java@@ -0,0 +1,147 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import com.fasterxml.jackson.annotation.JsonPropertyDescription;+import org.openremote.model.asset.agent.AgentLink;++import javax.validation.constraints.NotNull;+import java.math.BigInteger;+import java.util.Optional;++//TODO: Make non-primitive parameters required+public class ModbusAgentLink extends AgentLink<ModbusAgentLink> {++ @NotNull+ @JsonPropertyDescription("Poll interval in milliseconds")+ private long pollingMillis;++ @NotNull+ @JsonPropertyDescription("Memory area to read from during read request")+ private ReadMemoryArea readMemoryArea;++ @NotNull+ @JsonPropertyDescription("Type to convert the returned data to. As specified by the PLC4X Modbus data types.")+ private ModbusDataType readValueType;++ @NotNull+ @JsonPropertyDescription("Zero based address from which the value is read from")+ private int readAddress;++ @NotNull+ @JsonPropertyDescription("Memory area to write to. \"HOLDING\" or \"COIL\" allowed.")+ private WriteMemoryArea writeMemoryArea;++ @NotNull+ @JsonPropertyDescription("Zero-based address to which the value sent is written to")+ private int writeAddress;++ public long getPollingMillis() {+ return pollingMillis;+ }++ public void setPollingMillis(long pollingMillis) {+ this.pollingMillis = pollingMillis;+ }++ public ReadMemoryArea getReadMemoryArea() {+ return readMemoryArea;+ }++ public void setReadMemoryArea(ReadMemoryArea readMemoryArea) {+ this.readMemoryArea = readMemoryArea;+ }++ public ModbusDataType getReadValueType() {+ return readValueType;+ }++ public void setReadValueType(ModbusDataType readValueType) {+ this.readValueType = readValueType;+ }++ public int getReadAddress() {+ return readAddress;+ }++ public void setReadAddress(int readAddress) {+ this.readAddress = readAddress;+ }++ public WriteMemoryArea getWriteMemoryArea() {+ return writeMemoryArea;+ }++ public void setWriteMemoryArea(WriteMemoryArea writeMemoryArea) {+ this.writeMemoryArea = writeMemoryArea;+ }++ public Optional<Integer> getWriteAddress() {+ return Optional.of(writeAddress);+ }++ public void setWriteAddress(int writeAddress) {+ this.writeAddress = writeAddress;+ }++ public enum ReadMemoryArea {+ COIL, DISCRETE, HOLDING, INPUT+ }++ public enum ModbusDataType {+ BOOL(boolean.class),+ SINT(byte.class),+ USINT(short.class),+ BYTE(short.class),+ INT(short.class),+ UINT(int.class),+ WORD(int.class),+ DINT(int.class),+ UDINT(long.class),+ DWORD(long.class),+ LINT(long.class),+ ULINT(BigInteger.class),+ LWORD(BigInteger.class),+ REAL(float.class),+ LREAL(double.class),+ CHAR(char.class),+ WCHAR(String.class);++ private final Class<?> javaType;++ ModbusDataType(Class<?> javaType) {+ this.javaType = javaType;+ }++ public Class<?> getJavaType() {+ return javaType;+ }+ }++ public enum WriteMemoryArea {+ COIL, HOLDING+ }+++ public ModbusAgentLink(String id) {super(id);}++ protected ModbusAgentLink() {+ }+}diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusSerialAgent.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusSerialAgent.javanew file mode 100644index 000000000..66a636c5e--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusSerialAgent.java@@ -0,0 +1,89 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import jakarta.persistence.Entity;+import org.openremote.model.asset.agent.Agent;+import org.openremote.model.asset.agent.AgentDescriptor;+import org.openremote.model.value.AttributeDescriptor;+import org.openremote.model.value.ValueType;++/**+ * This Modbus serial agent is currently untested, due to difficulties in testing Modbus serial agents (especially the+ * absence of automated Modbus serial testing libraries)+ */+@Entity+public class ModbusSerialAgent extends ModbusAgent<ModbusSerialAgent, ModbusSerialProtocol>{++ public static final AttributeDescriptor<String> SERIAL_PORT = Agent.SERIAL_PORT.withOptional(false);+ public static final AttributeDescriptor<Integer> BAUD_RATE = Agent.SERIAL_BAUDRATE.withOptional(false);+ public static final AttributeDescriptor<Integer> DATA_BITS = new AttributeDescriptor<>("dataBits", ValueType.POSITIVE_INTEGER);+ public static final AttributeDescriptor<Integer> STOP_BITS = new AttributeDescriptor<>("stopBits", ValueType.POSITIVE_INTEGER);++ //TODO: Doesn't work, getting a frontend error TypeError: Cannot read properties of undefined (reading 'units') at getValueFormatConstraintOrUnits+// public static final AttributeDescriptor<ModbusClientParity> PARITY = new AttributeDescriptor<ModbusClientParity>("parity",+// new ValueDescriptor<ModbusClientParity>("modbusClientParity", ModbusClientParity.class)+// );+++ public enum ModbusClientParity {+ NO_PARITY,+ ODD_PARITY,+ EVEN_PARITY,+ MARK_PARITY,+ SPACE_PARITY,+ }++ public static final AgentDescriptor<ModbusSerialAgent, ModbusSerialProtocol, ModbusAgentLink> DESCRIPTOR = new AgentDescriptor<>(+ ModbusSerialAgent.class, ModbusSerialProtocol.class, ModbusAgentLink.class+ );++ /**+ * For use by hydrators (i.e. JPA/Jackson)+ */+ protected ModbusSerialAgent() {+ }++ public ModbusSerialAgent(String name) {+ super(name);+ }++ public Integer getBaudRate() {+ return getAttribute(BAUD_RATE).get().getValue().get();+ }++ public Integer getDataBits() {+ return getAttribute(DATA_BITS).get().getValue().get();+ }++ public Integer getStopBits() {+ return getAttribute(STOP_BITS).get().getValue().get();+ }++// public ModbusClientParity getParity() {+// return getAttribute(PARITY).get().getValue().get();+// }+++ @Override+ public ModbusSerialProtocol getProtocolInstance() {+ return new ModbusSerialProtocol(this);+ }+}diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusSerialProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusSerialProtocol.javanew file mode 100644index 000000000..9bea283ab--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusSerialProtocol.java@@ -0,0 +1,59 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import org.apache.plc4x.java.api.PlcConnection;+import org.apache.plc4x.java.api.PlcDriverManager;+import org.apache.plc4x.java.api.exceptions.PlcConnectionException;++public class ModbusSerialProtocol extends AbstractModbusProtocol<ModbusSerialProtocol, ModbusSerialAgent>{+ public ModbusSerialProtocol(ModbusSerialAgent agent) {+ super(agent);+ }++ private String connectionString;++ @Override+ protected PlcConnection createIoClient(ModbusSerialAgent agent) throws RuntimeException {++ connectionString = "modbus-rtu://"+agent.getSerialPort() ++ "?serial.baud-rate=" + agent.getBaudRate() ++ "&unit-identifier=" + agent.getUnitId() ++ "&serial.num-data-bits=" + agent.getDataBits() ++ "&serial.num-stop-bits=" + agent.getStopBits();+ PlcConnection plcConnection;+ try {+ plcConnection = PlcDriverManager.getDefault().getConnectionManager().getConnection(connectionString);+ } catch (PlcConnectionException e) {+ throw new RuntimeException(e);+ }+ return plcConnection;+ }++ @Override+ public String getProtocolName() {+ return "Modbus Serial Protocol";+ }++ @Override+ public String getProtocolInstanceUri() {+ return connectionString;+ }+}diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusTcpAgent.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusTcpAgent.javanew file mode 100644index 000000000..1eba9447f--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusTcpAgent.java@@ -0,0 +1,54 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import jakarta.persistence.Entity;+import jakarta.validation.constraints.NotNull;+import org.openremote.model.asset.agent.Agent;+import org.openremote.model.asset.agent.AgentDescriptor;+import org.openremote.model.value.AttributeDescriptor;++@Entity+public class ModbusTcpAgent extends ModbusAgent<ModbusTcpAgent, ModbusTcpProtocol>{++ public static final AgentDescriptor<ModbusTcpAgent, ModbusTcpProtocol, ModbusAgentLink> DESCRIPTOR = new AgentDescriptor<>(+ ModbusTcpAgent.class, ModbusTcpProtocol.class, ModbusAgentLink.class+ );++ @NotNull+ public static final AttributeDescriptor<String> HOST = Agent.HOST.withOptional(false);+ @NotNull+ public static final AttributeDescriptor<Integer> PORT = Agent.PORT.withOptional(false);++ /**+ * For use by hydrators (i.e. JPA/Jackson)+ */+ protected ModbusTcpAgent() {+ }++ public ModbusTcpAgent(String name) {+ super(name);+ }++ @Override+ public ModbusTcpProtocol getProtocolInstance() {+ return new ModbusTcpProtocol(this);+ }+}diff --git a/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusTcpProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusTcpProtocol.javanew file mode 100644index 000000000..fec40b327--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/modbus/ModbusTcpProtocol.java@@ -0,0 +1,54 @@+/*+ * Copyright 2025, 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.agent.protocol.modbus;++import org.apache.plc4x.java.api.PlcConnection;+import org.apache.plc4x.java.api.PlcDriverManager;+import org.apache.plc4x.java.api.exceptions.PlcConnectionException;++public class ModbusTcpProtocol extends AbstractModbusProtocol<ModbusTcpProtocol, ModbusTcpAgent>{+ public ModbusTcpProtocol(ModbusTcpAgent agent) {+ super(agent);+ }++ private String connectionString;++ @Override+ protected PlcConnection createIoClient(ModbusTcpAgent agent) throws RuntimeException {+ PlcConnection plcConnection;+ connectionString = "modbus-tcp://" + agent.getHost().orElseThrow() + ":" + agent.getPort().orElseThrow()+"?unit-identifier=" + agent.getUnitId();+ try {+ plcConnection = PlcDriverManager.getDefault().getConnectionManager().getConnection(connectionString);+ } catch (PlcConnectionException e) {+ throw new RuntimeException(e);+ }+ return plcConnection;+ }++ @Override+ public String getProtocolName() {+ return "Modbus TCP Protocol";+ }++ @Override+ public String getProtocolInstanceUri() {+ return connectionString;+ }+}diff --git a/gradle.properties b/gradle.propertiesindex 4ffeb1d60..85a391d88 100644--- a/gradle.properties+++ b/gradle.properties@@ -49,6 +49,8 @@ typescriptGeneratorVersion = 3.2.1263californiumCoreVersion = 3.13.0californiumScandiumVersion = 3.13.0zwaveVersion = 3.4.0+plc4xVersion = 0.12.0+niftyModbusVersion = 0.17.0reflectionsVersion=0.9.12swaggerVersion=2.2.29swaggeruiVersion = 5.18.2diff --git a/test/build.gradle b/test/build.gradleindex 7c6a7d3dd..e3de76700 100644--- a/test/build.gradle+++ b/test/build.gradle@@ -32,6 +32,13 @@ dependencies {testImplementation "com.google.firebase:firebase-admin:$firebaseAdminVersion"testImplementation "org.shredzone.commons:commons-suncalc:$suncalcVersion"testImplementation "com.icegreen:greenmail:$greenmailVersion"++ testImplementation "net.solarnetwork.common:nifty-modbus-tcp:$niftyModbusVersion"+ testImplementation "net.solarnetwork.common:nifty-modbus-rtu-jsc:$niftyModbusVersion"+ testImplementation "net.solarnetwork.common:nifty-modbus-api:$niftyModbusVersion"+ testImplementation "net.solarnetwork.common:nifty-modbus-core:$niftyModbusVersion"++}tasks.withType(Test) {diff --git a/test/src/test/groovy/org/openremote/test/protocol/modbus/ModbusBasicTest.groovy b/test/src/test/groovy/org/openremote/test/protocol/modbus/ModbusBasicTest.groovynew file mode 100644index 000000000..af9b5a5b6--- /dev/null+++ b/test/src/test/groovy/org/openremote/test/protocol/modbus/ModbusBasicTest.groovy@@ -0,0 +1,276 @@+/*+ * Copyright 2025, 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.test.protocol.modbus++import net.solarnetwork.io.modbus.BitsModbusMessage+import net.solarnetwork.io.modbus.ModbusBlockType+import net.solarnetwork.io.modbus.ModbusErrorCode+import net.solarnetwork.io.modbus.ModbusFunctionCode+import net.solarnetwork.io.modbus.ModbusMessage+import net.solarnetwork.io.modbus.RegistersModbusMessage+import net.solarnetwork.io.modbus.netty.msg.BaseModbusMessage+import net.solarnetwork.io.modbus.tcp.netty.NettyTcpModbusServer+import org.openremote.agent.protocol.modbus.ModbusAgentLink+import org.openremote.agent.protocol.modbus.ModbusTcpAgent+import org.openremote.agent.protocol.modbus.ModbusTcpProtocol+import org.openremote.manager.agent.AgentService+import org.openremote.manager.asset.AssetProcessingService+import org.openremote.manager.asset.AssetStorageService+import org.openremote.model.asset.agent.Agent+import org.openremote.model.asset.agent.ConnectionStatus+import org.openremote.model.asset.impl.ShipAsset+import org.openremote.model.attribute.Attribute+import org.openremote.model.attribute.AttributeEvent+import org.openremote.model.attribute.MetaItem+import org.openremote.model.attribute.MetaMap+import org.openremote.model.value.ValueType+import org.openremote.test.ManagerContainerTrait+import spock.lang.Shared+import spock.lang.Specification+import spock.util.concurrent.PollingConditions++import java.util.concurrent.atomic.AtomicReference++import static net.solarnetwork.io.modbus.ModbusFunctionCodes.WRITE_COIL+import static net.solarnetwork.io.modbus.ModbusFunctionCodes.WRITE_COILS+import static net.solarnetwork.io.modbus.ModbusFunctionCodes.WRITE_HOLDING_REGISTER+import static net.solarnetwork.io.modbus.ModbusFunctionCodes.WRITE_HOLDING_REGISTERS+import static net.solarnetwork.io.modbus.netty.msg.BitsModbusMessage.readCoilsResponse+import static net.solarnetwork.io.modbus.netty.msg.BitsModbusMessage.readDiscretesResponse+import static net.solarnetwork.io.modbus.netty.msg.BitsModbusMessage.writeCoilResponse+import static net.solarnetwork.io.modbus.netty.msg.BitsModbusMessage.writeCoilsResponse+import static net.solarnetwork.io.modbus.netty.msg.RegistersModbusMessage.*+import static org.openremote.model.Constants.MASTER_REALM+import static org.openremote.model.value.MetaItemType.AGENT_LINK++class ModbusBasicTest extends Specification implements ManagerContainerTrait {++ @Shared+ int modbusServerPort++ @Shared+ NettyTcpModbusServer server++ @Shared+ AtomicReference<ModbusMessage> latestReadMessage = new AtomicReference(null)++ @Shared+ AtomicReference<ModbusMessage> latestWriteMessage = new AtomicReference(null)+// @Shared+// Map<, Number> messageMap = [:]++ def setupSpec() {+ modbusServerPort = findEphemeralPort()+ server = new NettyTcpModbusServer(modbusServerPort)+ server.setMessageHandler((msg, sender) -> {+ ModbusMessage modbusMessage = null+ switch (msg.getFunction().blockType()) {+ case ModbusBlockType.Coil -> {+ BitsModbusMessage tcpRequest = msg.unwrap(BitsModbusMessage.class)+ if (msg.getFunction().isReadFunction()) {+ modbusMessage = readCoilsResponse(tcpRequest.getUnitId(), tcpRequest.getAddress(), tcpRequest.getCount(), BigInteger.valueOf(0xFFFF))+ } else {+ if (tcpRequest.getFunction().getCode() == WRITE_COILS) {+ modbusMessage = writeCoilsResponse(tcpRequest.getUnitId(), tcpRequest.getAddress(), tcpRequest.getCount())+ } else if (tcpRequest.getFunction().getCode() == WRITE_COIL) {+ modbusMessage = writeCoilResponse(tcpRequest.getUnitId(), tcpRequest.getAddress(), true)+ }+ }+ }+ case ModbusBlockType.Discrete -> {+ BitsModbusMessage tcpRequest = msg.unwrap(BitsModbusMessage.class)+ modbusMessage = readDiscretesResponse(tcpRequest.getUnitId(), tcpRequest.getAddress(), tcpRequest.getCount(), BigInteger.valueOf(0xFFFF))+ }+ case ModbusBlockType.Holding -> {+ RegistersModbusMessage registerRequest = msg.unwrap(RegistersModbusMessage.class)+ if (msg.getFunction().isReadFunction()) {+ modbusMessage = readHoldingsResponse(registerRequest.getUnitId(), registerRequest.getAddress(), new short[]{1, 2, 3, 4, 5, 6, 7, 8, 12.3f, 10})+ } else {+ if (registerRequest.getFunction().getCode() == WRITE_HOLDING_REGISTERS) {+ modbusMessage = writeHoldingsResponse(registerRequest.getUnitId(), registerRequest.getAddress(), registerRequest.getCount())+ } else if (registerRequest.getFunction().getCode() == WRITE_HOLDING_REGISTER) {+ modbusMessage = writeHoldingResponse(registerRequest.getUnitId(), registerRequest.getAddress(), 21)+ }+ }+ }+ case ModbusBlockType.Input -> {+ RegistersModbusMessage registerRequest = msg.unwrap(RegistersModbusMessage.class)+ modbusMessage = readInputsResponse(registerRequest.getUnitId(), registerRequest.getAddress(), new short[]{11, 12, 13, 14, 15, 16, 17, 18, 19, 20})+ }+ case ModbusBlockType.Diagnostic -> {+ modbusMessage = new BaseModbusMessage(msg.getUnitId(), msg.getFunction(), ModbusErrorCode.Acknowledge)+ }+ }++ if (msg.getFunction().isReadFunction()) {+ latestReadMessage.set(msg)+ } else {+ latestWriteMessage.set(msg)+ }+ sender.accept(modbusMessage)++ })+ server.start()+ }++ def cleanupSpec() {+ server.stop()+ }+++ def "Modbus Integration Test"() {+ given: "expected conditions"+ def conditions = new PollingConditions(timeout: 10, delay: 0.2)++ when: "the container starts"+ def container = startContainer(defaultConfig(), defaultServices())+ def assetStorageService = container.getService(AssetStorageService.class)+ def assetProcessingService = container.getService(AssetProcessingService.class)+ def agentService = container.getService(AgentService.class)++ and: "a mock Modbus agent is created"+ def agent = new ModbusTcpAgent("Modbus")+ agent.setRealm(MASTER_REALM)++ agent.setHost("127.0.0.1")+ agent.setPort(modbusServerPort)+ agent.setUnitId(1)++ agent = assetStorageService.merge(agent)++ then: "the protocol instance for the agent should be created"+ conditions.eventually {+ assert agentService.getProtocolInstance(agent.id) != null+ assert ((ModbusTcpProtocol)agentService.getProtocolInstance(agent.id)) != null+ }++ and: "the connection status should be CONNECTED"+ conditions.eventually {+ agent = assetStorageService.find(agent.getId())+ agent.getAttribute(Agent.STATUS).get().getValue().get() == ConnectionStatus.CONNECTED+ }++ when: "A ShipAsset is created with an agent link"+ ShipAsset ship = new ShipAsset("testAsset")+ ship.setRealm(MASTER_REALM)+ ship.addOrReplaceAttributes(new Attribute<Object>(ShipAsset.SPEED).addOrReplaceMeta(new MetaItem<>(+ AGENT_LINK,+ new ModbusAgentLink(+ id: agent.getId(),+ pollingMillis: 1000,+ readMemoryArea: ModbusAgentLink.ReadMemoryArea.HOLDING,+ readValueType: ModbusAgentLink.ModbusDataType.UINT,+ readAddress: 2,+ writeMemoryArea: ModbusAgentLink.WriteMemoryArea.HOLDING,+ writeAddress: 3+ )+ )))+ ship = assetStorageService.merge(ship)+ ModbusAgentLink agentLink++ then: "a client should be created and the pollingMap is populated"+ conditions.eventually {++ assert agentService.getProtocolInstance(agent.id) != null+ assert ((ModbusTcpProtocol)agentService.getProtocolInstance(agent.id)) != null+ assert ((ModbusTcpProtocol)agentService.getProtocolInstance(agent.id)).pollingMap.size() == 1++ ship = assetStorageService.find(ship.getId(), true)+ agentLink = ship.getAttribute(ShipAsset.SPEED).get().getMetaItem(AGENT_LINK).get().getValue(ModbusAgentLink.class).get()+ assert ship.getAttribute(ShipAsset.SPEED).flatMap { it.getValue() }.orElse(null) == 1++ assert (latestReadMessage.get() as ModbusMessage).getUnitId() === 1+ assert (latestReadMessage.get() as ModbusMessage).getFunction() === ModbusFunctionCode.ReadHoldingRegisters+ assert (latestReadMessage.get() as ModbusMessage).unwrap(RegistersModbusMessage.class).getAddress() == agentLink.getReadAddress()-1+ assert (latestReadMessage.get() as ModbusMessage).unwrap(RegistersModbusMessage.class).getCount() == 1+ }++ when: "the attribute is updated"+ assetProcessingService.sendAttributeEvent(new AttributeEvent(ship.getId(), ShipAsset.SPEED, 123D))+ ship.addOrReplaceAttributes(new Attribute<?>(ShipAsset.SPEED, 10))++ then: "the value is sent to the Modbus server"++ conditions.eventually {+ def msg = (latestWriteMessage.get() as ModbusMessage).unwrap(RegistersModbusMessage)+ assert msg != null+ assert msg.getCount() == 1+ assert msg.getAddress() == agentLink.getWriteAddress().get()-1+ assert msg.dataDecodeUnsigned() == [123] as int[]++ ship = assetStorageService.find(ship.getId(), true)+ assert ship.getAttribute(ShipAsset.SPEED).get().getValue().orElse(0) == 1.0+ }++ when: "I add a new coil attribute and remove the Agent Link from the speed attribute"+ ship.addOrReplaceAttributes(new Attribute<Integer>("coil1", ValueType.BOOLEAN).addOrReplaceMeta(new MetaItem<>(+ AGENT_LINK,+ new ModbusAgentLink(+ id: agent.getId(),+ pollingMillis: 1000,+ readMemoryArea: ModbusAgentLink.ReadMemoryArea.COIL,+ readValueType: ModbusAgentLink.ModbusDataType.BOOL,+ readAddress: 5,+ writeMemoryArea: ModbusAgentLink.WriteMemoryArea.COIL,+ writeAddress: 6+ )+ )))+ ship.addOrReplaceAttributes(new Attribute<Object>(ShipAsset.SPEED).setMeta(Map.of() as MetaMap))+ latestReadMessage.set(null)+ latestWriteMessage.set(null)++ and: "I merge it"+ ship = assetStorageService.merge(ship)++ then: "I should receive the correct value in the coil"++ conditions.eventually {+ agentLink = ship.getAttribute("coil1").get().getMetaItem(AGENT_LINK).get().getValue(ModbusAgentLink.class).get()++ assert agentService.getProtocolInstance(agent.id) != null+ assert ((ModbusTcpProtocol)agentService.getProtocolInstance(agent.id)) != null++ def msg = (latestReadMessage.get() as ModbusMessage).unwrap(BitsModbusMessage)+ assert msg != null+ assert msg.getCount() == 1+ assert msg.getAddress() == agentLink.getReadAddress()-1++ ship = assetStorageService.find(ship.getId(), true)+ assert ship.getAttribute("coil1").flatMap { it.getValue() }.orElse(null) == true+ }++ when: "I update the value of the coil"++ assetProcessingService.sendAttributeEvent(new AttributeEvent(ship.getId(), "coil1", true))++ then: "the coil is read properly"++ conditions.eventually {+ def msg = (latestWriteMessage.get() as ModbusMessage).unwrap(BitsModbusMessage)+ assert msg != null+ assert msg.getCount() == 1+ assert msg.getAddress() == 5+ assert msg.getBits() == BigInteger.valueOf(0x0001)++ ship = assetStorageService.find(ship.getId(), true)+ assert ship.getAttribute("coil1").flatMap { it.getValue() }.orElse(null) == true+ }+ }+}diff --git a/ui/component/or-attribute-input/src/index.ts b/ui/component/or-attribute-input/src/index.tsindex eab6e2906..57df72d4f 100644--- a/ui/component/or-attribute-input/src/index.ts+++ b/ui/component/or-attribute-input/src/index.ts@@ -172,7 +172,7 @@ export const jsonFormsInputTemplateProvider: (fallback: ValueInputProvider) => Vif (!schema) {// TODO: Load agent link schema from AssetModelUtil - For now run AssetModelTest in debug and copy paste the result of def schema = ValueUtil.getSchema(AgentLink.class)- schema = JSON.parse("{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"Agent Link\",\"oneOf\":[{\"$ref\":\"#/definitions/SNMPAgentLink\"},{\"$ref\":\"#/definitions/DefaultAgentLink\"},{\"$ref\":\"#/definitions/HTTPAgentLink\"},{\"$ref\":\"#/definitions/MockAgentLink\"},{\"$ref\":\"#/definitions/WebsocketAgentLink\"},{\"$ref\":\"#/definitions/ZWaveAgentLink\"},{\"$ref\":\"#/definitions/StorageSimulatorAgentLink\"},{\"$ref\":\"#/definitions/BluetoothMeshAgentLink\"},{\"$ref\":\"#/definitions/MQTTAgentLink\"},{\"$ref\":\"#/definitions/KNXAgentLink\"},{\"$ref\":\"#/definitions/SimulatorAgentLink\"},{\"$ref\":\"#/definitions/MailAgentLink\"},{\"$ref\":\"#/definitions/VelbusAgentLink\"}],\"definitions\":{\"SNMPAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"SNMPAgentLink\"],\"default\":\"SNMPAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"oid\":{\"type\":\"string\"}},\"title\":\"SNMPAgentLink\",\"required\":[\"type\",\"oid\"]},\"regex\":{\"type\":\"object\",\"additionalProperties\":true,\"title\":\"Regex\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"regex\"],\"default\":\"regex\"},\"pattern\":{\"type\":\"string\"},\"matchGroup\":{\"type\":\"integer\"},\"matchIndex\":{\"type\":\"integer\"}},\"required\":[\"type\"]},\"substring\":{\"type\":\"object\",\"additionalProperties\":true,\"title\":\"Substring\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"substring\"],\"default\":\"substring\"},\"beginIndex\":{\"type\":\"integer\"},\"endIndex\":{\"type\":\"integer\"}},\"required\":[\"type\",\"beginIndex\"]},\"jsonPath\":{\"type\":\"object\",\"additionalProperties\":true,\"title\":\"JSON Path\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"jsonPath\"],\"default\":\"jsonPath\"},\"path\":{\"type\":\"string\"},\"returnFirst\":{\"type\":\"boolean\"},\"returnLast\":{\"type\":\"boolean\"}},\"required\":[\"type\",\"path\",\"returnFirst\",\"returnLast\"]},\"mathExpression\":{\"type\":\"object\",\"additionalProperties\":true,\"title\":\"Mathematical Expression\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"mathExpression\"],\"default\":\"mathExpression\"},\"expression\":{\"type\":\"string\"}},\"required\":[\"type\"]},\"AnyType\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"],\"additionalProperties\":true,\"properties\":{}},\"StringPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for string values; will match based on configured options.\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"string\"],\"default\":\"string\"},\"match\":{\"type\":\"string\",\"enum\":[\"EXACT\",\"BEGIN\",\"END\",\"CONTAINS\"]},\"caseSensitive\":{\"type\":\"boolean\"},\"value\":{\"type\":\"string\"},\"negate\":{\"type\":\"boolean\"}},\"title\":\"string\",\"required\":[\"predicateType\",\"caseSensitive\",\"negate\"]},\"BooleanPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for boolean values; will evaluate the value as a boolean and match against this predicates value, any value that is not a boolean will not match\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"boolean\"],\"default\":\"boolean\"},\"value\":{\"type\":\"boolean\"}},\"title\":\"boolean\",\"required\":[\"predicateType\",\"value\"]},\"DateTimePredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for date time values; provided values should be valid ISO 8601 datetime strings (e.g. yyyy-MM-dd'T'HH:mm:ssZ or yyyy-MM-dd'T'HH:mm:ss±HH:mm), offset and time are optional, if no offset information is supplied then UTC is assumed.\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"datetime\"],\"default\":\"datetime\"},\"value\":{\"type\":\"string\"},\"rangeValue\":{\"type\":\"string\"},\"operator\":{\"type\":\"string\",\"enum\":[\"EQUALS\",\"GREATER_THAN\",\"GREATER_EQUALS\",\"LESS_THAN\",\"LESS_EQUALS\",\"BETWEEN\"]},\"negate\":{\"type\":\"boolean\"}},\"title\":\"datetime\",\"required\":[\"predicateType\",\"negate\"]},\"NumberPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for number values; will match based on configured options.\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"number\"],\"default\":\"number\"},\"value\":{\"type\":\"number\"},\"rangeValue\":{\"type\":\"number\"},\"operator\":{\"type\":\"string\",\"enum\":[\"EQUALS\",\"GREATER_THAN\",\"GREATER_EQUALS\",\"LESS_THAN\",\"LESS_EQUALS\",\"BETWEEN\"]},\"negate\":{\"type\":\"boolean\"}},\"title\":\"number\",\"required\":[\"predicateType\",\"negate\"]},\"RadialGeofencePredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for GEO JSON point values; will return true if the point is within the specified radius of the specified latitude and longitude unless negated.\",\"title\":\"Radial geofence\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"radial\"],\"default\":\"radial\"},\"radius\":{\"type\":\"integer\"},\"lat\":{\"type\":\"number\"},\"lng\":{\"type\":\"number\"},\"negated\":{\"type\":\"boolean\"}},\"required\":[\"predicateType\",\"radius\",\"lat\",\"lng\",\"negated\"]},\"RectangularGeofencePredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for GEO JSON point values; will return true if the point is within the specified rectangle specified as latitude and longitude values of two corners unless negated.\",\"title\":\"Rectangular geofence\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"rect\"],\"default\":\"rect\"},\"latMin\":{\"type\":\"number\"},\"lngMin\":{\"type\":\"number\"},\"latMax\":{\"type\":\"number\"},\"lngMax\":{\"type\":\"number\"},\"negated\":{\"type\":\"boolean\"}},\"required\":[\"predicateType\",\"latMin\",\"lngMin\",\"latMax\",\"lngMax\",\"negated\"]},\"ArrayPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for array values; will match based on configured options.\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"array\"],\"default\":\"array\"},\"value\":{\"$ref\":\"#/definitions/AnyType\"},\"index\":{\"type\":\"integer\"},\"lengthEquals\":{\"type\":\"integer\"},\"lengthGreaterThan\":{\"type\":\"integer\"},\"lengthLessThan\":{\"type\":\"integer\"},\"negated\":{\"type\":\"boolean\"}},\"title\":\"array\",\"required\":[\"predicateType\",\"negated\"]},\"ValueAnyPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate that matches any value including null.\",\"title\":\"Any value\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"value-any\"],\"default\":\"value-any\"}},\"required\":[\"predicateType\"]},\"ValueEmptyPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate that matches any empty/null value; unless negated.\",\"title\":\"Empty value\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"value-empty\"],\"default\":\"value-empty\"},\"negate\":{\"type\":\"boolean\"}},\"required\":[\"predicateType\",\"negate\"]},\"CalendarEventPredicate\":{\"type\":\"object\",\"additionalProperties\":true,\"description\":\"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.\",\"title\":\"Calendar\",\"properties\":{\"predicateType\":{\"type\":\"string\",\"enum\":[\"calendar-event\"],\"default\":\"calendar-event\"},\"timestamp\":{\"type\":\"integer\",\"format\":\"utc-millisec\"}},\"required\":[\"predicateType\"]},\"DefaultAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"DefaultAgentLink\"],\"default\":\"DefaultAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"}},\"title\":\"DefaultAgentLink\",\"required\":[\"type\"]},\"HTTPAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"HTTPAgentLink\"],\"default\":\"HTTPAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"headers\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"description\":\"A JSON object of headers to be added to HTTP request; the key represents the name of the header and for each string value supplied a new header will be added with the key name and specified string value\"},\"queryParameters\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"description\":\"A JSON object of query parameters to be added to HTTP request URL; the key represents the name of the query parameter and for each string value supplied a new query parameter will be added with the key name and specified string value (e.g. 'https://..../?test=1&test=2')\"},\"pollingMillis\":{\"type\":\"integer\",\"description\":\"Indicates that this HTTP request is used to update the linked attribute; this value indicates how frequently the HTTP request is made in order to update the linked attribute value\"},\"pagingMode\":{\"type\":\"boolean\",\"description\":\"Indicates that the HTTP server supports pagination using the standard Link header mechanism\"},\"path\":{\"type\":\"string\",\"description\":\"The URL path to append to the agents Base URL when making requests for this linked attribute\"},\"method\":{\"type\":\"string\",\"enum\":[\"GET\",\"POST\",\"PUT\",\"DELETE\",\"OPTIONS\",\"PATCH\"],\"description\":\"The HTTP method to use when making requests for this linked attribute\"},\"contentType\":{\"type\":\"string\",\"description\":\"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)\"},\"pollingAttribute\":{\"type\":\"string\",\"description\":\"Allows the polled response to be written to another attribute with the specified name on the same asset as the linked attribute\"},\"messageConvertBinary\":{\"type\":\"boolean\",\"description\":\"Indicates that the HTTP response is binary and should be converted to binary string representation\"},\"messageConvertHex\":{\"type\":\"boolean\",\"description\":\"Indicates that the HTTP response is binary and should be converted to hexadecimal string representation\"}},\"title\":\"HTTPAgentLink\",\"required\":[\"type\",\"messageConvertBinary\",\"messageConvertHex\"]},\"MockAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"MockAgentLink\"],\"default\":\"MockAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"requiredValue\":{\"type\":\"string\"}},\"title\":\"MockAgentLink\",\"required\":[\"type\"]},\"WebsocketAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"WebsocketAgentLink\"],\"default\":\"WebsocketAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"websocketSubscriptions\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/websocket\"},{\"$ref\":\"#/definitions/http\"}]}}},\"title\":\"WebsocketAgentLink\",\"required\":[\"type\"]},\"websocket\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"websocket\"],\"default\":\"websocket\"},\"body\":{\"$ref\":\"#/definitions/AnyType\"}},\"title\":\"websocket\",\"required\":[\"type\"]},\"http\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"http\"],\"default\":\"http\"},\"body\":{\"$ref\":\"#/definitions/AnyType\"},\"method\":{\"type\":\"string\",\"enum\":[\"GET\",\"PUT\",\"POST\"]},\"contentType\":{\"type\":\"string\"},\"headers\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"uri\":{\"type\":\"string\"}},\"title\":\"http\",\"required\":[\"type\"]},\"ZWaveAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"ZWaveAgentLink\"],\"default\":\"ZWaveAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"deviceNodeId\":{\"type\":\"integer\"},\"deviceEndpoint\":{\"type\":\"integer\"},\"deviceValue\":{\"type\":\"string\"}},\"title\":\"ZWaveAgentLink\",\"required\":[\"type\"]},\"StorageSimulatorAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"StorageSimulatorAgentLink\"],\"default\":\"StorageSimulatorAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"}},\"title\":\"StorageSimulatorAgentLink\",\"required\":[\"type\"]},\"BluetoothMeshAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"BluetoothMeshAgentLink\"],\"default\":\"BluetoothMeshAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"appKeyIndex\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":2147483647},\"address\":{\"type\":\"string\",\"pattern\":\"^([0-9A-Fa-f]{4})$\"},\"modelName\":{\"type\":\"string\",\"pattern\":\"^.*\\\\S+.*$\",\"minLength\":1}},\"title\":\"BluetoothMeshAgentLink\",\"required\":[\"type\",\"appKeyIndex\",\"modelName\"]},\"MQTTAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"MQTTAgentLink\"],\"default\":\"MQTTAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"subscriptionTopic\":{\"type\":\"string\",\"description\":\"An MQTT topic to subscribe to, any received payload will be pushed into the attribute; use value filter(s) to extract values from string payloads and/or value converters to do simple value mapping, complex processing may require a rule or a custom MQTT agent\"},\"publishTopic\":{\"type\":\"string\",\"description\":\"An MQTT topic to publish attribute events to, any received payload will be pushed into the attribute; use write value converter and/or write value to do any processing, complex processing may require a rule or a custom MQTT agent\"},\"qos\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":2,\"description\":\"QoS level to use for publish/subscribe (default is 0 if unset)\"}},\"title\":\"MQTTAgentLink\",\"required\":[\"type\"]},\"KNXAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"KNXAgentLink\"],\"default\":\"KNXAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"dpt\":{\"type\":\"string\",\"pattern\":\"^\\\\d{1,3}\\\\.\\\\d{1,3}$\"},\"actionGroupAddress\":{\"type\":\"string\",\"pattern\":\"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$\"},\"statusGroupAddress\":{\"type\":\"string\",\"pattern\":\"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$\"}},\"title\":\"KNXAgentLink\",\"required\":[\"type\",\"dpt\"]},\"SimulatorAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"SimulatorAgentLink\"],\"default\":\"SimulatorAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"replayData\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/SimulatorReplayDatapoint\"},\"description\":\"Used to store 24h dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop.\"}},\"title\":\"SimulatorAgentLink\",\"required\":[\"type\"]},\"SimulatorReplayDatapoint\":{\"type\":\"object\",\"additionalProperties\":true,\"title\":\"Data point\",\"properties\":{\"timestamp\":{\"type\":\"integer\"},\"value\":{\"$ref\":\"#/definitions/AnyType\"}},\"required\":[\"timestamp\"]},\"MailAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"MailAgentLink\"],\"default\":\"MailAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"},\"subjectMatchPredicate\":{\"$ref\":\"#/definitions/StringPredicate\",\"description\":\"The predicate to apply to incoming mail message subjects to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent.\"},\"fromMatchPredicate\":{\"$ref\":\"#/definitions/StringPredicate\",\"description\":\"The predicate to apply to incoming mail message from address(es) to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent.\"},\"useSubject\":{\"type\":\"boolean\",\"description\":\"Use the subject as value instead of the body\"}},\"title\":\"MailAgentLink\",\"required\":[\"type\"]},\"VelbusAgentLink\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"VelbusAgentLink\"],\"default\":\"VelbusAgentLink\"},\"id\":{\"type\":\"string\",\"format\":\"or-agent-id\"},\"deviceAddress\":{\"type\":\"integer\",\"minimum\":1,\"maximum\":255},\"deviceValueLink\":{\"type\":\"string\",\"pattern\":\"^.*\\\\S+.*$\",\"minLength\":1},\"valueFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order\"},\"valueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValueConverter\":{\"type\":\"object\",\"patternProperties\":{\".+\":{\"type\":[\"null\",\"number\",\"integer\",\"boolean\",\"string\",\"array\",\"object\"]}}},\"writeValue\":{\"type\":\"string\",\"format\":\"or-multiline\",\"description\":\"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)\"},\"messageMatchPredicate\":{\"oneOf\":[{\"$ref\":\"#/definitions/StringPredicate\"},{\"$ref\":\"#/definitions/BooleanPredicate\"},{\"$ref\":\"#/definitions/DateTimePredicate\"},{\"$ref\":\"#/definitions/NumberPredicate\"},{\"$ref\":\"#/definitions/RadialGeofencePredicate\"},{\"$ref\":\"#/definitions/RectangularGeofencePredicate\"},{\"$ref\":\"#/definitions/ArrayPredicate\"},{\"$ref\":\"#/definitions/ValueAnyPredicate\"},{\"$ref\":\"#/definitions/ValueEmptyPredicate\"},{\"$ref\":\"#/definitions/CalendarEventPredicate\"}],\"description\":\"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.\"},\"messageMatchFilters\":{\"type\":\"array\",\"items\":{\"oneOf\":[{\"$ref\":\"#/definitions/regex\"},{\"$ref\":\"#/definitions/substring\"},{\"$ref\":\"#/definitions/jsonPath\"},{\"$ref\":\"#/definitions/mathExpression\"}]},\"description\":\"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate\"},\"updateOnWrite\":{\"type\":\"boolean\",\"description\":\"Don't expect a response from the protocol just update the attribute immediately on write\"}},\"title\":\"VelbusAgentLink\",\"required\":[\"type\",\"deviceAddress\",\"deviceValueLink\"]}}}");+ schema = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"Agent Link","oneOf":[{"$ref":"#/definitions/SNMPAgentLink"},{"$ref":"#/definitions/DefaultAgentLink"},{"$ref":"#/definitions/HTTPAgentLink"},{"$ref":"#/definitions/MockAgentLink"},{"$ref":"#/definitions/WebsocketAgentLink"},{"$ref":"#/definitions/ZWaveAgentLink"},{"$ref":"#/definitions/ModbusAgentLink"},{"$ref":"#/definitions/StorageSimulatorAgentLink"},{"$ref":"#/definitions/BluetoothMeshAgentLink"},{"$ref":"#/definitions/MQTTAgentLink"},{"$ref":"#/definitions/KNXAgentLink"},{"$ref":"#/definitions/SimulatorAgentLink"},{"$ref":"#/definitions/MailAgentLink"},{"$ref":"#/definitions/VelbusAgentLink"}],"definitions":{"SNMPAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["SNMPAgentLink"],"default":"SNMPAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"oid":{"type":"string"}},"title":"SNMPAgentLink","required":["type","oid"]},"regex":{"type":"object","additionalProperties":true,"title":"Regex","properties":{"type":{"type":"string","enum":["regex"],"default":"regex"},"pattern":{"type":"string"},"matchGroup":{"type":"integer"},"matchIndex":{"type":"integer"}},"required":["type"]},"substring":{"type":"object","additionalProperties":true,"title":"Substring","properties":{"type":{"type":"string","enum":["substring"],"default":"substring"},"beginIndex":{"type":"integer"},"endIndex":{"type":"integer"}},"required":["type","beginIndex"]},"jsonPath":{"type":"object","additionalProperties":true,"title":"JSON Path","properties":{"type":{"type":"string","enum":["jsonPath"],"default":"jsonPath"},"path":{"type":"string"},"returnFirst":{"type":"boolean"},"returnLast":{"type":"boolean"}},"required":["type","path","returnFirst","returnLast"]},"mathExpression":{"type":"object","additionalProperties":true,"title":"Mathematical Expression","properties":{"type":{"type":"string","enum":["mathExpression"],"default":"mathExpression"},"expression":{"type":"string"}},"required":["type"]},"AnyType":{"type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true,"properties":{}},"StringPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for string values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["string"],"default":"string"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"caseSensitive":{"type":"boolean"},"value":{"type":"string"},"negate":{"type":"boolean"}},"title":"string","required":["predicateType","caseSensitive","negate"]},"BooleanPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for boolean values; will evaluate the value as a boolean and match against this predicates value, any value that is not a boolean will not match","properties":{"predicateType":{"type":"string","enum":["boolean"],"default":"boolean"},"value":{"type":"boolean"}},"title":"boolean","required":["predicateType","value"]},"DateTimePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for date time values; provided values should be valid ISO 8601 datetime strings (e.g. yyyy-MM-dd\'T\'HH:mm:ssZ or yyyy-MM-dd\'T\'HH:mm:ss±HH:mm), offset and time are optional, if no offset information is supplied then UTC is assumed.","properties":{"predicateType":{"type":"string","enum":["datetime"],"default":"datetime"},"value":{"type":"string"},"rangeValue":{"type":"string"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"negate":{"type":"boolean"}},"title":"datetime","required":["predicateType","negate"]},"NumberPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for number values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["number"],"default":"number"},"value":{"type":"number"},"rangeValue":{"type":"number"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"negate":{"type":"boolean"}},"title":"number","required":["predicateType","negate"]},"RadialGeofencePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified radius of the specified latitude and longitude unless negated.","title":"Radial geofence","properties":{"predicateType":{"type":"string","enum":["radial"],"default":"radial"},"radius":{"type":"integer"},"lat":{"type":"number"},"lng":{"type":"number"},"negated":{"type":"boolean"}},"required":["predicateType","radius","lat","lng","negated"]},"RectangularGeofencePredicate":{"type":"object","additionalProperties":true,"description":"Predicate for GEO JSON point values; will return true if the point is within the specified rectangle specified as latitude and longitude values of two corners unless negated.","title":"Rectangular geofence","properties":{"predicateType":{"type":"string","enum":["rect"],"default":"rect"},"latMin":{"type":"number"},"lngMin":{"type":"number"},"latMax":{"type":"number"},"lngMax":{"type":"number"},"negated":{"type":"boolean"}},"required":["predicateType","latMin","lngMin","latMax","lngMax","negated"]},"ArrayPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for array values; will match based on configured options.","properties":{"predicateType":{"type":"string","enum":["array"],"default":"array"},"value":{"$ref":"#/definitions/AnyType"},"index":{"type":"integer"},"lengthEquals":{"type":"integer"},"lengthGreaterThan":{"type":"integer"},"lengthLessThan":{"type":"integer"},"negated":{"type":"boolean"}},"title":"array","required":["predicateType","negated"]},"ValueAnyPredicate":{"type":"object","additionalProperties":true,"description":"Predicate that matches any value including null.","title":"Any value","properties":{"predicateType":{"type":"string","enum":["value-any"],"default":"value-any"}},"required":["predicateType"]},"ValueEmptyPredicate":{"type":"object","additionalProperties":true,"description":"Predicate that matches any empty/null value; unless negated.","title":"Empty value","properties":{"predicateType":{"type":"string","enum":["value-empty"],"default":"value-empty"},"negate":{"type":"boolean"}},"required":["predicateType","negate"]},"CalendarEventPredicate":{"type":"object","additionalProperties":true,"description":"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.","title":"Calendar","properties":{"predicateType":{"type":"string","enum":["calendar-event"],"default":"calendar-event"},"timestamp":{"type":"integer","format":"utc-millisec"}},"required":["predicateType"]},"DefaultAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["DefaultAgentLink"],"default":"DefaultAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"DefaultAgentLink","required":["type"]},"HTTPAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["HTTPAgentLink"],"default":"HTTPAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of headers to be added to HTTP request; the key represents the name of the header and for each string value supplied a new header will be added with the key name and specified string value"},"queryParameters":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"A JSON object of query parameters to be added to HTTP request URL; the key represents the name of the query parameter and for each string value supplied a new query parameter will be added with the key name and specified string value (e.g. \'https://..../?test=1&test=2\')"},"pollingMillis":{"type":"integer","description":"Indicates that this HTTP request is used to update the linked attribute; this value indicates how frequently the HTTP request is made in order to update the linked attribute value"},"pagingMode":{"type":"boolean","description":"Indicates that the HTTP server supports pagination using the standard Link header mechanism"},"path":{"type":"string","description":"The URL path to append to the agents Base URL when making requests for this linked attribute"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE","OPTIONS","PATCH"],"description":"The HTTP method to use when making requests for this linked attribute"},"contentType":{"type":"string","description":"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)"},"pollingAttribute":{"type":"string","description":"Allows the polled response to be written to another attribute with the specified name on the same asset as the linked attribute"},"messageConvertBinary":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to binary string representation"},"messageConvertHex":{"type":"boolean","description":"Indicates that the HTTP response is binary and should be converted to hexadecimal string representation"}},"title":"HTTPAgentLink","required":["type","messageConvertBinary","messageConvertHex"]},"MockAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MockAgentLink"],"default":"MockAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"requiredValue":{"type":"string"}},"title":"MockAgentLink","required":["type"]},"WebsocketAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["WebsocketAgentLink"],"default":"WebsocketAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"websocketSubscriptions":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/websocket"},{"$ref":"#/definitions/http"}]}}},"title":"WebsocketAgentLink","required":["type"]},"websocket":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["websocket"],"default":"websocket"},"body":{"$ref":"#/definitions/AnyType"}},"title":"websocket","required":["type"]},"http":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["http"],"default":"http"},"body":{"$ref":"#/definitions/AnyType"},"method":{"type":"string","enum":["GET","PUT","POST"]},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"uri":{"type":"string"}},"title":"http","required":["type"]},"ZWaveAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["ZWaveAgentLink"],"default":"ZWaveAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"deviceNodeId":{"type":"integer"},"deviceEndpoint":{"type":"integer"},"deviceValue":{"type":"string"}},"title":"ZWaveAgentLink","required":["type"]},"ModbusAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["ModbusAgentLink"],"default":"ModbusAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"pollingMillis":{"type":"integer","description":"Poll interval in milliseconds"},"readMemoryArea":{"type":"string","enum":["COIL","DISCRETE","HOLDING","INPUT"],"description":"Memory area to read from during read request"},"readValueType":{"type":"string","enum":["BOOL","SINT","USINT","BYTE","INT","UINT","WORD","DINT","UDINT","DWORD","LINT","ULINT","LWORD","REAL","LREAL","CHAR","WCHAR"],"description":"Type to convert the returned data to. As specified by the PLC4X Modbus data types."},"readAddress":{"type":"integer","description":"Zero based address from which the value is read from"},"writeMemoryArea":{"type":"string","enum":["COIL","HOLDING"],"description":"Memory area to write to. \\"HOLDING\\" or \\"COIL\\" allowed."},"writeAddress":{"type":"integer","description":"Zero-based address to which the value sent is written to"}},"title":"ModbusAgentLink","required":["type","pollingMillis","readAddress","writeAddress"]},"StorageSimulatorAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["StorageSimulatorAgentLink"],"default":"StorageSimulatorAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"StorageSimulatorAgentLink","required":["type"]},"BluetoothMeshAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["BluetoothMeshAgentLink"],"default":"BluetoothMeshAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"appKeyIndex":{"type":"integer","minimum":0,"maximum":2147483647},"address":{"type":"string","pattern":"^([0-9A-Fa-f]{4})$"},"modelName":{"type":"string","pattern":"^.*\\\\S+.*$","minLength":1}},"title":"BluetoothMeshAgentLink","required":["type","appKeyIndex","modelName"]},"MQTTAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MQTTAgentLink"],"default":"MQTTAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"subscriptionTopic":{"type":"string","description":"An MQTT topic to subscribe to, any received payload will be pushed into the attribute; use value filter(s) to extract values from string payloads and/or value converters to do simple value mapping, complex processing may require a rule or a custom MQTT agent"},"publishTopic":{"type":"string","description":"An MQTT topic to publish attribute events to, any received payload will be pushed into the attribute; use write value converter and/or write value to do any processing, complex processing may require a rule or a custom MQTT agent"},"qos":{"type":"integer","minimum":0,"maximum":2,"description":"QoS level to use for publish/subscribe (default is 0 if unset)"}},"title":"MQTTAgentLink","required":["type"]},"KNXAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["KNXAgentLink"],"default":"KNXAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"dpt":{"type":"string","pattern":"^\\\\d{1,3}\\\\.\\\\d{1,3}$"},"actionGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"statusGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"}},"title":"KNXAgentLink","required":["type","dpt"]},"SimulatorAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["SimulatorAgentLink"],"default":"SimulatorAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"replayData":{"type":"array","items":{"$ref":"#/definitions/SimulatorReplayDatapoint"},"description":"Used to store 24h dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop."}},"title":"SimulatorAgentLink","required":["type"]},"SimulatorReplayDatapoint":{"type":"object","additionalProperties":true,"title":"Data point","properties":{"timestamp":{"type":"integer"},"value":{"$ref":"#/definitions/AnyType"}},"required":["timestamp"]},"MailAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["MailAgentLink"],"default":"MailAgentLink"},"id":{"type":"string","format":"or-agent-id"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"subjectMatchPredicate":{"$ref":"#/definitions/StringPredicate","description":"The predicate to apply to incoming mail message subjects to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"fromMatchPredicate":{"$ref":"#/definitions/StringPredicate","description":"The predicate to apply to incoming mail message from address(es) to determine if the message is intended for the linked attribute. This must be defined to enable attributes to be updated by the linked agent."},"useSubject":{"type":"boolean","description":"Use the subject as value instead of the body"}},"title":"MailAgentLink","required":["type"]},"VelbusAgentLink":{"type":"object","additionalProperties":true,"properties":{"type":{"type":"string","enum":["VelbusAgentLink"],"default":"VelbusAgentLink"},"id":{"type":"string","format":"or-agent-id"},"deviceAddress":{"type":"integer","minimum":1,"maximum":255},"deviceValueLink":{"type":"string","pattern":"^.*\\\\S+.*$","minLength":1},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}}},"writeValue":{"type":"string","format":"or-multiline","description":"String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)"},"messageMatchPredicate":{"oneOf":[{"$ref":"#/definitions/StringPredicate"},{"$ref":"#/definitions/BooleanPredicate"},{"$ref":"#/definitions/DateTimePredicate"},{"$ref":"#/definitions/NumberPredicate"},{"$ref":"#/definitions/RadialGeofencePredicate"},{"$ref":"#/definitions/RectangularGeofencePredicate"},{"$ref":"#/definitions/ArrayPredicate"},{"$ref":"#/definitions/ValueAnyPredicate"},{"$ref":"#/definitions/ValueEmptyPredicate"},{"$ref":"#/definitions/CalendarEventPredicate"}],"description":"The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent."},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/regex"},{"$ref":"#/definitions/substring"},{"$ref":"#/definitions/jsonPath"},{"$ref":"#/definitions/mathExpression"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"}},"title":"VelbusAgentLink","required":["type","deviceAddress","deviceValueLink"]}}}');}loadedAgents = await loadAgents();