Trigger: Light Sensor
The Light Sensor trigger fires when the ambient light level transitions above or below a specified threshold value. The trigger activates on the transition between states, not continuously while in a particular state.
Options
- Light Level (lux): The threshold light level in lux units. The current ambient light level is displayed in the configuration dialog for reference.
- Direction:
- Decreases to: Trigger fires when the light level drops from above the threshold to at or below it
- Increases to: Trigger fires when the light level rises from below the threshold to at or above it
Settings
In MacroDroid Settings under Trigger Options > Light Sensor, you can configure:
- Background Scan Rate: How often to check the light level when the screen is off (in minutes). Set to 0 to disable background scanning.
Examples
Example 1: Increase Brightness in Dark Environment
Triggers Light Sensor - Decreases to 50lx
Actions Set Brightness - Auto Brightness: OFF Set Brightness - Level: 100%
Sets screen brightness to maximum when the ambient light drops below 50 lux.
Example 2: Toggle Night Mode Based on Light
Triggers Light Sensor - Decreases to 100lx
Actions Set Variable - night_mode = true Enable Macro - Night Mode Settings
Constraints Time of Day: 6:00 PM - 11:00 PM
Activates night mode when it gets dark in the evening.
Notes
- The trigger only fires on transitions - it will not fire again until the light level crosses the threshold in the opposite direction.
- By default, the light sensor only operates when the screen is on.
- Enabling background scanning (screen off operation) will cause significant battery drain as it requires keeping the CPU active.
- The minimum time between sensor checks is 500 milliseconds to prevent excessive processing.
- This trigger requires the device to have a light sensor. It will not appear on devices without one.
- Light values are measured in lux (lx). Typical values:
- Direct sunlight: 10,000+ lx
- Overcast day: 1,000-2,000 lx
- Office lighting: 300-500 lx
- Living room: 50-300 lx
- Twilight: 10-50 lx
- Full moon: 0.1 lx
Battery Warning
Enabling background light sensor scanning (when the screen is off) is strongly discouraged as it will cause significant battery drain. Only use this feature if absolutely necessary and you understand the battery impact.
See Also