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 OpenWeatherMap Agent (#2189)
Dominique Kleevenac4b29e98b29
diff --git a/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapAgent.java b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapAgent.javanew file mode 100644index 000000000..1d22ae28b--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapAgent.java@@ -0,0 +1,78 @@+/*+ * 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.openweathermap;++import java.util.Optional;++import jakarta.persistence.Entity;+import org.openremote.model.asset.agent.Agent;+import org.openremote.model.asset.agent.AgentDescriptor;+import org.openremote.model.attribute.MetaItem;+import org.openremote.model.value.AttributeDescriptor;+import org.openremote.model.value.MetaItemType;+import org.openremote.model.value.ValueType;++@Entity+public class OpenWeatherMapAgent extends Agent<OpenWeatherMapAgent, OpenWeatherMapProtocol, OpenWeatherMapAgentLink> {++ public static final AgentDescriptor<OpenWeatherMapAgent, OpenWeatherMapProtocol, OpenWeatherMapAgentLink> DESCRIPTOR = new AgentDescriptor<>(+ OpenWeatherMapAgent.class, OpenWeatherMapProtocol.class, OpenWeatherMapAgentLink.class);++ public static final AttributeDescriptor<String> API_KEY = new AttributeDescriptor<>("ApiKey", ValueType.TEXT);++ // Read only attribution, required by OpenWeatherMap API+ // Set during protocol start+ public static final AttributeDescriptor<String> ATTRIBUTION = new AttributeDescriptor<>("Attribution", ValueType.TEXT,+ new MetaItem<>(MetaItemType.READ_ONLY));++ // Button to provision a weather asset with the appropriate agent links+ public static final AttributeDescriptor<Boolean> PROVISION_WEATHER_ASSET = new AttributeDescriptor<>("ProvisionWeatherAsset", ValueType.BOOLEAN);++ protected OpenWeatherMapAgent() {+ }++ public OpenWeatherMapAgent(String name) {+ super(name);+ }++ public Optional<String> getAPIKey() {+ return getAttributes().getValue(API_KEY);+ }++ public OpenWeatherMapAgent setAPIKey(String value) {+ getAttributes().getOrCreate(API_KEY).setValue(value);+ return this;+ }++ public Optional<Boolean> getProvisionWeatherAsset() {+ return getAttributes().getValue(PROVISION_WEATHER_ASSET);+ }++ public OpenWeatherMapAgent setProvisionWeatherAsset(Boolean value) {+ getAttributes().getOrCreate(PROVISION_WEATHER_ASSET).setValue(value);+ return this;+ }++ @Override+ public OpenWeatherMapProtocol getProtocolInstance() {+ return new OpenWeatherMapProtocol(this);+ }++}diff --git a/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapAgentLink.java b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapAgentLink.javanew file mode 100644index 000000000..1f44937a3--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapAgentLink.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.openweathermap;++import com.fasterxml.jackson.annotation.JsonPropertyDescription;+import jakarta.validation.constraints.NotNull;+import org.openremote.model.asset.agent.AgentLink;++public class OpenWeatherMapAgentLink extends AgentLink<OpenWeatherMapAgentLink> {++ @NotNull+ @JsonPropertyDescription("Select which weather property (e.g. temperature, humidity) to use as the data source")+ private OpenWeatherMapProperty weatherProperty;++ // For Hydrators+ protected OpenWeatherMapAgentLink() {+ }++ public OpenWeatherMapAgentLink(String id) {+ super(id);+ }++ public OpenWeatherMapProperty getWeatherProperty() {+ return weatherProperty;+ }++ public OpenWeatherMapAgentLink setWeatherProperty(OpenWeatherMapProperty weatherProperty) {+ this.weatherProperty = weatherProperty;+ return this;+ }++}\ No newline at end of filediff --git a/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapProperty.java b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapProperty.javanew file mode 100644index 000000000..e949dc61f--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapProperty.java@@ -0,0 +1,39 @@+/*+ * 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.openweathermap;++/*+ * These are the core weather properties that are returned by the OpenWeatherMap API+ * It is used by the {@link OpenWeatherMapAgentLink} to determine which property to use as the data source for+ * updating the attribute.+ */+public enum OpenWeatherMapProperty {+ TEMPERATURE, // Temperature+ ATMOSPHERIC_PRESSURE, // Atmospheric pressure+ HUMIDITY, // Humidity percentage+ CLOUD_COVERAGE, // Cloud coverage percentage+ WIND_SPEED, // Wind speed (m/s)+ WIND_DIRECTION, // Wind direction (degrees)+ WIND_GUST_SPEED, // Wind gust (m/s)+ PROBABILITY_OF_PRECIPITATION, // Probability of precipitation+ RAIN_AMOUNT, // Rain amount (mm)+ ULTRAVIOLET_INDEX // Ultraviolet index++}diff --git a/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapProtocol.javanew file mode 100644index 000000000..5e0df03f8--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapProtocol.java@@ -0,0 +1,483 @@+/*+ * 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.openweathermap;++import java.util.ArrayList;+import java.util.HashMap;+import java.util.List;+import java.util.Map;+import java.util.concurrent.ScheduledFuture;+import java.util.concurrent.TimeUnit;+import java.util.concurrent.atomic.AtomicReference;+import java.util.logging.Level;+import java.util.logging.Logger;++import org.jboss.resteasy.client.jaxrs.ResteasyClient;+import org.openremote.agent.protocol.AbstractProtocol;+import org.openremote.model.Container;+import org.openremote.model.asset.Asset;+import org.openremote.model.asset.agent.ConnectionStatus;+import org.openremote.model.asset.impl.WeatherAsset;+import org.openremote.model.attribute.Attribute;+import org.openremote.model.attribute.AttributeEvent;+import org.openremote.model.attribute.AttributeRef;+import org.openremote.model.attribute.MetaItem;+import org.openremote.model.datapoint.ValueDatapoint;+import org.openremote.model.geo.GeoJSONPoint;+import org.openremote.model.syslog.SyslogCategory;++import jakarta.ws.rs.core.Response;+import org.openremote.model.util.UniqueIdentifierGenerator;++import static org.openremote.container.web.WebTargetBuilder.createClient;+import static org.openremote.model.syslog.SyslogCategory.PROTOCOL;+import static org.openremote.model.value.MetaItemType.AGENT_LINK;++/**+ * Protocol for integrating with the OpenWeatherMap One Call 3.0 API.+ * <p>+ * This protocol periodically fetches weather data from OpenWeatherMap for all+ * linked asset attributes, grouped by the asset that contains them. Each+ * asset’s location (latitude and longitude) is used to query the API once per+ * asset.+ * <p>+ * For each linked attribute:+ * <ul>+ * <li>The <b>current value</b> is updated using the latest weather data.</li>+ * <li><b>Predicted datapoints</b> (hourly and daily forecasts) are written to+ * enable time-series analysis and visualization in Insights.</li>+ * </ul>+ * <p>+ * A helper action can provision a default {@link WeatherAsset} preconfigured+ * with common weather attributes (temperature, humidity, wind, etc.), each+ * linked to a corresponding {@link OpenWeatherMapProperty}.+ * <p>+ * The agent requires a valid OpenWeatherMap API key+ */+public class OpenWeatherMapProtocol extends AbstractProtocol<OpenWeatherMapAgent, OpenWeatherMapAgentLink> {++ private static final Logger LOG = SyslogCategory.getLogger(PROTOCOL, OpenWeatherMapProtocol.class);+ public static final String PROTOCOL_DISPLAY_NAME = "OpenWeatherMap";+ private static final AtomicReference<ResteasyClient> client = new AtomicReference<>();++ // Initial delay to allow system to populate agent links+ private static final int INITIAL_POLLING_DELAY_MILLIS = 3000; // 3 seconds+ private static final int DEFAULT_POLLING_MILLIS = 3600000; // 1 hour++ protected ScheduledFuture<?> pollingFuture;++ public OpenWeatherMapProtocol(OpenWeatherMapAgent agent) {+ super(agent);+ initClient();+ }++ @Override+ public String getProtocolName() {+ return PROTOCOL_DISPLAY_NAME;+ }++ @Override+ public String getProtocolInstanceUri() {+ return "https://openweathermap.org/";+ }++ @Override+ protected void doStart(Container container) throws Exception {+ setConnectionStatus(ConnectionStatus.CONNECTING);++ if (agent.getAttributes().getValue(OpenWeatherMapAgent.ATTRIBUTION).isEmpty()) {+ setOpenWeatherMapAttribution();+ }++ if (agent.getAPIKey().isEmpty()) {+ setConnectionStatus(ConnectionStatus.ERROR);+ LOG.warning("API key is not set");+ return;+ }++ if (!healthCheck()) {+ setConnectionStatus(ConnectionStatus.ERROR);+ LOG.warning("Could not reach OpenWeatherMap API, either API is unavailable or API key is invalid");+ return;+ }++ // Schedule the polling task+ int pollingMillis = agent.getPollingMillis().orElse(DEFAULT_POLLING_MILLIS);+ pollingFuture = scheduledExecutorService.scheduleAtFixedRate(this::updateAllLinkedAttributes, INITIAL_POLLING_DELAY_MILLIS, pollingMillis,+ TimeUnit.MILLISECONDS);++ setConnectionStatus(ConnectionStatus.CONNECTED);+ }++ @Override+ protected void doStop(Container container) throws Exception {+ // Cancel the polling task+ if (pollingFuture != null) {+ pollingFuture.cancel(true);+ }+ }++ @Override+ public boolean onAgentAttributeChanged(AttributeEvent event) {++ // handle the provision weather asset 'button'+ if (event.getName().equals(OpenWeatherMapAgent.PROVISION_WEATHER_ASSET.getName())) {+ boolean provisionWeatherAsset = (Boolean) event.getValue().orElse(false);+ if (provisionWeatherAsset) {+ provisionWeatherAsset();+ sendAttributeEvent(new AttributeEvent(agent.getId(), OpenWeatherMapAgent.PROVISION_WEATHER_ASSET.getName(), false));+ }++ return false;+ }++ return super.onAgentAttributeChanged(event);+ }++ @Override+ protected void doLinkAttribute(String assetId, Attribute<?> attribute, OpenWeatherMapAgentLink agentLink) throws RuntimeException {+ // Do nothing, this is triggered when a new linked is added to the agent,+ // triggering a weather update here would cause excessive API calls+ }++ @Override+ protected void doUnlinkAttribute(String assetId, Attribute<?> attribute, OpenWeatherMapAgentLink agentLink) {+ // Do nothing+ }++ @Override+ protected void doLinkedAttributeWrite(OpenWeatherMapAgentLink agentLink, AttributeEvent event, Object processedValue) {+ // Do nothing+ }++ /**+ * Update the agent's linked attributes with weather data from the+ * OpenWeatherMap API+ * <p>+ * This method groups all linked attributes by their Asset ID and then updates+ * the weather data for each asset based on its location+ */+ protected void updateAllLinkedAttributes() {+ LOG.fine("Updating all linked attributes with weather data from OpenWeatherMap");++ if (getLinkedAttributes().isEmpty()) {+ LOG.fine("No linked attributes found, skipping weather data update");+ return;+ }++ // <assetId, List<AttributeRef>>+ Map<String, List<AttributeRef>> assetGroups = new HashMap<>();++ // Group the attributes by asset ID+ getLinkedAttributes().forEach((attributeRef, attribute) -> assetGroups.computeIfAbsent(attributeRef.getId(), k -> new ArrayList<>()).add(attributeRef));++ // Update the linked attributes for each asset with weather data+ assetGroups.forEach(this::updateAssetWeatherData);+ }++ /**+ * Update weather data attributes for a specific asset+ *+ * @param assetId the asset ID+ * @param attributeRefs list of attribute references to update+ */+ protected void updateAssetWeatherData(String assetId, List<AttributeRef> attributeRefs) {+ LOG.log(Level.FINE, () -> "Updating weather data for asset: " + assetId);++ Asset<?> asset = assetService.findAsset(assetId);+ if (asset == null) {+ LOG.log(Level.WARNING, () -> "Asset not found for asset: " + assetId);+ return;+ }++ GeoJSONPoint location = asset.getLocation().orElse(null);+ if (location == null) {+ LOG.log(Level.WARNING, () -> "Location not set for asset: " + assetId);+ return;+ }++ // Fetch the weather data for the asset location+ OpenWeatherMapResponse weatherData = fetchWeatherData(buildApiUrl(location.getY(), location.getX()));++ if (weatherData != null) {+ // Update attributes with current weather data+ try {+ updateCurrentValues(attributeRefs, weatherData.getCurrent());+ } catch (Exception e) {+ LOG.log(Level.SEVERE, e, () -> "Failed to update attributes: " + attributeRefs);+ }++ // Write the predicted data points for the daily and hourly forecast+ try {+ updatePredictedDatapoints(attributeRefs, weatherData.getDaily()); // write daily forecast, up to 8 days+ updatePredictedDatapoints(attributeRefs, weatherData.getHourly()); // write hourly forecast, up to 48 hours+ } catch (Exception e) {+ LOG.log(Level.SEVERE, e, () -> "Failed to write predicted data points: " + attributeRefs);+ }+ }+ }++ /**+ * Fetch the weather data from the OpenWeatherMap API for the given API URL+ *+ * @param apiUrl the API URL+ * @return the OpenWeatherMapResponse from the API+ */+ protected OpenWeatherMapResponse fetchWeatherData(String apiUrl) {+ try (Response response = client.get().target(apiUrl).request().get()) {+ if (response.getStatus() == 200) {+ return response.readEntity(OpenWeatherMapResponse.class);+ } else if (response.getStatus() == 401) {+ LOG.warning("API request was unauthorized, either the API key is invalid or the key does not have access to the One Call 3.0 API");+ return null;+ } else {+ LOG.warning("API request failed with status: " + response.getStatus());+ return null;+ }+ } catch (Exception e) {+ LOG.log(Level.WARNING, e, () -> "Failed to fetch weather data");+ return null;+ }+ }++ /**+ * Update values of the linked attributes based on the given weather datapoint+ *+ * @param attributeRefs list of attribute references+ * @param currentWeatherDatapoint the current weather datapoint+ */+ protected void updateCurrentValues(List<AttributeRef> attributeRefs, OpenWeatherMapResponse.WeatherDatapoint currentWeatherDatapoint) {+ for (AttributeRef attributeRef : attributeRefs) {+ OpenWeatherMapProperty weatherProperty = resolveWeatherProperty(attributeRef);++ // Get the corresponding `weatherProperty` value from the weather data object+ Object value = extractWeatherPropertyValue(currentWeatherDatapoint, weatherProperty);++ if (value == null) {+ LOG.log(Level.WARNING, () -> "Weather property or value is null for attribute: " + attributeRef);+ continue;+ }++ updateLinkedAttribute(attributeRef, value);+ }+ }++ /**+ * Update the predicted data points for the given attributes based on the+ * provided list of weather datapoints+ *+ * @param attributeRefs list of attribute references+ * @param weatherDatapoints list of weather datapoints+ */+ protected void updatePredictedDatapoints(List<AttributeRef> attributeRefs, List<OpenWeatherMapResponse.WeatherDatapoint> weatherDatapoints) {+ for (AttributeRef attributeRef : attributeRefs) {++ if (weatherDatapoints == null || weatherDatapoints.isEmpty()) {+ LOG.log(Level.WARNING, () -> "Weather data points are null or empty for attribute: " + attributeRef);+ continue;+ }++ // Build the predicted datapoints+ List<ValueDatapoint<?>> predictedDatapoints = buildPredictedDatapoints(attributeRef, weatherDatapoints);++ // Update the predicted datapoints for the attribute reference+ predictedDatapointService.updateValues(attributeRef.getId(), attributeRef.getName(), predictedDatapoints);+ }+ }++ /**+ * Build a list of predicted datapoints based on the provided weather data and+ * attribute reference+ *+ * @param attributeRef the attribute reference+ * @param weatherData the weather data+ * @return a list of ValueDatapoints+ */+ protected List<ValueDatapoint<?>> buildPredictedDatapoints(AttributeRef attributeRef, List<OpenWeatherMapResponse.WeatherDatapoint> weatherData) {+ List<ValueDatapoint<?>> values = new ArrayList<>();+ OpenWeatherMapProperty weatherProperty = resolveWeatherProperty(attributeRef);++ // Populate the values and timestamps for the attribute+ for (OpenWeatherMapResponse.WeatherDatapoint weatherDataPoint : weatherData) {+ Object value = extractWeatherPropertyValue(weatherDataPoint, weatherProperty);+ values.add(new ValueDatapoint<>(toMillis(weatherDataPoint.getTimestamp()), value));+ }++ return values;+ }++ /**+ * Extract the corresponding `weatherProperty` value from the weather data+ * object+ *+ * @param weatherData the weather datapoint+ * @param weatherProperty the weather property to get the value from+ * @return the corresponding `weatherProperty` value+ */+ protected Object extractWeatherPropertyValue(OpenWeatherMapResponse.WeatherDatapoint weatherData, OpenWeatherMapProperty weatherProperty) {+ return switch (weatherProperty) {+ case TEMPERATURE -> weatherData.getTemperature();+ case ATMOSPHERIC_PRESSURE -> weatherData.getPressure();+ case HUMIDITY -> weatherData.getHumidity();+ case CLOUD_COVERAGE -> weatherData.getClouds();+ case WIND_SPEED -> convertMsToKmh(weatherData.getWindSpeed());+ case WIND_DIRECTION -> weatherData.getWindDegrees();+ case WIND_GUST_SPEED -> convertMsToKmh(weatherData.getWindGust());+ case PROBABILITY_OF_PRECIPITATION -> weatherData.getPop();+ case ULTRAVIOLET_INDEX -> weatherData.getUvi();+ case RAIN_AMOUNT -> weatherData.getRain();+ };+ }++ /**+ * Resolve the OpenWeatherMapProperty for the given attribute reference+ *+ * @param attributeRef the attribute reference+ * @return the OpenWeatherMapProperty+ */+ protected OpenWeatherMapProperty resolveWeatherProperty(AttributeRef attributeRef) {+ Attribute<?> attribute = linkedAttributes.get(attributeRef);+ OpenWeatherMapAgentLink agentLink = agent.getAgentLink(attribute);+ return agentLink.getWeatherProperty();+ }++ /**+ * Build the OpenWeatherMap API URL for the given latitude and longitude (One+ * Call 3.0 API)+ *+ * @param latitude the latitude+ * @param longitude the longitude+ * @return the OpenWeatherMap API URL+ */+ protected String buildApiUrl(double latitude, double longitude) {+ String apiKey = agent.getAPIKey().orElseThrow(() -> new IllegalStateException("API key is not set"));+ return "https://api.openweathermap.org/data/3.0/onecall?lat=" + latitude + "&lon=" + longitude + "&units=metric&exclude=alerts,minutely&appid="+ + apiKey;+ }++ /**+ * Perform a health check by sending a request to the OpenWeatherMap API+ *+ * @return true if the health check is successful, false otherwise+ */+ protected boolean healthCheck() {+ String apiUrl = buildApiUrl(0, 0);+ try (Response response = client.get().target(apiUrl).request().get()) {+ if (response.getStatus() != 200) {+ LOG.warning("Health check failed with status: " + response.getStatus());+ return false;+ } else {+ return true;+ }+ } catch (Exception e) {+ LOG.log(Level.WARNING, e, () -> "Failed to perform health check");+ return false;+ }+ }++ /**+ * Provision a weather asset with the appropriate agent links, location needs to+ * be manually configured after provisioning+ */+ protected WeatherAsset provisionWeatherAsset() {+ WeatherAsset weatherAsset = new WeatherAsset("Weather");+ weatherAsset.setParentId(agent.getId());+ weatherAsset.setRealm(agent.getRealm());+ weatherAsset.setId(UniqueIdentifierGenerator.generateId());++ // Temperature+ weatherAsset.getAttribute(WeatherAsset.TEMPERATURE).ifPresent(attribute -> attribute.addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.TEMPERATURE))));++ // Humidity+ weatherAsset.getAttribute(WeatherAsset.HUMIDITY).ifPresent(attribute -> attribute+ .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.HUMIDITY))));+ // Wind Speed+ weatherAsset.getAttribute(WeatherAsset.WIND_SPEED).ifPresent(attribute -> attribute.addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.WIND_SPEED))));++ // Wind Direction+ weatherAsset.getAttribute(WeatherAsset.WIND_DIRECTION).ifPresent(attribute -> attribute.addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.WIND_DIRECTION))));++ // Rain Amount+ weatherAsset.getAttribute(WeatherAsset.RAINFALL).ifPresent(attribute -> attribute.addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.RAIN_AMOUNT))));++ // Ultraviolet Index+ weatherAsset.getAttribute(WeatherAsset.UV_INDEX).ifPresent(attribute -> attribute.addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.ULTRAVIOLET_INDEX))));++ // Atmospheric Pressure (optional attribute)+ weatherAsset.getAttributes().getOrCreate(WeatherAsset.ATMOSPHERIC_PRESSURE).addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.ATMOSPHERIC_PRESSURE)));++ // Wind Gust Speed (optional attribute)+ weatherAsset.getAttributes().getOrCreate(WeatherAsset.WIND_GUST_SPEED).addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.WIND_GUST_SPEED)));++ // Cloud Coverage (optional attribute)+ weatherAsset.getAttributes().getOrCreate(WeatherAsset.CLOUD_COVERAGE).addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.CLOUD_COVERAGE)));++ // Probability of Precipitation (optional attribute)+ weatherAsset.getAttributes().getOrCreate(WeatherAsset.PROBABILITY_OF_PRECIPITATION).addOrReplaceMeta(+ new MetaItem<>(AGENT_LINK, new OpenWeatherMapAgentLink(agent.getId()).setWeatherProperty(OpenWeatherMapProperty.PROBABILITY_OF_PRECIPITATION)));++ return assetService.mergeAsset(weatherAsset);+ }++ /**+ * Set the required attribution for the OpenWeatherMap API+ */+ protected void setOpenWeatherMapAttribution() {+ sendAttributeEvent(new AttributeEvent(agent.getId(), OpenWeatherMapAgent.ATTRIBUTION.getName(),+ "Weather data provided by OpenWeather (https://openweathermap.org/)"));+ }++ protected static void initClient() {+ synchronized (client) {+ if (client.get() == null) {+ client.set(createClient(org.openremote.container.Container.SCHEDULED_EXECUTOR));+ }+ }+ }++ /**+ * Convert meters per second to kilometers per hour+ *+ * @param value the value to convert+ * @return the converted value rounded to 2 decimal places+ */+ protected static double convertMsToKmh(double value) {+ return Math.round(value * 3.6 * 100.0) / 100.0;+ }++ /**+ * Convert seconds to milliseconds+ *+ * @param timestamp the timestamp to convert+ * @return the converted value+ */+ protected static long toMillis(long timestamp) {+ return timestamp * 1000;+ }++}diff --git a/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapResponse.java b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapResponse.javanew file mode 100644index 000000000..f30f15c0a--- /dev/null+++ b/agent/src/main/java/org/openremote/agent/protocol/openweathermap/OpenWeatherMapResponse.java@@ -0,0 +1,316 @@+/*+ * 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.openweathermap;++import com.fasterxml.jackson.annotation.JsonIgnoreProperties;+import com.fasterxml.jackson.annotation.JsonProperty;+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;++import java.util.List;++/**+ * The response object from the OpenWeatherMap API, trimmed down to only include+ * the core weather properties+ */+@JsonIgnoreProperties(ignoreUnknown = true)+public class OpenWeatherMapResponse {++ @JsonProperty("current")+ @JsonDeserialize(as = WeatherDatapointImpl.class)+ private WeatherDatapoint current;++ @JsonProperty("hourly")+ @JsonDeserialize(contentAs = WeatherDatapointImpl.class)+ private List<WeatherDatapoint> hourly;++ @JsonProperty("daily")+ @JsonDeserialize(contentAs = DailyWeatherDatapointImpl.class)+ private List<WeatherDatapoint> daily;++ public OpenWeatherMapResponse() {+ }++ public WeatherDatapoint getCurrent() {+ return current;+ }++ public List<WeatherDatapoint> getHourly() {+ return hourly;+ }++ public List<WeatherDatapoint> getDaily() {+ return daily;+ }++ public interface WeatherDatapoint {+ long getTimestamp();++ int getPressure();++ int getHumidity();++ double getTemperature();++ double getWindSpeed();++ int getWindDegrees();++ double getWindGust();++ int getClouds();++ double getPop();++ double getUvi();++ double getRain();+ }++ @JsonIgnoreProperties(ignoreUnknown = true)+ public static class WeatherDatapointImpl implements WeatherDatapoint {++ @JsonProperty("dt")+ private long timestamp;++ @JsonProperty("temp")+ private double temperature;++ @JsonProperty("pressure")+ private int pressure;++ @JsonProperty("humidity")+ private int humidity;++ @JsonProperty("clouds")+ private int clouds;++ @JsonProperty("wind_speed")+ private double windSpeed;++ @JsonProperty("wind_deg")+ private int windDegrees;++ @JsonProperty("wind_gust")+ private double windGust;++ @JsonProperty("pop")+ private double pop;++ @JsonProperty("uvi")+ private double uvi;++ @JsonProperty("rain")+ private Rain rain;++ public WeatherDatapointImpl() {+ }++ public long getTimestamp() {+ return timestamp;+ }++ public double getTemperature() {+ return temperature;+ }++ public int getPressure() {+ return pressure;+ }++ public int getHumidity() {+ return humidity;+ }++ public int getClouds() {+ return clouds;+ }++ public double getWindSpeed() {+ return windSpeed;+ }++ public int getWindDegrees() {+ return windDegrees;+ }++ public double getWindGust() {+ return windGust;+ }++ public double getPop() {+ return pop;+ }++ public double getUvi() {+ return uvi;+ }++ public double getRain() {+ return rain != null ? rain.getOneHour() : 0.0;+ }++ }++ @JsonIgnoreProperties(ignoreUnknown = true)+ public static class DailyWeatherDatapointImpl implements WeatherDatapoint {+ @JsonProperty("dt")+ private long timestamp;++ @JsonProperty("temp")+ private Temp temperature;++ @JsonProperty("pressure")+ private int pressure;++ @JsonProperty("humidity")+ private int humidity;++ @JsonProperty("wind_speed")+ private double windSpeed;++ @JsonProperty("wind_deg")+ private int windDegrees;++ @JsonProperty("wind_gust")+ private double windGust;++ @JsonProperty("clouds")+ private int clouds;++ @JsonProperty("pop")+ private double pop;++ @JsonProperty("rain")+ private Double rain;++ @JsonProperty("uvi")+ private double uvi;++ public DailyWeatherDatapointImpl() {+ }++ public long getTimestamp() {+ return timestamp;+ }++ public int getPressure() {+ return pressure;+ }++ public int getHumidity() {+ return humidity;+ }++ // Temperature is a sub-object, so we need to get the day temperature+ public double getTemperature() {+ return temperature.getDay();+ }++ public double getWindSpeed() {+ return windSpeed;+ }++ public int getWindDegrees() {+ return windDegrees;+ }++ public double getWindGust() {+ return windGust;+ }++ public int getClouds() {+ return clouds;+ }++ public double getPop() {+ return pop;+ }++ public double getUvi() {+ return uvi;+ }++ public double getRain() {+ return rain != null ? rain : 0.0;+ }+ }++ @JsonIgnoreProperties(ignoreUnknown = true)+ public static class Temp {+ @JsonProperty("day")+ private double day;++ @JsonProperty("min")+ private double min;++ @JsonProperty("max")+ private double max;++ @JsonProperty("night")+ private double night;++ @JsonProperty("eve")+ private double eve;++ @JsonProperty("morn")+ private double morn;++ public Temp() {+ }++ public double getDay() {+ return day;+ }++ public double getMin() {+ return min;+ }++ public double getMax() {+ return max;+ }++ public double getNight() {+ return night;+ }++ public double getEve() {+ return eve;+ }++ public double getMorn() {+ return morn;+ }+ }++ @JsonIgnoreProperties(ignoreUnknown = true)+ public static class Rain {+ @JsonProperty("1h")+ private double oneHour;++ public Rain() {+ }++ public double getOneHour() {+ return oneHour;+ }+ }++}diff --git a/model/src/main/java/org/openremote/model/asset/impl/WeatherAsset.java b/model/src/main/java/org/openremote/model/asset/impl/WeatherAsset.javaindex 688d7884a..250a94744 100644--- a/model/src/main/java/org/openremote/model/asset/impl/WeatherAsset.java+++ b/model/src/main/java/org/openremote/model/asset/impl/WeatherAsset.java@@ -66,6 +66,23 @@ public class WeatherAsset extends Asset<WeatherAsset> {public static final AttributeDescriptor<Integer> HUMIDITY = new AttributeDescriptor<>("humidity", ValueType.POSITIVE_INTEGER,new MetaItem<>(MetaItemType.READ_ONLY)).withUnits(UNITS_PERCENTAGE).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100));+ public static final AttributeDescriptor<Double> ATMOSPHERIC_PRESSURE = new AttributeDescriptor<>("atmosphericPressure", ValueType.POSITIVE_NUMBER,+ new MetaItem<>(MetaItemType.READ_ONLY)+ ).withUnits(UNITS_HECTO, UNITS_PASCAL)+ .withOptional(true);+ public static final AttributeDescriptor<Integer> CLOUD_COVERAGE = new AttributeDescriptor<>("cloudCoverage", ValueType.POSITIVE_INTEGER,+ new MetaItem<>(MetaItemType.READ_ONLY)+ ).withUnits(UNITS_PERCENTAGE)+ .withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(100))+ .withOptional(true);+ public static final AttributeDescriptor<Double> WIND_GUST_SPEED = new AttributeDescriptor<>("windGustSpeed", ValueType.POSITIVE_NUMBER,+ new MetaItem<>(MetaItemType.READ_ONLY)+ ).withUnits(UNITS_KILO, UNITS_METRE, UNITS_PER, UNITS_HOUR)+ .withOptional(true);+ public static final AttributeDescriptor<Double> PROBABILITY_OF_PRECIPITATION = new AttributeDescriptor<>("probabilityOfPrecipitation", ValueType.POSITIVE_NUMBER,+ new MetaItem<>(MetaItemType.READ_ONLY)+ ).withConstraints(new ValueConstraint.Min(0), new ValueConstraint.Max(1))+ .withOptional(true);public static final AssetDescriptor<WeatherAsset> DESCRIPTOR = new AssetDescriptor<>("weather-partly-cloudy", "49B0D8", WeatherAsset.class);@@ -110,4 +127,20 @@ public class WeatherAsset extends Asset<WeatherAsset> {public Optional<Integer> getHumidity() {return getAttributes().getValue(HUMIDITY);}++ public Optional<Double> getAtmosphericPressure() {+ return getAttributes().getValue(ATMOSPHERIC_PRESSURE);+ }++ public Optional<Integer> getCloudCoverage() {+ return getAttributes().getValue(CLOUD_COVERAGE);+ }++ public Optional<Double> getWindGustSpeed() {+ return getAttributes().getValue(WIND_GUST_SPEED);+ }++ public Optional<Double> getProbabilityOfPrecipitation() {+ return getAttributes().getValue(PROBABILITY_OF_PRECIPITATION);+ }}diff --git a/test/src/test/groovy/org/openremote/test/protocol/openweathermap/OpenWeatherMapProtocolTest.groovy b/test/src/test/groovy/org/openremote/test/protocol/openweathermap/OpenWeatherMapProtocolTest.groovynew file mode 100644index 000000000..944924726--- /dev/null+++ b/test/src/test/groovy/org/openremote/test/protocol/openweathermap/OpenWeatherMapProtocolTest.groovy@@ -0,0 +1,418 @@+/*+ * 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.openweathermap++import org.openremote.agent.protocol.openweathermap.OpenWeatherMapAgent+import org.openremote.agent.protocol.openweathermap.OpenWeatherMapAgentLink+import org.openremote.agent.protocol.openweathermap.OpenWeatherMapProtocol+import org.openremote.agent.protocol.openweathermap.OpenWeatherMapProperty+import org.openremote.agent.protocol.openweathermap.OpenWeatherMapResponse+import org.openremote.manager.agent.AgentService+import org.openremote.manager.asset.AssetProcessingService+import org.openremote.manager.asset.AssetStorageService+import org.openremote.manager.datapoint.AssetPredictedDatapointService+import org.openremote.model.asset.agent.ConnectionStatus+import org.openremote.model.asset.impl.WeatherAsset+import org.openremote.model.attribute.Attribute+import org.openremote.model.attribute.AttributeEvent+import org.openremote.model.attribute.AttributeRef+import org.openremote.model.attribute.MetaItem+import org.openremote.model.geo.GeoJSONPoint+import org.openremote.model.util.ValueUtil+import org.openremote.test.ManagerContainerTrait+import spock.lang.Shared+import spock.lang.Specification+import spock.util.concurrent.PollingConditions++import jakarta.ws.rs.client.ClientRequestContext+import jakarta.ws.rs.client.ClientRequestFilter+import jakarta.ws.rs.core.MediaType+import jakarta.ws.rs.core.Response+import java.time.LocalDateTime+import java.time.ZoneOffset+import java.time.temporal.ChronoUnit++import static org.openremote.model.Constants.MASTER_REALM+import static org.openremote.model.value.MetaItemType.AGENT_LINK++class OpenWeatherMapProtocolTest extends Specification implements ManagerContainerTrait {++ @Shared+ def mockServer = new ClientRequestFilter() {++ @Override+ void filter(ClientRequestContext requestContext) throws IOException {+ def requestUri = requestContext.uri++ switch (requestUri.host) {+ case "api.openweathermap.org":+ if (requestUri.path.startsWith("/data/3.0/onecall")) {+ def now = LocalDateTime.now().truncatedTo(ChronoUnit.HOURS)++ // Extract location from query parameters+ def queryParams = requestUri.query.split("&")+ def lat = queryParams.find { it.startsWith("lat=") }?.split("=")[1]+ def lon = queryParams.find { it.startsWith("lon=") }?.split("=")[1]++ def content+ if (lat == "52.3676" && lon == "4.9041") {+ // Amsterdam weather data+ content = """{+ "current": {+ "dt": ${now.toEpochSecond(ZoneOffset.UTC)},+ "temp": 15.5,+ "pressure": 1013,+ "humidity": 65,+ "wind_speed": 3.2,+ "wind_deg": 180,+ "wind_gust": 4.1,+ "clouds": 20,+ "uvi": 2.5,+ "pop": 0.1,+ "rain": {"1h": 0.5}+ },+ "hourly": [+ {+ "dt": ${now.toEpochSecond(ZoneOffset.UTC)},+ "temp": 15.5,+ "pressure": 1013,+ "humidity": 65,+ "wind_speed": 3.2,+ "wind_deg": 180,+ "wind_gust": 4.1,+ "clouds": 20,+ "uvi": 2.5,+ "pop": 0.1,+ "rain": {"1h": 0.5}+ },+ {+ "dt": ${now.plusHours(1).toEpochSecond(ZoneOffset.UTC)},+ "temp": 16.2,+ "pressure": 1012,+ "humidity": 68,+ "wind_speed": 3.8,+ "wind_deg": 185,+ "wind_gust": 4.5,+ "clouds": 25,+ "uvi": 2.8,+ "pop": 0.15,+ "rain": {"1h": 0.2}+ }+ ],+ "daily": [+ {+ "dt": ${now.toEpochSecond(ZoneOffset.UTC)},+ "temp": {"day": 18.5, "min": 12.0, "max": 22.0, "night": 14.0, "eve": 16.0, "morn": 13.0},+ "pressure": 1013,+ "humidity": 65,+ "wind_speed": 3.2,+ "wind_deg": 180,+ "wind_gust": 4.1,+ "clouds": 20,+ "uvi": 2.5,+ "pop": 0.1,+ "rain": 0.5+ },+ {+ "dt": ${now.plusDays(1).toEpochSecond(ZoneOffset.UTC)},+ "temp": {"day": 19.2, "min": 13.0, "max": 23.0, "night": 15.0, "eve": 17.0, "morn": 14.0},+ "pressure": 1011,+ "humidity": 70,+ "wind_speed": 3.5,+ "wind_deg": 185,+ "wind_gust": 4.8,+ "clouds": 30,+ "uvi": 2.7,+ "pop": 0.2,+ "rain": 1.2+ }+ ]+ }"""++ } else if (lat == "51.5072" && lon == "-0.1276") {+ // London weather data (different values)+ content = """{+ "current": {+ "dt": ${now.toEpochSecond(ZoneOffset.UTC)},+ "temp": 12.3,+ "pressure": 1008,+ "humidity": 78,+ "wind_speed": 4.5,+ "wind_deg": 220,+ "wind_gust": 5.2,+ "clouds": 45,+ "uvi": 1.8,+ "pop": 0.3,+ "rain": {"1h": 1.2}+ },+ "hourly": [+ {+ "dt": ${now.toEpochSecond(ZoneOffset.UTC)},+ "temp": 12.3,+ "pressure": 1008,+ "humidity": 78,+ "wind_speed": 4.5,+ "wind_deg": 220,+ "wind_gust": 5.2,+ "clouds": 45,+ "uvi": 1.8,+ "pop": 0.3,+ "rain": {"1h": 1.2}+ },+ {+ "dt": ${now.plusHours(1).toEpochSecond(ZoneOffset.UTC)},+ "temp": 11.8,+ "pressure": 1007,+ "humidity": 82,+ "wind_speed": 5.1,+ "wind_deg": 225,+ "wind_gust": 5.8,+ "clouds": 60,+ "uvi": 1.5,+ "pop": 0.4,+ "rain": {"1h": 0.8}+ }+ ],+ "daily": [+ {+ "dt": ${now.toEpochSecond(ZoneOffset.UTC)},+ "temp": {"day": 14.2, "min": 8.5, "max": 16.0, "night": 10.0, "eve": 13.0, "morn": 9.0},+ "pressure": 1008,+ "humidity": 78,+ "wind_speed": 4.5,+ "wind_deg": 220,+ "wind_gust": 5.2,+ "clouds": 45,+ "uvi": 1.8,+ "pop": 0.3,+ "rain": 1.2+ },+ {+ "dt": ${now.plusDays(1).toEpochSecond(ZoneOffset.UTC)},+ "temp": {"day": 13.8, "min": 7.2, "max": 15.5, "night": 9.5, "eve": 12.5, "morn": 8.5},+ "pressure": 1005,+ "humidity": 85,+ "wind_speed": 4.8,+ "wind_deg": 230,+ "wind_gust": 6.1,+ "clouds": 70,+ "uvi": 1.6,+ "pop": 0.5,+ "rain": 2.1+ }+ ]+ }"""+ }++ def responseBody = ValueUtil.JSON.readValue(content, OpenWeatherMapResponse.class)+ requestContext.abortWith(+ Response.ok(responseBody, MediaType.APPLICATION_JSON_TYPE).build()+ )+ return+ }+ break+ }++ requestContext.abortWith(Response.serverError().build())+ }+ }++ def "OpenWeatherMap Integration Tests"() {+ given: "the container environment is started"+ def conditions = new PollingConditions(timeout: 10, delay: 0.2)++ OpenWeatherMapProtocol.initClient()++ if (!OpenWeatherMapProtocol.client.get().configuration.isRegistered(mockServer)) {+ OpenWeatherMapProtocol.client.get().register(mockServer, Integer.MAX_VALUE)+ }++ def container = startContainer(defaultConfig(), defaultServices())+ def assetStorageService = container.getService(AssetStorageService.class)+ def assetPredictedDatapointService = container.getService(AssetPredictedDatapointService.class)+ def agentService = container.getService(AgentService.class)++ when: "a OpenWeatherMap agent is created"+ def agent = new OpenWeatherMapAgent("Weather Agent")+ agent.setRealm(MASTER_REALM)+ agent.setAPIKey("test-key")+ agent = assetStorageService.merge(agent)++ then: "the protocol instance for the agent should be created"+ conditions.eventually {+ assert agentService.getProtocolInstance(agent.id) != null+ assert ((OpenWeatherMapProtocol)agentService.getProtocolInstance(agent.id)) != null+ }++ and: "the connection status for the agent should be CONNECTED"+ conditions.eventually {+ agent = assetStorageService.find(agent.getId())+ agentService.getAgent(agent.id).getAgentStatus().orElse(null) == ConnectionStatus.CONNECTED+ }++ when: "a weather asset is provisioned"+ def protocol = (OpenWeatherMapProtocol) agentService.getProtocolInstance(agent.id)+ def weatherAsset = protocol.provisionWeatherAsset()++ then: "the weather asset should be provisioned"+ conditions.eventually {+ weatherAsset = assetStorageService.find(weatherAsset.id)+ assert weatherAsset != null+ assert weatherAsset.id != null+ assert weatherAsset.name == "Weather"+ assert weatherAsset.realm == agent.realm+ assert weatherAsset.parentId == agent.id+ }++ and: "the attributes for the weather asset should be linked to the agent"+ conditions.eventually {+ assert weatherAsset.getAttribute(WeatherAsset.TEMPERATURE).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.HUMIDITY).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.ATMOSPHERIC_PRESSURE).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.WIND_SPEED).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.WIND_DIRECTION).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.WIND_GUST_SPEED).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.CLOUD_COVERAGE).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.PROBABILITY_OF_PRECIPITATION).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.RAINFALL).get().hasMeta(AGENT_LINK)+ assert weatherAsset.getAttribute(WeatherAsset.UV_INDEX).get().hasMeta(AGENT_LINK)+ }+++ when: "a weather update is triggered but the weather asset has no location set"+ protocol.updateAllLinkedAttributes()++ then: "no weather data should be updated since location is unknown"+ conditions.eventually {+ weatherAsset = assetStorageService.find(weatherAsset.id)+ assert weatherAsset.getAttribute(WeatherAsset.TEMPERATURE).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.HUMIDITY).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.ATMOSPHERIC_PRESSURE).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.WIND_SPEED).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.WIND_DIRECTION).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.WIND_GUST_SPEED).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.CLOUD_COVERAGE).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.PROBABILITY_OF_PRECIPITATION).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.RAINFALL).get().getValue().orElse(null) == null+ assert weatherAsset.getAttribute(WeatherAsset.UV_INDEX).get().getValue().orElse(null) == null+ }++ when: "the weather asset has its location set"+ weatherAsset.setLocation(new GeoJSONPoint(4.9041d, 52.3676d))+ weatherAsset = assetStorageService.merge(weatherAsset)++ then: "the weather asset should have its location set"+ conditions.eventually {+ weatherAsset = assetStorageService.find(weatherAsset.id)+ assert weatherAsset != null+ assert weatherAsset.getLocation().map{it.x}.orElse(null) == 4.9041d+ assert weatherAsset.getLocation().map{it.y}.orElse(null) == 52.3676d+ }++ when: "a weather update is triggered"+ protocol.updateAllLinkedAttributes()++ then: "the weather data should be updated with current values according to the asset's location"+ conditions.eventually {+ weatherAsset = assetStorageService.find(weatherAsset.id)+ assert weatherAsset.getAttribute(WeatherAsset.TEMPERATURE).get().getValue().orElse(null) == 15.5d+ assert weatherAsset.getAttribute(WeatherAsset.HUMIDITY).get().getValue().orElse(null) == 65+ assert weatherAsset.getAttribute(WeatherAsset.ATMOSPHERIC_PRESSURE).get().getValue().orElse(null) == 1013+ assert weatherAsset.getAttribute(WeatherAsset.WIND_SPEED).get().getValue().orElse(null) == OpenWeatherMapProtocol.convertMsToKmh(3.2d)+ assert weatherAsset.getAttribute(WeatherAsset.WIND_DIRECTION).get().getValue().orElse(null) == 180+ assert weatherAsset.getAttribute(WeatherAsset.WIND_GUST_SPEED).get().getValue().orElse(null) == OpenWeatherMapProtocol.convertMsToKmh(4.1d)+ assert weatherAsset.getAttribute(WeatherAsset.CLOUD_COVERAGE).get().getValue().orElse(null) == 20+ assert weatherAsset.getAttribute(WeatherAsset.PROBABILITY_OF_PRECIPITATION).get().getValue().orElse(null) == 0.1d+ assert weatherAsset.getAttribute(WeatherAsset.RAINFALL).get().getValue().orElse(null) == 0.5d+ assert weatherAsset.getAttribute(WeatherAsset.UV_INDEX).get().getValue().orElse(null) == 2.5d+ }++ and: "the predicted data points should be written"+ conditions.eventually {+ // We expect 3 predicted datapoints (response has 4, but 3 unique timestamps)+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.TEMPERATURE.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.HUMIDITY.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.ATMOSPHERIC_PRESSURE.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.WIND_SPEED.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.WIND_DIRECTION.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.WIND_GUST_SPEED.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.CLOUD_COVERAGE.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.PROBABILITY_OF_PRECIPITATION.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.RAINFALL.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset.id, WeatherAsset.UV_INDEX.name)).size() == 3+ }++ when: "another weather asset is provisioned with a different location"+ def weatherAsset2 = protocol.provisionWeatherAsset()+ weatherAsset2.setLocation(new GeoJSONPoint(-0.1276d, 51.5072d))+ weatherAsset2 = assetStorageService.merge(weatherAsset2)++ then: "the weather asset should be available and have its location set"+ conditions.eventually {+ weatherAsset2 = assetStorageService.find(weatherAsset2.id)+ assert weatherAsset2 != null+ assert weatherAsset2.id != null+ assert weatherAsset2.name == "Weather"+ assert weatherAsset2.realm == agent.realm+ assert weatherAsset2.parentId == agent.id+ assert weatherAsset2.getLocation().map{it.x}.orElse(null) == -0.1276d+ assert weatherAsset2.getLocation().map{it.y}.orElse(null) == 51.5072d+ }++ when: "a weather update is triggered"+ protocol.updateAllLinkedAttributes()++ then: "the weather data should be updated with current values according to the asset's location"+ conditions.eventually {+ weatherAsset2 = assetStorageService.find(weatherAsset2.id)+ assert weatherAsset2.getAttribute(WeatherAsset.TEMPERATURE).get().getValue().orElse(null) == 12.3d+ assert weatherAsset2.getAttribute(WeatherAsset.HUMIDITY).get().getValue().orElse(null) == 78+ assert weatherAsset2.getAttribute(WeatherAsset.ATMOSPHERIC_PRESSURE).get().getValue().orElse(null) == 1008+ assert weatherAsset2.getAttribute(WeatherAsset.WIND_SPEED).get().getValue().orElse(null) == OpenWeatherMapProtocol.convertMsToKmh(4.5d)+ assert weatherAsset2.getAttribute(WeatherAsset.WIND_DIRECTION).get().getValue().orElse(null) == 220+ assert weatherAsset2.getAttribute(WeatherAsset.WIND_GUST_SPEED).get().getValue().orElse(null) == OpenWeatherMapProtocol.convertMsToKmh(5.2d)+ assert weatherAsset2.getAttribute(WeatherAsset.CLOUD_COVERAGE).get().getValue().orElse(null) == 45+ assert weatherAsset2.getAttribute(WeatherAsset.PROBABILITY_OF_PRECIPITATION).get().getValue().orElse(null) == 0.3d+ assert weatherAsset2.getAttribute(WeatherAsset.RAINFALL).get().getValue().orElse(null) == 1.2d+ assert weatherAsset2.getAttribute(WeatherAsset.UV_INDEX).get().getValue().orElse(null) == 1.8d+ }++ and: "the predicted data points should be written"+ conditions.eventually {+ // We expect 3 predicted datapoints (response has 4, but 3 unique timestamps)+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.TEMPERATURE.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.HUMIDITY.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.ATMOSPHERIC_PRESSURE.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.WIND_SPEED.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.WIND_DIRECTION.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.WIND_GUST_SPEED.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.CLOUD_COVERAGE.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.PROBABILITY_OF_PRECIPITATION.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.RAINFALL.name)).size() == 3+ assert assetPredictedDatapointService.getDatapoints(new AttributeRef(weatherAsset2.id, WeatherAsset.UV_INDEX.name)).size() == 3+ }+++ cleanup: "remove mock client"+ if (OpenWeatherMapProtocol.client.get() != null) {+ OpenWeatherMapProtocol.client.set(null)+ }+ }+}diff --git a/ui/component/or-attribute-input/src/index.ts b/ui/component/or-attribute-input/src/index.tsindex 4393b877a..d3bfcd1e0 100644--- a/ui/component/or-attribute-input/src/index.ts+++ b/ui/component/or-attribute-input/src/index.ts@@ -173,7 +173,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#","definitions":{"ArrayPredicate":{"type":"object","properties":{"index":{"type":"integer"},"lengthEquals":{"type":"integer"},"lengthGreaterThan":{"type":"integer"},"lengthLessThan":{"type":"integer"},"negated":{"type":"boolean"},"value":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"type":{"const":"array","default":"array"}},"required":["negated","type"],"title":"Array Predicate","additionalProperties":true,"description":"Predicate for array values; will match based on configured options."},"BluetoothMeshAgentLink":{"type":"object","properties":{"address":{"type":"string","pattern":"^([0-9A-Fa-f]{4})$"},"appKeyIndex":{"type":"integer","minimum":0,"maximum":2147483647},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"modelName":{"type":"string","minLength":1},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"BluetoothMeshAgentLink","default":"BluetoothMeshAgentLink"}},"required":["appKeyIndex","modelName","type"],"title":"Bluetooth Mesh Agent Link","additionalProperties":true},"BooleanPredicate":{"type":"object","properties":{"value":{"type":"boolean"},"type":{"const":"boolean","default":"boolean"}},"required":["value","type"],"title":"Boolean Predicate","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"},"CalendarEventPredicate":{"type":"object","properties":{"timestamp":{"type":"integer","format":"utc-millisec"},"type":{"const":"calendar-event","default":"calendar-event"}},"title":"Calendar","additionalProperties":true,"description":"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.","required":["type"]},"DateTimePredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"rangeValue":{"type":"string"},"value":{"type":"string"},"type":{"const":"datetime","default":"datetime"}},"required":["negate","type"],"title":"Date Time Predicate","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."},"DefaultAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"DefaultAgentLink","default":"DefaultAgentLink"}},"title":"Default Agent Link","additionalProperties":true},"HTTPAgentLink":{"type":"object","properties":{"contentType":{"type":"string","description":"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)"},"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"},"id":{"type":"string","format":"or-agent-id"},"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"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"method":{"type":"string","enum":["GET","POST","PUT","DELETE","OPTIONS","PATCH"],"description":"The HTTP method to use when making requests for this linked attribute"},"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"},"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"},"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"},"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\')"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"HTTPAgentLink","default":"HTTPAgentLink"}},"required":["messageConvertBinary","messageConvertHex","type"],"title":"HTTP Agent Link","additionalProperties":true},"JsonPathFilter":{"type":"object","properties":{"path":{"type":"string"},"returnFirst":{"type":"boolean"},"returnLast":{"type":"boolean"},"type":{"const":"jsonPath","default":"jsonPath"}},"required":["path","returnFirst","returnLast","type"],"title":"JSON Path","additionalProperties":true},"KNXAgentLink":{"type":"object","properties":{"actionGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"dpt":{"type":"string","pattern":"^\\\\d{1,3}\\\\.\\\\d{1,3}$"},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"statusGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"KNXAgentLink","default":"KNXAgentLink"}},"required":["dpt","type"],"title":"KNX Agent Link","additionalProperties":true},"MQTTAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"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","description":"QoS level to use for publish/subscribe (default is 0 if unset)","minimum":0,"maximum":2},"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"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MQTTAgentLink","default":"MQTTAgentLink"}},"title":"MQTT Agent Link","additionalProperties":true,"required":["type"]},"MailAgentLink":{"type":"object","properties":{"fromMatchPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"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."},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"subjectMatchPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"useSubject":{"type":"boolean","description":"Use the subject as value instead of the body"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MailAgentLink","default":"MailAgentLink"}},"title":"Mail Agent Link","additionalProperties":true,"required":["type"]},"MathExpressionValueFilter":{"type":"object","properties":{"expression":{"type":"string"},"type":{"const":"mathExpression","default":"mathExpression"}},"title":"Mathematical Expression","additionalProperties":true,"required":["type"]},"MockAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"requiredValue":{"type":"string"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MockAgentLink","default":"MockAgentLink"}},"title":"Mock Agent Link","additionalProperties":true,"required":["type"]},"ModbusAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"pollingMillis":{"type":"integer","description":"Poll interval in milliseconds"},"readAddress":{"type":"integer","description":"Zero based address from which the value is read from"},"readMemoryArea":{"type":"string","enum":["COIL","DISCRETE","HOLDING","INPUT"],"description":"Memory area to read from during read request"},"readRegistersAmount":{"type":"integer","description":"Set amount of registers to read. If left empty or less than 1, will use the default size for the corresponding data-type."},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"writeAddress":{"type":"integer","description":"Zero-based address to which the value sent is written to"},"writeMemoryArea":{"type":"string","enum":["COIL","HOLDING"],"description":"Memory area to write to. \\"HOLDING\\" or \\"COIL\\" allowed."},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"ModbusAgentLink","default":"ModbusAgentLink"}},"required":["pollingMillis","readAddress","readMemoryArea","readValueType","type"],"title":"Modbus Agent Link","additionalProperties":true},"NumberPredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"rangeValue":{"type":"number"},"value":{"type":"number"},"type":{"const":"number","default":"number"}},"required":["negate","type"],"title":"Number Predicate","additionalProperties":true,"description":"Predicate for number values; will match based on configured options."},"RadialGeofencePredicate":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"negated":{"type":"boolean"},"radius":{"type":"integer"},"type":{"const":"radial","default":"radial"}},"required":["lat","lng","negated","radius","type"],"title":"Radial geofence","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."},"RectangularGeofencePredicate":{"type":"object","properties":{"latMax":{"type":"number"},"latMin":{"type":"number"},"lngMax":{"type":"number"},"lngMin":{"type":"number"},"negated":{"type":"boolean"},"type":{"const":"rect","default":"rect"}},"required":["latMax","latMin","lngMax","lngMin","negated","type"],"title":"Rectangular geofence","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."},"RegexValueFilter":{"type":"object","properties":{"matchGroup":{"type":"integer"},"matchIndex":{"type":"integer"},"pattern":{"type":"string"},"type":{"const":"regex","default":"regex"}},"title":"Regex","additionalProperties":true,"required":["type"]},"SNMPAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"SNMPAgentLink","default":"SNMPAgentLink"}},"title":"SNMP Agent Link","additionalProperties":true,"required":["type"]},"SimulatorAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"replayData":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"integer"},"value":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true}},"required":["timestamp"],"title":"Data point","additionalProperties":true},"description":"Used to store a dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop based on a schedule (by default replays every 24h). Predicted datapoints can be added by configuring \'Store predicted datapoints\' which will insert the datapoints immediately as determined by the schedule."},"schedule":{"type":"object","properties":{"end":{"type":"string","format":"date-time","description":"Not implemented, within the recurrence rule you can specify an end date."},"recurrence":{"type":"string","description":"The recurrence schedule follows the RFC 5545 RRULE format."},"start":{"type":"string","format":"date-time","description":"Set a start date, if not provided, starts immediately. When the replay datapoint timestamp is 0 it will insert it at 00:00."}},"title":"Schedule","additionalProperties":true,"description":"When defined overwrites the possible dataset length and when it is replayed. This could be once when only a start- (and end) date are defined, or a recurring event following the RFC 5545 RRULE format. If not provided defaults to 24 hours. If the replay data contains datapoints scheduled after the default 24 hours or the recurrence rule the datapoints will be ignored."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"SimulatorAgentLink","default":"SimulatorAgentLink"}},"title":"Simulator Agent Link","additionalProperties":true,"required":["type"]},"StorageSimulatorAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"StorageSimulatorAgentLink","default":"StorageSimulatorAgentLink"}},"title":"Storage Simulator Agent Link","additionalProperties":true,"required":["type"]},"StringPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"description":"Predicate for string values; will match based on configured options."},"SubStringValueFilter":{"type":"object","properties":{"beginIndex":{"type":"integer"},"endIndex":{"type":"integer"},"type":{"const":"substring","default":"substring"}},"required":["beginIndex","type"],"title":"Substring","additionalProperties":true},"ValueAnyPredicate":{"type":"object","title":"Any value","additionalProperties":true,"description":"Predicate that matches any value including null.","properties":{"type":{"const":"value-any","default":"value-any"}},"required":["type"]},"ValueEmptyPredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"type":{"const":"value-empty","default":"value-empty"}},"required":["negate","type"],"title":"Empty value","additionalProperties":true,"description":"Predicate that matches any empty/null value; unless negated."},"VelbusAgentLink":{"type":"object","properties":{"deviceAddress":{"type":"integer","minimum":1,"maximum":255},"deviceValueLink":{"type":"string","minLength":1},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"VelbusAgentLink","default":"VelbusAgentLink"}},"required":["deviceAddress","deviceValueLink","type"],"title":"Velbus Agent Link","additionalProperties":true},"WebsocketAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"websocketSubscriptions":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/WebsocketSubscriptionImpl"},{"$ref":"#/definitions/WebsocketHTTPSubscription"}]},"description":"Array of WebsocketSubscriptions that should be executed when the linked attribute is linked; the subscriptions are executed in the order specified in the array."},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"WebsocketAgentLink","default":"WebsocketAgentLink"}},"title":"Websocket Agent Link","additionalProperties":true,"required":["type"]},"WebsocketHTTPSubscription":{"type":"object","properties":{"body":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"method":{"type":"string","enum":["GET","PUT","POST"]},"uri":{"type":"string"},"type":{"const":"http","default":"http"}},"title":"Websocket HTTP Subscription","additionalProperties":true,"required":["type"]},"WebsocketSubscriptionImpl":{"type":"object","properties":{"body":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"type":{"const":"websocket","default":"websocket"}},"title":"Websocket Subscription Impl","additionalProperties":true},"ZWaveAgentLink":{"type":"object","properties":{"deviceEndpoint":{"type":"integer"},"deviceNodeId":{"type":"integer"},"deviceValue":{"type":"string"},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"ZWaveAgentLink","default":"ZWaveAgentLink"}},"title":"Z Wave Agent Link","additionalProperties":true,"required":["type"]}},"title":"Agent Link","oneOf":[{"$ref":"#/definitions/ModbusAgentLink"},{"$ref":"#/definitions/ZWaveAgentLink"},{"$ref":"#/definitions/MailAgentLink"},{"$ref":"#/definitions/HTTPAgentLink"},{"$ref":"#/definitions/SNMPAgentLink"},{"$ref":"#/definitions/BluetoothMeshAgentLink"},{"$ref":"#/definitions/MQTTAgentLink"},{"$ref":"#/definitions/KNXAgentLink"},{"$ref":"#/definitions/MockAgentLink"},{"$ref":"#/definitions/WebsocketAgentLink"},{"$ref":"#/definitions/SimulatorAgentLink"},{"$ref":"#/definitions/VelbusAgentLink"},{"$ref":"#/definitions/StorageSimulatorAgentLink"},{"$ref":"#/definitions/DefaultAgentLink"}],"type":"object","properties":{"type":{"const":"AgentLink"}},"required":["type"]}');+ schema = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","definitions":{"ArrayPredicate":{"type":"object","properties":{"index":{"type":"integer"},"lengthEquals":{"type":"integer"},"lengthGreaterThan":{"type":"integer"},"lengthLessThan":{"type":"integer"},"negated":{"type":"boolean"},"value":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"type":{"const":"array","default":"array"}},"required":["negated","type"],"title":"Array Predicate","additionalProperties":true,"description":"Predicate for array values; will match based on configured options."},"BluetoothMeshAgentLink":{"type":"object","properties":{"address":{"type":"string","pattern":"^([0-9A-Fa-f]{4})$"},"appKeyIndex":{"type":"integer","minimum":0,"maximum":2147483647},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"modelName":{"type":"string","minLength":1},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"BluetoothMeshAgentLink","default":"BluetoothMeshAgentLink"}},"required":["appKeyIndex","modelName","type"],"title":"Bluetooth Mesh Agent Link","additionalProperties":true},"BooleanPredicate":{"type":"object","properties":{"value":{"type":"boolean"},"type":{"const":"boolean","default":"boolean"}},"required":["value","type"],"title":"Boolean Predicate","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"},"CalendarEventPredicate":{"type":"object","properties":{"timestamp":{"type":"integer","format":"utc-millisec"},"type":{"const":"calendar-event","default":"calendar-event"}},"title":"Calendar","additionalProperties":true,"description":"Predicate for calendar event values; will match based on whether the calendar event is active for the specified time.","required":["type"]},"DateTimePredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"rangeValue":{"type":"string"},"value":{"type":"string"},"type":{"const":"datetime","default":"datetime"}},"required":["negate","type"],"title":"Date Time Predicate","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."},"DefaultAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"DefaultAgentLink","default":"DefaultAgentLink"}},"title":"Default Agent Link","additionalProperties":true},"HTTPAgentLink":{"type":"object","properties":{"contentType":{"type":"string","description":"The content type header value to use when making requests for this linked attribute (shortcut alternative to using headers parameter)"},"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"},"id":{"type":"string","format":"or-agent-id"},"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"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"method":{"type":"string","enum":["GET","POST","PUT","DELETE","OPTIONS","PATCH"],"description":"The HTTP method to use when making requests for this linked attribute"},"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"},"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"},"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"},"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\')"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"HTTPAgentLink","default":"HTTPAgentLink"}},"required":["messageConvertBinary","messageConvertHex","type"],"title":"HTTP Agent Link","additionalProperties":true},"JsonPathFilter":{"type":"object","properties":{"path":{"type":"string"},"returnFirst":{"type":"boolean"},"returnLast":{"type":"boolean"},"type":{"const":"jsonPath","default":"jsonPath"}},"required":["path","returnFirst","returnLast","type"],"title":"JSON Path","additionalProperties":true},"KNXAgentLink":{"type":"object","properties":{"actionGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"dpt":{"type":"string","pattern":"^\\\\d{1,3}\\\\.\\\\d{1,3}$"},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"statusGroupAddress":{"type":"string","pattern":"^\\\\d{1,3}/\\\\d{1,3}/\\\\d{1,3}$"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"KNXAgentLink","default":"KNXAgentLink"}},"required":["dpt","type"],"title":"KNX Agent Link","additionalProperties":true},"MQTTAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"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","description":"QoS level to use for publish/subscribe (default is 0 if unset)","minimum":0,"maximum":2},"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"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MQTTAgentLink","default":"MQTTAgentLink"}},"title":"MQTT Agent Link","additionalProperties":true,"required":["type"]},"MailAgentLink":{"type":"object","properties":{"fromMatchPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"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."},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"subjectMatchPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"useSubject":{"type":"boolean","description":"Use the subject as value instead of the body"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MailAgentLink","default":"MailAgentLink"}},"title":"Mail Agent Link","additionalProperties":true,"required":["type"]},"MathExpressionValueFilter":{"type":"object","properties":{"expression":{"type":"string"},"type":{"const":"mathExpression","default":"mathExpression"}},"title":"Mathematical Expression","additionalProperties":true,"required":["type"]},"MockAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"requiredValue":{"type":"string"},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"MockAgentLink","default":"MockAgentLink"}},"title":"Mock Agent Link","additionalProperties":true,"required":["type"]},"ModbusAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"pollingMillis":{"type":"integer","description":"Poll interval in milliseconds"},"readAddress":{"type":"integer","description":"Zero based address from which the value is read from"},"readMemoryArea":{"type":"string","enum":["COIL","DISCRETE","HOLDING","INPUT"],"description":"Memory area to read from during read request"},"readRegistersAmount":{"type":"integer","description":"Set amount of registers to read. If left empty or less than 1, will use the default size for the corresponding data-type."},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"writeAddress":{"type":"integer","description":"Zero-based address to which the value sent is written to"},"writeMemoryArea":{"type":"string","enum":["COIL","HOLDING"],"description":"Memory area to write to. \\"HOLDING\\" or \\"COIL\\" allowed."},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"ModbusAgentLink","default":"ModbusAgentLink"}},"required":["pollingMillis","readAddress","readMemoryArea","readValueType","type"],"title":"Modbus Agent Link","additionalProperties":true},"NumberPredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"operator":{"type":"string","enum":["EQUALS","GREATER_THAN","GREATER_EQUALS","LESS_THAN","LESS_EQUALS","BETWEEN"]},"rangeValue":{"type":"number"},"value":{"type":"number"},"type":{"const":"number","default":"number"}},"required":["negate","type"],"title":"Number Predicate","additionalProperties":true,"description":"Predicate for number values; will match based on configured options."},"OpenWeatherMapAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"weatherProperty":{"type":"string","enum":["TEMPERATURE","ATMOSPHERIC_PRESSURE","HUMIDITY","CLOUD_COVERAGE","WIND_SPEED","WIND_DIRECTION","WIND_GUST_SPEED","PROBABILITY_OF_PRECIPITATION","RAIN_AMOUNT","ULTRAVIOLET_INDEX"],"description":"Select which weather property (e.g. temperature, humidity) to use as the data source"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"OpenWeatherMapAgentLink","default":"OpenWeatherMapAgentLink"}},"required":["weatherProperty","type"],"title":"Open Weather Map Agent Link","additionalProperties":true},"RadialGeofencePredicate":{"type":"object","properties":{"lat":{"type":"number"},"lng":{"type":"number"},"negated":{"type":"boolean"},"radius":{"type":"integer"},"type":{"const":"radial","default":"radial"}},"required":["lat","lng","negated","radius","type"],"title":"Radial geofence","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."},"RectangularGeofencePredicate":{"type":"object","properties":{"latMax":{"type":"number"},"latMin":{"type":"number"},"lngMax":{"type":"number"},"lngMin":{"type":"number"},"negated":{"type":"boolean"},"type":{"const":"rect","default":"rect"}},"required":["latMax","latMin","lngMax","lngMin","negated","type"],"title":"Rectangular geofence","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."},"RegexValueFilter":{"type":"object","properties":{"matchGroup":{"type":"integer"},"matchIndex":{"type":"integer"},"pattern":{"type":"string"},"type":{"const":"regex","default":"regex"}},"title":"Regex","additionalProperties":true,"required":["type"]},"SNMPAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"SNMPAgentLink","default":"SNMPAgentLink"}},"title":"SNMP Agent Link","additionalProperties":true,"required":["type"]},"SimulatorAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"replayData":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"integer"},"value":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true}},"required":["timestamp"],"title":"Data point","additionalProperties":true},"description":"Used to store a dataset of values that should be replayed (i.e. written to the linked attribute) in a continuous loop based on a schedule (by default replays every 24h). Predicted datapoints can be added by configuring \'Store predicted datapoints\' which will insert the datapoints immediately as determined by the schedule."},"schedule":{"type":"object","properties":{"end":{"type":"string","format":"date-time","description":"Not implemented, within the recurrence rule you can specify an end date."},"recurrence":{"type":"string","description":"The recurrence schedule follows the RFC 5545 RRULE format."},"start":{"type":"string","format":"date-time","description":"Set a start date, if not provided, starts immediately. When the replay datapoint timestamp is 0 it will insert it at 00:00."}},"title":"Schedule","additionalProperties":true,"description":"When defined overwrites the possible dataset length and when it is replayed. This could be once when only a start- (and end) date are defined, or a recurring event following the RFC 5545 RRULE format. If not provided defaults to 24 hours. If the replay data contains datapoints scheduled after the default 24 hours or the recurrence rule the datapoints will be ignored."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"SimulatorAgentLink","default":"SimulatorAgentLink"}},"title":"Simulator Agent Link","additionalProperties":true,"required":["type"]},"StorageSimulatorAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"StorageSimulatorAgentLink","default":"StorageSimulatorAgentLink"}},"title":"Storage Simulator Agent Link","additionalProperties":true,"required":["type"]},"StringPredicate":{"type":"object","properties":{"caseSensitive":{"type":"boolean"},"match":{"type":"string","enum":["EXACT","BEGIN","END","CONTAINS"]},"negate":{"type":"boolean"},"value":{"type":"string"},"type":{"const":"string","default":"string"}},"required":["caseSensitive","negate","type"],"title":"String Predicate","additionalProperties":true,"description":"Predicate for string values; will match based on configured options."},"SubStringValueFilter":{"type":"object","properties":{"beginIndex":{"type":"integer"},"endIndex":{"type":"integer"},"type":{"const":"substring","default":"substring"}},"required":["beginIndex","type"],"title":"Substring","additionalProperties":true},"ValueAnyPredicate":{"type":"object","title":"Any value","additionalProperties":true,"description":"Predicate that matches any value including null.","properties":{"type":{"const":"value-any","default":"value-any"}},"required":["type"]},"ValueEmptyPredicate":{"type":"object","properties":{"negate":{"type":"boolean"},"type":{"const":"value-empty","default":"value-empty"}},"required":["negate","type"],"title":"Empty value","additionalProperties":true,"description":"Predicate that matches any empty/null value; unless negated."},"VelbusAgentLink":{"type":"object","properties":{"deviceAddress":{"type":"integer","minimum":1,"maximum":255},"deviceValueLink":{"type":"string","minLength":1},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"VelbusAgentLink","default":"VelbusAgentLink"}},"required":["deviceAddress","deviceValueLink","type"],"title":"Velbus Agent Link","additionalProperties":true},"WebsocketAgentLink":{"type":"object","properties":{"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"websocketSubscriptions":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/WebsocketSubscriptionImpl"},{"$ref":"#/definitions/WebsocketHTTPSubscription"}]},"description":"Array of WebsocketSubscriptions that should be executed when the linked attribute is linked; the subscriptions are executed in the order specified in the array."},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"WebsocketAgentLink","default":"WebsocketAgentLink"}},"title":"Websocket Agent Link","additionalProperties":true,"required":["type"]},"WebsocketHTTPSubscription":{"type":"object","properties":{"body":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"contentType":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"method":{"type":"string","enum":["GET","PUT","POST"]},"uri":{"type":"string"},"type":{"const":"http","default":"http"}},"title":"Websocket HTTP Subscription","additionalProperties":true,"required":["type"]},"WebsocketSubscriptionImpl":{"type":"object","properties":{"body":{"title":"Any Type","type":["null","number","integer","boolean","string","array","object"],"additionalProperties":true},"type":{"const":"websocket","default":"websocket"}},"title":"Websocket Subscription Impl","additionalProperties":true},"ZWaveAgentLink":{"type":"object","properties":{"deviceEndpoint":{"type":"integer"},"deviceNodeId":{"type":"integer"},"deviceValue":{"type":"string"},"id":{"type":"string","format":"or-agent-id"},"messageMatchFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"description":"ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate"},"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."},"updateOnWrite":{"type":"boolean","description":"Don\'t expect a response from the protocol just update the attribute immediately on write"},"valueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute"},"valueFilters":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/RegexValueFilter"},{"$ref":"#/definitions/SubStringValueFilter"},{"$ref":"#/definitions/JsonPathFilter"},{"$ref":"#/definitions/MathExpressionValueFilter"}]},"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"},"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)"},"writeValueConverter":{"type":"object","patternProperties":{".+":{"type":["null","number","integer","boolean","string","array","object"]}},"description":"Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion"},"type":{"const":"ZWaveAgentLink","default":"ZWaveAgentLink"}},"title":"Z Wave Agent Link","additionalProperties":true,"required":["type"]}},"title":"Agent Link","oneOf":[{"$ref":"#/definitions/StorageSimulatorAgentLink"},{"$ref":"#/definitions/MailAgentLink"},{"$ref":"#/definitions/SNMPAgentLink"},{"$ref":"#/definitions/KNXAgentLink"},{"$ref":"#/definitions/SimulatorAgentLink"},{"$ref":"#/definitions/BluetoothMeshAgentLink"},{"$ref":"#/definitions/MockAgentLink"},{"$ref":"#/definitions/VelbusAgentLink"},{"$ref":"#/definitions/OpenWeatherMapAgentLink"},{"$ref":"#/definitions/ModbusAgentLink"},{"$ref":"#/definitions/ZWaveAgentLink"},{"$ref":"#/definitions/HTTPAgentLink"},{"$ref":"#/definitions/DefaultAgentLink"},{"$ref":"#/definitions/WebsocketAgentLink"},{"$ref":"#/definitions/MQTTAgentLink"}],"type":"object","properties":{"type":{"const":"AgentLink"}},"required":["type"]}');}loadedAgents = await loadAgents();