diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/component/DeviceTrigger.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/component/DeviceTrigger.java index d3e1ebcc047..68723b765a9 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/component/DeviceTrigger.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/component/DeviceTrigger.java @@ -111,17 +111,22 @@ public class DeviceTrigger extends AbstractComponent objectIdList) { - newConfiguration.put("objectid", - Stream.concat(objectIdList.stream(), Stream.of(other.getHaID().objectID)).toList()); + newConfiguration.put("objectid", Stream.concat(objectIdList.stream(), Stream.of(other.getHaID().objectID)) + .sorted().distinct().toList()); } Object configObject = currentConfiguration.get("config"); if (configObject instanceof String configString) { - newConfiguration.put("config", List.of(configString, other.getChannelConfigurationJson())); + if (!configString.equals(other.getChannelConfigurationJson())) { + newConfiguration.put("config", List.of(configString, other.getChannelConfigurationJson())); + } } else if (configObject instanceof List configList) { newConfiguration.put("config", - Stream.concat(configList.stream(), Stream.of(other.getChannelConfigurationJson())).toList()); + Stream.concat(configList.stream(), Stream.of(other.getChannelConfigurationJson())).sorted() + .distinct().toList()); } // Append payload to allowed values @@ -130,7 +135,8 @@ public class DeviceTrigger extends AbstractComponent