Trigger: Proximity Sensor
The Proximity Sensor trigger fires when the device's proximity sensor detects changes in distance. This can be used to detect when something (like your hand or face) is near or far from the device, as well as wave gestures for hands-free control.
Options
- Near - Fires when an object is detected close to the proximity sensor
- Far - Fires when the proximity sensor detects that an object has moved away
- Slow Wave - Fires when an object passes near the sensor with a wave gesture lasting 500ms or longer
- Fast Wave - Fires when an object passes near the sensor with a quick wave gesture under 500ms
Examples
Example 1: Silence phone when placed face down
Triggers Proximity Sensor: Near
Actions Set Ringer Mode: Vibrate Only
Constraints Device Orientation: Face Down
Example 2: Toggle flashlight with hand wave
Triggers Proximity Sensor: Fast Wave
Actions Toggle Flashlight
Example 3: Answer call with wave gesture
Triggers Proximity Sensor: Slow Wave
Actions Answer Call Enable Speakerphone
Constraints Call State: Ringing
Wave Gesture Detection
Wave gestures work by detecting a near-to-far transition:
- The timer starts when an object moves near the sensor
- Fast Wave: Completes if the object moves away within 500 milliseconds
- Slow Wave: Completes if the object moves away after 500 milliseconds or more
Notes
- By default, this trigger only works when the device's screen is on
- You can enable the "Proximity sensor when screen off" setting in MacroDroid's trigger settings to allow detection when the screen is off
- Device compatibility varies - some manufacturers (notably Samsung) keep the proximity sensor deactivated except during specific activities like phone calls
- The proximity sensor is a binary sensor (near/far) on most devices, not a distance-measuring sensor
- For the trigger to fire, the state must actually change (e.g., from far to near) - it won't fire repeatedly while an object remains near
See Also