I am trying to run a rule from within a rule using this:
if event.itemName == 'TestTimeField':
rule_registry = get_service("org.openhab.core.automation.RuleRegistry") or get_service("org.eclipse.smarthome.automation.RuleRegistry")
for rule in [rule for rule in rules.getAll() if rule.name == 'Test']:
rule_registry.runNow(rule.UID)
but I get an error:
AttributeError: 'org.openhab.core.automation.internal.RuleRegistryI' object has no attribute 'runNow'
First, what is the name of the function defined for the rule? If the rule was created with the decorators, then the UID was added as an attribute, so no need to search for it if in the same script… my_rule_function.UID.