Hi to all, I deleted an old DSL rule from early system (I guess 2.4) in OH 4.x which acts when a door was opened and closed.
I delete the both *.rule files underneath /etc/openhab/rules …
in the early days… that was it. No more action…
Rules from .rules files do not exist on disk anywhere except in those .rules files. If those files do not exist, there’s nothing for OH to load them from. So either these are managed rules (if they are Rules DSL and they are from OH 2.3 that’s impossible becuase at that time the Experimental Rules Engine didn’t support Rules DSL at that time) or these files still exist and are being loaded by OH.
They are not saved to cache. They are not saved to the JSONDB. They are not written out to the disk by OH at all. The only place these exist on disk are the .rules files themselves.
There is no other way these rules can get into OH. They can only be loaded from a file.
But since you know what you are doing . You can grep through the useradata folder and the conf folder and see if you can find them somewhere. All I can say is the only way for these rules to still be loaded is if they are in a .rules file that is being loaded, or you’ve created these as a managed rule and forgot in which case you need to delete them through the UI or API Explorer or the karaf console.
I do a find for the whole filesystem… Can´t see the rules “.rules” files…
But in the openhab GU I see that all “old” rules are listet with added a “-1” to the name:
The lock icons and the IDs means that those rules have been loaded from a rules file somewhere/somehow. The lock means they are readonly meaning they come from a file and are not managed (i.e. in the JSONDB). So these are definitely not comming from the userdata folder.
Given the IDs, these rules come from files names: Badezimmerradio.rules, BadezimmerTuerTemprules, off_BadHeizung.rules, onBadHeizung.rules, and batterycheck.rules. The numbers indicate they are the first rule defined in these files.
Since Rules DSL doesn’t provide a way to supply your own ID, the ID becomes <filename>-<N> where <filename> is the first part of the .rules file name and <#> is the position of the rule in the file. The second rule in “foo.rules” would be foo-2.