Rule react to Item DateTime change

My rule looks if a DateTime Item has changed which is updated by binding but somehow my rule does not fire.I can see in the logs that every 10s or so the Item gets updated by the binding.

Item DateTime presence_franziska_home

rule "presence"
when
    Item presence_franziska_home changed
then
    logInfo("presence franzi", "----->  updated")
end

Why does this not work?

How is this item changed? By a binding, by another rule?
What does the log tell, when the item is changed?

The item is changed by the binding (linked)

[openhab.event.ItemStateChangedEvent - Item 'presence_franziska_home' changed from 2022-05-24T23:19:22.000+0200 to 2022-05-24T23:20:04.000-+0200

use logWarn

Where have you placed this rule code?
It must be in folder /rules with a filename like xxx.rules.
xxx.rule is a common mistake.

it’s in the correct folder and correctly named like the other 54 rules.

for the binding that is updating the Item?

instead of logInfo in the rule

the logInfo would show me the info if the rule would have fired thats not the problem. The problem is that the rules does not get triggered at all.
Is it because the Item is a DateTime Item and “changed” does not trigger the rule?

in case you change the trigger against a cron entry to be triggered e.g. every ten seconds do you see the log info ?

ok I found a solution…
Delete the rule file and make a new one with a different name and now it works…
Seems a bit strange…

I’m not using file based rules anymore, but I remember that it was important to have unique name for rules in files when I used them in OH2.
So don’t you have two different rules with name “presence”?

1 Like

Hmm interesting but I checked and no they are all unique…