DSL RULEdeleted but stil workong...howto disable in general

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…

But now: the rule still work!

How can i force deleting these and any rules?

Thank you for any help

Cheers Stef

I can think of only two possibilities.

  1. The rule wasn’t defined in those files.
  2. Despite the files being deleted they aren’t really gone which can be a sign of a failing SD card.

Deleting the file will remove the rule from OH.

Did you restart openHab?
Sometimes a restart fixes all sorts of issues.

… I kniw what I’m doing … the rules are from 2.3 ! There were only DSL

System is on SSD

(And I know that SSD is not supported :face_with_peeking_eye::pensive: but working and no sd hardware defekt since years )

Of corse!

Also delete more than one time all caches!

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 :man_shrugging: . 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:
Unbenannt1
What does this mean?

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.

Thank you