These are override situations where you have an existing rule but you want to add an additional condition that limits when it fires.
People use to write custom code for this, particularly for motion sensors because they would have a problem where they would turn the switch on on the wall and then the motion sensor would turn the light off before they wanted it off.
Now it’s easiest to just use core, which is a very sophisticated community – created rules engine. It has many different layers of stacked conditionals.
Core calls its individual rules “pistons.” if you ask in the peer assistance thread for core there are lots of people who can help you set up a piston for any specific situation.
If you happen to have an iOS device, there’s also a very nice app you can get from the app store for about $10 called smart rules. It’s much easier to use than core, but doesn’t have as many levels. Like CoRE, It does have a “while” condition which the official features don’t. There’s no android version for it yet though.
A lot of people use both core and smart rules. They use core for the really complicated stuff and smart rules for the simple stuff. Just depends on your own preferences. But again you have to have an iOS device to use smart rules.
SmartRules:
CoRE:

