In the sefer Mah Yinachmuni, it brings בשם the Pnei Menachem that what the Baal Shem Tov wrote, that “Bo el... · לב אהרן - בראשית
לב אהרן - בראשיתבספר המה ינחמוני הביא בשם הפני מנחם, שמה שכתב הבעל שם טוב ש'בֺא אל התיבה' היינו התיבה דתפילה ותורה, מדוייק במדרש. דהנה איתא בזהר שהפסוק "ואני ברוב חסדך אבא ביתך" (תהלים ה, ח) מכוון לבתי כנסיות ובתי מדרשות, וכן נוהגים לאמרו קודם הכניסה לבית הכנסת להתפלל. ואיתא בבראשית רבה שפסוק זה אמרו נח כשנכנס אל התיבה, הרי לנו שהכניסה לבית הכנסת לתפילה עניינה מקביל לכניסת נח לתיבה.
In the sefer *Mah Yinachmuni*, it brings בשם the *Pnei Menachem* that what the *Baal Shem Tov* wrote, that **“Bo el hateivah”** means the *teivah* of tefillah and Torah, is precise in the Midrash. For it says in the Zohar that the pasuk > “V’ani b’rov chasdecha avo beisecha” (Tehillim 5:8) refers to batei knesiyos and batei midrashos, and therefore we have the custom to say it before entering the shul to daven. And it says in *Bereishis Rabbah* that Noach said this pasuk when he entered the *teivah*. Thus we see that entering the shul for tefillah is parallel to Noach’s entering the *teivah*.
הקדמת הזהר (יא, א) זה לשונו, ובצפרא קם מערסיה בעי לברכא למאריה ולמיעל לביתיה ולמסגד קמי היכליה בדחילו סגיא ובתר כן יצלי צלותיה ויסב עיטא מאינון אבהן קדישין דכתיב (תהלים ה') ואני ברוב חסדך אבא ביתך אשתחוה אל היכל קדשך ביראתך, עכ"ל. וכעין זה בויקרא (ח, ב).
In the introduction to the Zohar (11a), this is its wording: “And at daybreak he rises from his bed, seeks to bless his Master and to enter his house and to bow before His Sanctuary with great awe, and afterward he prays his tefillah and takes counsel from those holy avos, as it is written (Tehillim 5): ‘And as for me, in the abundance of Your kindness I will come into Your house; I will bow down toward Your holy heichal in Your yirah.’” Thus far his words. And similarly in Vayikra (8:2).
כוונתו למה שכתב המתנות כהונה בשם רש"י (בראשית רבה לב, א) והובא באמרי אמת (נח תרסח).
He is referring to what the *Matanos Kehunah* wrote in the name of Rashi (Bereishis Rabbah 32:1), and it is brought in *Imrei Emes* (Noach 5668).