Change staet based on sunset / sunrise.  If youre away, mode stays away - upon re-entry, the expected state is set (night, home).  If all presence are still at home, day / night modes are scheduled.