eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 787 forks source link

New Rule engine not initialising rules at startup #4184

Open mattwire opened 6 years ago

mattwire commented 6 years ago

The new rule engine is starting too early (before other modules that implement things defined in the rules) and this is causing the rules to be unitialised. See https://community.openhab.org/t/new-rule-engine-startup-rule-initialisation/18622/13 for workaround using API PUT.

2694 seems related but I'm on openhab2.2.0 snapshot 1020 and it is still happening.

danchom commented 6 years ago

OSGi is dynamic environment and services and things can appeared/disappeared at any time. It is normal situation that a thing can appeared when the rule engine is running. I'm not sure of your problem, but in case if you have a condition which depends of item and the item is not available, then yes, the rule engine won't execute the rule. If you want to ensure to run the rule when the thing is appeared you just have to add additional event trigger listening to smarthome/things/{thingUID}/added topic. Is this solution solves the problem? If not, please explain it in more details.

mrphyslaw commented 6 years ago

I am currently experiencing the same issue. Upon restart the rules are not running. This is not what one would expect after having started them. I am on openHAB 2.2.0, and the rules were made via UI with the rules engine. Does anyone have updates on this?

kaikreuzer commented 6 years ago

@murphyslaw05 No, the problem indeed still exists. I'd hope that it can be fixed in the context of the big refactoring that is currently done through https://github.com/eclipse/smarthome/pull/4468.