I have something similar that I wrote up here in the Manual Trigger Detection Design Pattern
the first approach uses a flag that gets changed when ever a Rule is changing a light’s state (i.e. change the flag to “RULE”). The flag remains in a default state of “MANUAL” at all other times. when the override rule triggers it checks for the flag and if it is MANUAL the rule knows the light was changed because of a manual action.
The Timestamp example in the above is what I currently run with. Instead of keeping track of a flag, I use persistence and lastUpdate to distinguish between a change that occurred because of a rule or a manual action.