diff --git a/bundles/org.openhab.core.automation.module.script.rulesupport/src/main/java/org/openhab/core/automation/module/script/rulesupport/shared/ScriptedAutomationManager.java b/bundles/org.openhab.core.automation.module.script.rulesupport/src/main/java/org/openhab/core/automation/module/script/rulesupport/shared/ScriptedAutomationManager.java index a91308ed46..0b70cbeff1 100644 --- a/bundles/org.openhab.core.automation.module.script.rulesupport/src/main/java/org/openhab/core/automation/module/script/rulesupport/shared/ScriptedAutomationManager.java +++ b/bundles/org.openhab.core.automation.module.script.rulesupport/src/main/java/org/openhab/core/automation/module/script/rulesupport/shared/ScriptedAutomationManager.java @@ -106,6 +106,14 @@ public class ScriptedAutomationManager { } public Rule addRule(Rule element) { + Rule rule = addUnmanagedRule(element); + + ruleRegistryDelegate.add(rule); + + return rule; + } + + public Rule addUnmanagedRule(Rule element) { RuleBuilder builder = RuleBuilder.create(element.getUID()); String name = element.getName(); @@ -173,7 +181,6 @@ public class ScriptedAutomationManager { Rule rule = builder.build(); - ruleRegistryDelegate.add(rule); return rule; }