Switches going from unkown to off or on

Hello,

I have been having this problem where entites will go from unknown to on or off the orignal state. This will cause the entity to trigger the automastion again and cause problems. Is there a homeassistant setting or way to stop an automastion from running if it went from unknown to on or off?

Make you trigger specific to which state to which state I.e.
Off → On

You will see there are two boxes in triggers to do this

that makes sense and I understand, so just call on it as an entity and have off to on. Is there a golbal wide settings that ignore unknown to off because this is obviously not an intended action?