One may not approach a door that automatically opens when it senses someone near it. One who does so is viewed as directly triggering the electricity that opens the door. It is immaterial whether the system works through floor sensors, an electric eye, a motion detector, or the like. As we have seen (section 2), according to many, including Rav Kook, turning on an electrical appliance is prohibited by Torah law.
One who finds himself in a hotel or hospital with automatic doors must find an alternative way to enter that does not involve using electricity. If a non-Jew approaches the door in order to enter, a Jew may follow him in (below 25:1-2). But if the person approaching the door is a Jew who does not observe Shabbat, a Shabbat observer may not follow him in, because the Shabbat observer may not benefit from the Shabbat desecration of a fellow Jew. Furthermore, when an observant Jew takes advantage of Shabbat desecration and benefits from it, it is considered a desecration of God’s name. Even though some are lenient in this case, it is proper to be stringent. Only under pressing circumstances, when there is no alternative, may one rely on those who are lenient.
Doctors and nurses may enter a hospital through an automatic door, as their work entails saving lives. Others may then follow them through the door. Ideally, the hospital administration should try to minimize the need for Shabbat desecration and arrange alternative entrances for visitors and staff to enter without activating any electrical devices.
Some say that if one unintentionally came too close to an automatic door, thus causing it to open, he must remain in place, because moving away will cause the door to close. They maintain that he should wait until a non-Jew arrives and ask the non-Jew to stand near him, at which point he can leave. Afterward, when the non-Jew leaves as well, the non-Jew will be the one who causes the door to close. However, if remaining in place causes the Jew anguish, he may simply leave, as he is just walking normally and does not care if the door is open or closed. His act of leaving is a psik reisha de-lo niĥa lei brought about via grama, which is not forbidden. Even if the person who mistakenly caused the automatic door to open did in fact want to enter, in a time of need he may still enter, since the melakha was unintentional. In contrast, if he intended for the door to open but forgot, and only later remembered, that it is forbidden, he should not enter, because one may not benefit from a melakha that was unknowingly (albeit intentionally) performed on Shabbat (SA 318:1; see n. 11 above and 26:4 below).