I had a similar problem to overcome in my rules. I have a rule that turns on the lights during the day when the weather code says its cloudy. However, if someone manually turns on or off a light it disables the weather rule for that light. I use groups and a hashmap that keeps track of whether a light has been overridden or not and a lambda that checks whether a rule has been overridden before turning it back on. I posted my full lighting rules here.
Rich