Shabbatשבת

Motion-Sensing Lights and Shabbat Restrictions

Sources address whether triggering a motion sensor that activates or deactivates lighting constitutes a violation of the melacha of kindling (or extinguishing), and how principles of intentionality, indirect causation, and Shabbat restrictions apply to such actions.

כָּל הָעוֹשֶׂה מְלָאכָה בְּשַׁבָּת חַיָּב עָלֶיהָ

10 sources · all verified

Opens as a working sheet — explore, annotate, and export.

What the sources say

The question of walking past or triggering a motion-sensing light on Shabbat touches several distinct halachic issues: whether activating the sensor completes a forbidden circuit, whether the resulting light constitutes ignition of fire, and whether indirect causation of a melacha carries halachic weight.

Electric circuit completion

The Gemara establishes that a melacha is complete only when the final act that renders it functional has been performed — illustrated by the ruling that drilling a hole is a completed labor only when the nail is left inside, since that constitutes the גמר מלאכה (the Gemara, Shabbat 103a–104b) — a principle that bears directly on whether triggering a sensor that closes a circuit constitutes the completion of a forbidden labor.

Explore this topic

Ignition and fire

The Torah explicitly prohibits kindling fire on Shabbat in any of one's settlements (Shemot 35:3), and the Rambam (Mishneh Torah, Sabbath 12:1) rules that one who lights even the smallest candle or wood — whether for warmth or for light — is liable.

The Rambam (Mishneh Torah, Sabbath 12:1–2) further clarifies that liability for ignition depends on constructive intent, so that one who kindles in a purely destructive manner is exempt — a nuance relevant to assessing the nature of triggering incidental illumination.

The Rambam (Mishneh Torah, Sabbath 1:7) adds that one who performs a melacha even without needing the labor itself — for example, extinguishing a flame for the sake of the oil or wick rather than the extinguishing per se — is nonetheless liable, reinforcing that the melacha of fire-related acts is not limited to cases of direct and purposeful intent.

Explore this topic

Indirect causation on Shabbat

The Shulchan Arukh (Orach Chayim 277:1) rules that one may not open a door in its normal manner when a candle is placed behind it, lest the resulting wind extinguish the flame — demonstrating that indirectly causing a prohibited outcome through one's ordinary action is forbidden even when no melacha is performed directly.

The Mishnah Berurah (277) elaborates that the prohibition applies even when one opens the door gently, since the external wind — which one cannot fully control — may still extinguish the light, indicating that the halachic concern for indirect causation extends even to cases where the person takes precautions.

The Rambam (Mishneh Torah, Sabbath 1:17) establishes that one is exempt only when the intent behind the action is destructive, implying conversely that where the indirect result is a constructive melacha, the actor may bear responsibility.

Explore this topic
Source 1 · Tanach
Verified

Shemot 35:3

שמות ל״ה:ג׳

Exodus 35:3

The verse prohibits kindling fire in one's dwellings on Shabbat, the biblical basis for many later discussions of lights and flame. Modern authorities often begin here when analyzing whether turning on a light by motion is a direct form of kindling.

לֹא־תְבַעֲר֣וּ אֵ֔שׁ בְּכֹ֖ל מֹשְׁבֹֽתֵיכֶ֑ם בְּי֖וֹם הַשַּׁבָּֽת׃ {פ}

You shall kindle no fire throughout your settlements on the sabbath day.

Source 2 · Chazal
Verified

Shabbat 103a-104b

שבת ק״ג-ק״ד

Shabbat 103a-104b

These dapim discuss writing, building, and completing activities on Shabbat, helping define the categories of melachah that may be relevant to electrical activation. They are part of the classical background for later poskim applying these rules to technology.

הַקּוֹדֵחַ כׇּל שֶׁהוּא — חַיָּיב. בִּשְׁלָמָא לְרַב — מֶיחְזֵי כְּמַאן דְּחַר חוֹרְתָא לְבִנְיָינָא, אֶלָּא לִשְׁמוּאֵל — לָאו גְּמַר מְלָאכָה הוּא! הָכָא בְּמַאי עָסְקִינַן — דְּבַזְעֵיהּ בְּרַמְצָא דְפַרְזְלָא וְשַׁבְקֵיהּ בְּגַוֵּויהּ, דְּהַיְינוּ גְּמַר מְלָאכָה.

One who drills a hole of any size is liable. Granted, according to Rav, who said that one who makes a hole is liable due to the prohibited labor of building, here too, he should be liable because he appears as one who is making a hole for the purpose of building. However, according to Shmuel, drilling a hole is not a completion of the labor. The labor will be complete only when a stake or pin is inserted into the hole. Until he does so, he cannot be liable for completing the labor. The Gemara answers: With what we are dealing here? With a case where one drilled a hole with an iron nail and left it inside the surface in which he drilled the hole. That is considered a completion of labor because there is no intention to remove the nail from its hole.

Source 3 · Rishonim
Verified

Mishneh Torah, Sabbath 12:1

משנה תורה, הלכות שבת י״ב:א׳

Mishneh Torah, Sabbath 12:1

This halacha is part of Rambam's foundational presentation of constructive labor on Shabbat. Later halakhic analysis of electrical devices often draws on such categories when comparing circuitry to building or completing a vessel.

הַמַּבְעִיר כָּל שֶׁהוּא חַיָּב. וְכֵן הַמַּדְלִיק אֶת הַנֵּר אוֹ אֶת הָעֵצִים בֵּין לְהִתְחַמֵּם בֵּין לְהָאִיר הֲרֵי זֶה חַיָּב.

A person who kindles even the smallest fire is liable, provided he needs the ash that it creates. Similarly, a person who lights a candle or wood, whether to generate warmth or light, is liable.

Source 4 · Rishonim
Verified

Mishneh Torah, Sabbath 12:1-2

משנה תורה, הלכות שבת י״ב:א׳-ב׳

Mishneh Torah, Sabbath 12:1-2

One who kindles any fire is liable if he needs the ash it produces; if his intent is destructive he is exempt, but if he sets fire to another's property out of revenge he is liable because he accomplishes an emotional purpose; similarly, one who lights a candle or wood for warmth or light is liable, and one who heats iron to strengthen it by water submersion is liable as a derivative of kindling.

הַמַּבְעִיר כָּל שֶׁהוּא חַיָּב. וְהוּא שֶׁיְּהֵא צָרִיךְ לָאֵפֶר. אֲבָל אִם הִבְעִיר דֶּרֶךְ הַשְׁחָתָה פָּטוּר מִפְּנֵי שֶׁהוּא מְקַלְקֵל. וְהַמַּבְעִיר גְּדִישׁוֹ שֶׁל חֲבֵרוֹ אוֹ הַשּׂוֹרֵף דִּירָתוֹ חַיָּב אַף עַל פִּי שֶׁהוּא מַשְׁחִית. מִפְּנֵי שֶׁכַּוָּנָתוֹ לְהִנָּקֵם מִשּׂוֹנְאוֹ וַהֲרֵי נִתְקָרְרָה דַּעְתּוֹ וְשָׁכְכָה חֲמָתוֹ וְנַעֲשָׂה כְּקוֹרֵעַ עַל מֵתוֹ אוֹ בַּחֲמָתוֹ שֶׁהוּא חַיָּב וּבְחוֹבֵל בַּחֲבֵרוֹ בִּשְׁעַת מְרִיבָה שֶׁכָּל אֵלּוּ מְתַקְּנִים הֵן אֵצֶל יִצְרָן הָרַע. וְכֵן הַמַּדְלִיק אֶת הַנֵּר אוֹ אֶת הָעֵצִים בֵּין לְהִתְחַמֵּם בֵּין לְהָאִיר הֲרֵי זֶה חַיָּב. הַמְחַמֵּם אֶת הַבַּרְזֶל כְּדֵי לְצָרְפוֹ בְּמַיִם הֲרֵי זֶה תּוֹלֶדֶת מַבְעִיר וְחַיָּב:

A person who kindles even the smallest fire is liable, provided he needs the ash that it creates. However, should a person kindle a fire with a destructive intent, he is not liable, for he is causing ruin. Nevertheless, a person who sets fire to a heap of produce or a dwelling belonging to a colleague is liable, because his intent is to take revenge on his enemies. [Through this act,] he calms his feelings and vents his rage. He is comparable to a person who rends his garments over a deceased person or in rage [on the Sabbath], or a person who injures a colleague in an argument. These individuals are all considered to be performing a constructive activity, because of their evil inclinations. Similarly, a person who lights a candle or wood, whether to generate warmth or light, is liable. A person who heats iron in order to strengthen it by submerging it in water is liable for [performing] a derivative [of the forbidden labor] of kindling.

Source 5 · Rishonim
Verified

Mishneh Torah, Sabbath 1:7

Mishneh Torah, Sabbath 1:7

One who performs a melacha on Shabbat is liable even if the melacha itself is not necessary for its own sake; extinguishing is a melacha, and one is liable if one intends to extinguish even if one does not need extinguishing for its own purpose and did not actually extinguish but only removed oil, wick, or kindling material.

כָּל הָעוֹשֶׂה מְלָאכָה בְּשַׁבָּת אַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְגוּפָהּ שֶׁל מְלָאכָה חַיָּב עָלֶיהָ. מִפְּנֵי שֶׁהַכִּבּוּי מְלָאכָה וַהֲרֵי נִתְכַּוֵּן לְכַבּוֹת וְאַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְגוּף הַכִּבּוּי וְלֹא כִּבָּה אֶלָּא מִפְּנֵי הַשֶּׁמֶן אוֹ מִפְּנֵי הַחֶרֶשׂ אוֹ מִפְּנֵי הַפְּתִילָה הֲרֵי זֶה חַיָּב.

Source 6 · Rishonim
Verified

Mishneh Torah, Sabbath 24:1

משנה תורה, הלכות שבת כ״ד:א׳

Mishneh Torah, Sabbath 24:1

This chapter addresses actions permitted or forbidden in the realm of shvut and rabbinic Shabbat restrictions, including indirect outcomes of one's behavior. It helps frame whether motion-sensor activation is an unavoidable result or a permitted indirect effect.

יֵשׁ דְּבָרִים שֶׁהֵן אֲסוּרִין בְּשַׁבָּת אַף עַל פִּי שֶׁאֵינָם דּוֹמִין לִמְלָאכָה וְאֵינָם מְבִיאִין לִידֵי מְלָאכָה. וּמִפְּנֵי מָה נֶאֶסְרוּ מִשּׁוּם שֶׁנֶּאֱמַר (ישעיה נח יג) "אִם תָּשִׁיב מִשַּׁבָּת רַגְלֶךָ עֲשׂוֹת חֲפָצֶיךָ בְּיוֹם קָדְשִׁי" וְנֶאֱמַר (ישעיה נח יג) "וְכִבַּדְתּוֹ מֵעֲשׂוֹת דְּרָכֶיךָ מִמְּצוֹא חֶפְצְךָ וְדַבֵּר דָּבָר".

Source 7 · Rishonim
Verified

Mishneh Torah, Sabbath 1:17

משנה תורה, הלכות שבת א׳:י״ז

Mishneh Torah, Sabbath 1:17

Rambam discusses acts prohibited because they resemble kindling or intensifying fire. This is relevant background for modern questions about triggering illumination on Shabbat, especially where the sensor activates a light source.

כָּל הַמְקַלְקְלִין פְּטוּרִין. אַף עַל פִּי שֶׁעָשָׂה מְלָאכָה הוֹאִיל וְכַוָּנָתוֹ לְקַלְקֵל פָּטוּר:

Whenever [a forbidden labor is performed] in a destructive manner, one is not held liable. Although he performed a [forbidden] labor, he is not held liable because he had a destructive intent.

Source 8 · Acharonim
Verified

Mishnah Berurah 277

משנה ברורה ער״ז

Mishnah Berurah 277

The Mishnah Berurah expands on the rules of manipulating light and fire through doors, shutters, and similar openings. It provides important background for present-day questions about actions that predictably cause lights to turn on or off.

ודוקא כשהוא נגד פתיחת הדלת ממש וקרוב אל הדלת בענין שכשיפתח הדלת יוכל להכבות ע"י הרוח המנשב מבחוץ ומש"כ כדרכו עיין במ"א שכתב דט"ס הוא דאפילו אם הוא פותח הדלת בנחת מ"מ הרוח מבחוץ מנשב ואסור וכן סתמו כמה אחרונים ועיין בבה"ל: (ג) הרוח - עיין במ"א סי' תקי"ד סק"ט דאפילו אם אין הרוח מנשב עתה ג"כ יש לאסור דבכל רגע ורגע הרוח מנשב וא"א להבחין בזה ויש מקילין בזה ונ"ל דבמקום הדחק יש להקל בזה כשפותח הדלת בנחת לאט לאט שלא יגרום הדלת גופא לרוח שיבא:

Source 9 · Acharonim
Verified

Shulchan Arukh, Orach Chayim 253

שולחן ערוך, אורח חיים רנ״ג — ד"ה דיני כירה ותנור ליתן עליה קדירה

Shulchan Arukh, Orach Chayim 253:1

This siman addresses placing food on heat sources before Shabbat and related issues of cooking and stoking fire. It is one of the classical loci used to discuss indirect causation and Shabbat-related activation concerns, though the specific modern question of motion sensors requires further contemporary application.

דיני כירה ותנור ליתן עליה קדירה בערב שבת. ובו ה סעיפים: כירה שהיא עשויה כקדירה ושופתין על פיה קדירה למעלה ויש בה מקום שפיתת שתי קדירות אם הוסקה בגפת שהיא פסולת של זתים או בעצים אסור ליתן עליה תבשיל מבע"י להשהותו עליה אלא א"כ נתבשל כל צרכו והוא מצטמק (פי' הולך וחסר) ורע לו דליכא למיחש שמא יחתה או שהוא חי שלא נתבשל כלל דכיון שהוא חי מסיח דעתו ממנו עד למחר ובכל הלילה יכול להתבשל בלא חיתוי אבל אם נתבשל קצת ולא נתבשל כל צרכו ואפי' נתבשל כל צרכו והוא מצטמק ויפה לו חיישינן שמא יחתה ואסור להשהותו עליה אא"כ גרף דהיינו שהוציא ממנה כל הגחלים או קטם דהיינו שכסה הגחלים באפר למעט חומם ואם נתן בה חתיכה חיה מותר כאלו היתה כולה חיה דע"י כך מסיח דעתו ממנה ואפי' אינה גרופ' (פי' שמשך הגחלים מהתנור) וקטומה (פי' שכסה הגחלים באפר) מותר לסמוך לה קדירה בסמוך חוצה לה ואם הוסקה בקש או בגבבא מותר לשהות עליה אפי' אינה לא גרופה ולא קטומה: הגה שני כירות המתאימות זו אצל זו ודופן של חרס ביניהם האחת גרופה וקטומה והשני' אינה גרופה וקטומה מותר לשהות על הגרופה וקטומ' אע"פ שמוסיף הבל משאינה גרופה וקטומה (גמ' פ' כירה) ותנור אפי' אם הוסק בקש או גבבא אסור אפילו לסמוך לו אפילו אם גרוף וקטום: הגה כ"ז שהיד סולדת בו [הגהות מרדכי] וכ"ש שאסו' לשהות בתוכו או על גבו וכופח שהו' מקו' שפיתת קדיר' אחת אם הוסק בקש או גבבא דינו ככירה בגפת או בעצים דינו כתנור [והתנורים שלנו דינם ככירה] [ר"ן ר"פ כירה וכל בו וכן משמע מפירש"י] ואם שכח ושהה אם הוא תבשיל שבשל כל צרכו מותר אפי' הוא מצטמק ויפה לו ואם הוא תבשיל שהתחיל להתבשל ולא בישל כל צרכו אסור עד מוצאי שבת ואם עבר ושיהה אסור בשניהם: הגה עד בכדי שיעשו (הגהות אשירי ורמב"ם פ"ג) ואם החזירם עכו"ם בשבת דינו כשכח ושיהה [הגהות אשירי] ואם החזירם ישראל דינו כעבר ושיהה [הגהות מרדכי] ואם מצטמק ורע לו מותר שהרי לא נהנה מן האיסור [ב"י וע"ל ריש סי' רכ"ז] וי"א שכל שנתבשל כמאכל בן דרוסאי (פי' שם אדם שהי' אוכל מאכלו שלא נתבשל כל צרכו) או שנתבשל כל צרכו ומצטמק ויפה לו מות' להשהותו על גבי כירה: הגה או אפי' על גבי תנור (המגיד פ"ג והגהות מרדכי ומיי' פ"ג וריש פ' כירה ב"י) אפי' הוסק בגפת ועצים ואפי' אינה גרופה וקטומה ולא הוזכרה גרופה וקטומה והיסק בקש ובגבבא אלא כשהתחיל להתבשל ולא הגיע למאכל בן דרוסאי וכן לענין אם נטל הקדירה מעליה ובא להחזירה עליה בשבת ואם שכח ושיהה תבשיל שהתחיל להתבשל ולא הגיע למאכל בן דרוסאי אסור ואין צריך לומר אם עבר ושיהה: הגה ונהגו להקל כסברא האחרונה. וכל זה בענין שהיה שהקדירה יושבת על כסא של ברזל או על גבי אבנים ואינה נוגעת בגחלים אבל הטמנה על גבי גחלים לדברי הכל אסור: הגה וי"א דאפילו אם הקדירה עומדת על גבי האש ממש כל זמן שהיא מגולה למעלה לא מקרי הטמנה ושרי וכן המנהג רק שנזהרים לנתקו קצת קודם השבת מן האש כדי שיוכל ישראל להסירו משם ואם לא נתקו מן האש ומצאו על גבי האש בשבת יש להסירו משם ע"י עכו"ם ואם ליכא עכו"ם מותר לישראל להסירו משם ויזהר שיקחהו משם בנחת ולא ינענע הגחלים ואז אף אם ינענען קצת דבר שאין מתכוין שרי. (מרדכי ריש פרק כירה והגהות מיי' פרק ז'): כירה שהיא גרופה וקטומה ונטל הקדירה מעליה אפילו בשבת מותר להחזירה כל זמן שהיא רותחת: הגה ועודה בידו (טור) ולא הניחה על גבי קרקע הגה ודעתו להחזירה (טור) ודוקא על גבה אבל לתוכה אסור ובתנור אסור להחזיר אפי' הוא גרוף וקטום והוא הדין לכופח אם הסיקו בגפת ועצים: הגה ודוקא שהתבשיל מבושל כל צרכו (ב"י) ואז מותר להחזירו אפילו לכירה אחרת אבל אם לא נתבשל כל צרכו אסור אפי' באותה כירה (מיי' פ"ג) וי"א דכל זה אינו אסור רק כשנטלו מן הכירה מבעוד יום ולא החזירו עד שחשכה אבל אם לקחו משם משחשיכה אפילו הניחו על גבי קרקע מותר (ר"ן פרק כירה וכל בו) וכן נוהגים להקל בתנורים שלנו שיש להם דין כירה וסומכים עצמם על דברי המקילין וטוב להחמיר מיהו אם נצטנן לכולי עלמא אסור [ב"י] וי"א דאם הוציא מאכל מן התנור בשבת אסור להניחו בכרים ובכסתות (הגה"מ פ"ז) י"א דכל שהוא סמוך לחשיכה או סמוך לברכו שהוא קבלת שבת לדידן (הגהות מרדכי) אם הוא סמוך כל כך שאם נצטנן הקדירה אי אפשר להרתיחה מבעוד יום דינו כמו בשבת עצמו ויש מקילין בזה והמנהג להקל אך טוב להחמיר במקום שאין צורך כל כך ודוקא על גבי כירה ממש אבל לסמוך אפי' סמוך לאש במקום שהיד סולדת בו שרי אפי' סמוך לחשיכה (הגהות מרדכי והגהות מיי') ובתנור אין חילוק בין להחזיר עליו או לסמוך אצלו ודוקא במקום שהיד סולדת אבל אין היד סולדת שם שרי אפי' בשבת כמו שיתבאר לקמן סי' שי"ח:

The Laws of Kirah and a Tanur, placing pots on them on Erev Shabbos. Containing 5 paragraphs: A Kirah is one which is constructed in the shape of a (large) kettle. Pots are placed on top of it, where it has its mouth, and there is room for placing two pots. If this Kirah was fired by means of Gefes [olive waste], or with wood, one may not place food on it to cook in the evening (on Erev Shabbos) with the intention of leaving it there (until after Shabbos arrives) – unless the food has already been fully cooked and is shrinking (i.e., continually getting bigger and smaller as a result from the cooking) to its detriment, in which case it need not be feared that the coals in the stove will be stirred. It is also permitted to place the pot on the stove if the food is raw, i.e. it has not been cooked at all. Since it is raw, one will not pay attention to it until the next morning, as it is can finish cook during the night without stoking the coals. However, if the food is cooked a little bit, or even if it is fully cooked but shrinking through cooking will benefit it, we are concerned that the coals might be stoked. Therefore, leaving it on the stove is forbidden unless the stove is raked, in other words, all the coals are removed from it or are covered with ashes, in other words the coals are covered with ashes to lessen the heat’s intensity. If a raw piece (of meat) is put into the pot, it is permitted just as if it would consist entirely of raw (meat), since now he will not pay attention to the entire pot. But even if the coals were not raked (meaning the coals were taken out of the oven) or covered with ashes (meaning the coals were covered with ashes) it is permitted to place a pot next to it, on the outside. If it was fired with straw or stubble, it is permitted to allow a pot to stay on it even if it was not Gerufa (raked from the stove) or Ketuma (the coals are covered with ashes). RAMA: If two Kirah stoves are joined one beside the other, with an earthenware partition between them: if one is Gerufa or Ketuma and the second is not Gerufa or Ketuma, it is permitted to allow a pot to stay on the one which is Gerufa or Ketuma, even though the one which is not Gerufa or Ketuma will add to its heat. However, as for a Tanur stove even if it was fueled by straw or stubble, it is forbidden to place (a pot) even adjacent to it – even if it is Garuf ve’katum RAMA as long as it is Yad soledes bo. (Haga'ot Mordechai) It goes without saying that it is forbidden to let a pot stay within it or on it. As for a Kupach-stove which has room for placing one pot on it, where it was fueled by straw or stubble, it has the status of a Kirah; where it was fueled by Gefes or wood, it has the status of a Tanur. (Our types of ovens have the status of a Kirah) (R"an). And if he forgot and left it (on the stove) if it is a Tavshil that is cooked all the way it is permitted even if it is food that improves as it condenses (called 'Mitztamech v'Yafeh Lo'). But if it is a dish that is beginning to cook and is not cooked all the way it is forbidden until Motzei Shabbos. Where one deliberately leaves a pot of food, it is forbidden in both cases RAMA: until a time period has elapsed (after Shabbos) during which the cooking done on Shabbos could be done (after Shabbos) (Ha'agahot Ashiri and Rambam). But if a Non-Jew puts it back on on Shabbos the law is the same as one who forgot and left it on (Ha'agahot Ashiri). And if a Jew puts it back on the law is the same as one who intentionally left it on. (Ha'agahot Mordechai). And if the food condensed through more cooking to its detriment it is permitted because he receives no benefit from the forbidden thing. (Beis Yosef, and see the beginning of Siman 237) There are those who say that where it has already been cooked to the degree of Ma’achal ben Derusa’i (i.e. the name of a thief who ate his food semi-cooked) or it is completely cooked and further cooking will improve it, it is permitted to leave it on a Kirah. RAMA: or even on a Tanur (HaMagid; Ha'agahot Mordechai; the beginning of the paragraph Kirah in the Beis Yosef) even one fired with Gefes (olive waste) or wood, and even if it was not Gerufa or Ketuma. In this opinion, Garuf ve’katum and firing with straw and stubble were mentioned only when the cooking process has begun but has not reached the stage of Ma’achal ben Derusa’i; or, where one has removed the pot from the stove and desires to return it on Shabbos. Where one forgets and leaves a pot of food, which has begun to cook, but has not reached the stage of Ma’achal ben Derusa’i , it is forbidden to eat it. It goes without saying where one intentionally leaves it there that it is forbidden to eat. RAMA: The people’s custom is to be lenient and follow this last opinion A Kirah that is Gerufa or Ketuma, if one removes a pot from it even on Shabbos, he may return it as long as it is boiling hot Rema: and it is still in his hand (Tur) and he has not placed it on the floor RAMA: and his intention is to return it (Tur). This is specifically to the top [of the stove] but to the inside it is forbidden. It is forbidden to return [a pot] to a Tanur even if it is raked and covered up. Similarly, a Kupach when fired with Gefes [olive waste] and wood. RAMA: This is specifically when the food is fully cooked (Beis Yosef). It is then permitted to return it, even to another Kirah. But if it is not fully cooked it is forbidden even to return it to the same Kirah. There are those who say that all is forbidden only where one removes it from the Kirah while it is still day and wishes to return it after dark. However, if he removes it after dark it is permitted [to return] even if in the meantime he places it on the floor. (R"an Perek Kirah). This is our custom to be lenient for our [type of] ovens, that have the status of a Kirah, because the lenient opinion is relied upon. And it is better to be more stringent. But in all opinions where it has cooled off it is forbidden [to return it] [Beis Yosef]. There are those who say that if one removes the food from the Tanur on Shabbos it is forbidden to wrap it up in pillows or blankets. There are those who say that close to dark or close to Barchu which for us constitutes an acceptance of Shabbos (Ha'agahot Mordechai), where it is so close to Shabbos that if the pot would be cool it would be impossible to boil it up while still day, the same law (of Chazora) applies as to Shabbos itself. Some are lenient in this, and such is the accepted practice. Nevertheless it would be preferable to be stringent where there is no real need. But this refers only (to returning) directly onto a Kirah, however placing it next to it (the stove) or even next to a fire where the heat is Yad soledes bo is permitted even close to dusk. For a Tanur there is no difference between returning a pot onto it or next to it when that area is at a temperature of Yad soledes bo, but if that area is not Yad soledes it is permitted even on Shabbos, as will be stated below in Siman 318.

Source 10 · Acharonim
Verified

Shulchan Arukh, Orach Chayim 277

שולחן ערוך, אורח חיים ער״ז — ד"ה שלא לגרום כיבוי הנר

Shulchan Arukh, Orach Chayim 277:1

This siman deals with opening shutters and doors that may cause flames to be exposed or extinguished. It is relevant for the broader Shabbat principle that indirect actions affecting fire can be prohibited when they inevitably alter the fire's state.

שלא לגרום כיבוי הנר. ובו ה סעיפים: נר שמונח אחורי הדלת אסור לפתוח הדלת (כדרכו) (רמב"ם פ"ה ומרדכי פרק כ"ב וב"י בשם סמ"ג) שמא יכבנו הרוח (אבל) לנעול הדלת כנגדו מותר (ת"ה סי' נ"ט) (וה"ה בחלון שכנגד הנר שעל השלחן) (מרדכי פכ"ב וב"י בשם תוס' וטור) ואם הוא קבוע בכותל באחורי הדלת אסור לפתוח הדלת ולנעלו כדרכו שמא תהא הדלת נוקשת עליו ותכבנו אלא פותח ונועל בנחת ואם הוא קבוע בדלת עצמו שפתיחתו ונעילתו מקרב השמן לנר או מרחיקו ממנו אסור לפותחו ולנעלו: הגה ובנר של שעוה מותר לפתוח ולנעול אע"פ שהוא קבוע בדלת (ב"י): אסור לפתוח הדלת כנגד המדורה שהיא קרובה קצת אל הדלת ואפי' אין שם אלא רוח מצויה אבל אם היה פתוח כנגדה מותר לסגרו ואין בו משום מכבה:

[Safeguards] to prevent the [Shabbos] lights from being extinguished. Contianing 5 paragraph: If a candle is placed behind a door, it is forbidden to open the door (in the regular manner) (Rambam, Perek 5; Mordechai Perek 22; Beis Yosef in the name of the Smag) lest the wind will blow it out, (however) it is permitted to shut the door. (This is the law regarding a window that is next to a candle on a table)(Mordechai and Beit Yosef in the name of Tosfos and Tur). If it is fixed to the wall behind the door, it is forbidden to open and shut the door in the regular manner, lest the door will knock it and extinguish it, rather one should open and shut the door gently. If it is fixed to the door itself, and by opening and shutting the door the oil is moved nearer or farther from the wick, it is forbidden to open and shut the door. Rema: As for a wax candle, it is permitted to open and shut the door, even though it is fixed to the door. (Beis Yosef) It is forbidden to open a door opposite a fire that it is near the door; even if only a calm wind is blowing. However, it is permitted to shut it if it was open opposite the fire, and is not considered Mechabeh (Extinguishing).