The Chatam Sofer wrote that on Shabbat "The Torah insists that the bodies of Yisrael should rest but it is not interested in the labor itself." Thus there would be no problem at all if a way could be found to have a non-Jew perform labor on Shabbat without any Jew being involved. Is there any way for labor to be performed without human intervention, at least for essential needs?
It is clear that nobody is permitted to cause damage to somebody else even if it is done in an indirect way. However, "between man and G-d," with respect to the laws of Shabbat under certain conditions, labor can be performed indirectly. The reason is that the final result is the important factor in damages, while what is important with respect to Divine prohibitions is the action itself and not the result.
An indirect action is called "gramma", from the Hebrew root meaning "to cause" something to happen. The source for permitting indirect labor is a Mishna, where it is written that if a fire breaks out that doesn't involve mortal danger, "all the vessels can be separated by a barrier, either full of water or empty, so that the flames will not cross over." [Shabbat 120a]. That is, one is permitted to fill jugs with water and place them in the path of the fire. When the heat bursts the jugs, the water will extinguish the fire. In a more common example, if a brush fire breaks out but there is no mortal threat, water may be poured around the outside of the fire but not directly on the flame. The actions described are indirect ones – gramma.
In the Talmud, this is derived from the verse, "Do not do any labor" [Shemot 20:9]. Direct labor is prohibited, but gramma is allowed. This has also been quoted in the Shulchan Aruch: "To cause a flame to go out is permitted" [Orach Chaim 334:22]. It is noted in Bi'ur Halacha that this is true for all thirty-nine categories of Shabbat labor and not only for extinguishing a flame. But the RAMA limits the permission to a case of significant financial loss, such as in a fire. Based on this, gramma is allowed on Shabbat only in a case of a strong need, the equivalent of "financial loss."
A common example of an action of gramma is to change the setting of a Shabbat timer. For example, the timer might be set to turn the lights off at midnight but, if there is a strong need, the time can be shortened by mechanically adjusting the setting.
Two conditions (which are based on the same principle) are necessary for the action to be considered gramma:
(1) At the moment that the gramma action is performed, no simultaneous action should take place, and no sequential chain of action should be started (the initiating action must be insignificant from the point of view of Shabbat). For example, turning on a delay timer that will cause a specific action after a preset time is not gramma. It is like shooting an arrow, which is considered a direct action even if the result takes place far away and after a delay. Placing a jug of water in the path of a flame or changing the setting of a Shabbat timer, on the other hand, do not cause any immediate effect.
(2) An independent factor, which was prepared before Shabbat or is created automatically, will take effect "later on" and be influenced by the action that was performed by the person. Only then will the desired effect take place. In the previous examples, the flame will reach the water "later," just as the timer switch will be activated after an indeterminate delay.
Rabbis of our generation agree that medical and security needs have the halachic status of a significant loss so that equipment used for such needs can be operated on a gramma principle.
The Zomet Institute has developed and builds Shabbat devices for essential needs that operate on this principle. "Electronic gramma" is a special circuit that puts out a very short pulse (one millisecond or less) on a regular cycle, for example, once every ten seconds. When a person changes the position of a switch or presses a special button, he or she is not doing anything, and he does not initiate any sequential steps. Only when the test pulse arrives will the circuit "discover" that the switch has been moved or the button has been pushed. And then, the desired action will occur.
The mechanism includes a safety circuit to guarantee that nothing will ever happen at the instant that the switch is pressed.
It should be noted that the time interval described above as "later on" must be long enough to be perceptible to a human being, and it must be perceived as an unneeded time delay.
There are several categories of gramma devices depending on what they do.
(1) Independent on/off switch: Each action is performed as a result of gramma, as the need arises.
(2) Automatic shut off after a preset time: In this case, there is no human intervention in turning the device off. This is appropriate when it is possible to estimate in advance how long it will be needed. An example is an audioscope (flashlight) for checking the ear.
(3) A short action which initiates a sequence of events. An example would be a button to open an automatic gate. One press of the button opens the gate for a preset time, after which it automatically closes.
A Shabbat telephone for essential needs, such as health care and security, operating on the principle of gramma. All the buttons, including the receiver, do not react immediately when pressed (or if the receiver is lifted or put down). An internal electronic scanner checks all the switches every three seconds, and the result is indirect, by a mechanism of gramma.
This is one of the most widely used devices developed by The Zomet Institute, based on the principle of gramma, for the use of the handicapped and others with limited mobility. Such people use a scooter to move around on weekdays, and they can now move from one place to another on Shabbat for essential needs. Gramma is used in such equipment to turn on the main motor. Once the current has been turned on, the speed is changed by applying the principle of modifying an existing electric current.
Shabbat Security Patrol:
On weekdays, secure areas are patrolled by a vehicle that helps protect them from terrorists and thieves. Clearly, the vehicle can be used on Shabbat, because it is needed to guard against mortal danger, which overrides the laws of Shabbat. However, it is best to minimize the desecration of Shabbat as much as possible. The Zomet Institute has therefore developed a special mechanism for this purpose which operates using the principle of gramma. This is used for such items as the ignition, the lights, the searchlight, and more. The motion of the vehicle, which is not electric but depends on controlling the fuel with an accelerator, is handled in a different way.
Multipurpose Gramma Plug:
The possible uses of gramma are almost unlimited in such matters as health care and security, among others. This multipurpose plug, which operates on the principle of gramma, allows any electrical device (which connects to a standard electrical outlet) to be operated on Shabbat. It can be used in private homes, institutions, hospitals, homes for the elderly, etc. With this plug, essential equipment can be used without violating the laws of Shabbat.
For more information (in Hebrew):
Rabbi Shmuel David, Milking on Shabbat, Techumin
Rabbi Uri Dasberg, Milking on Shabbat and Gramma, Techumin
Rabbi Shlomo Rosenfeld, Milking on Shabbat Through the Use of Gramma, Techumin
Rabbi Uri Dasberg, Gramma for Milking, Techumin
Rabbi Zeev Vitman, Gramma for Milking, Techumin