Trigger: Activity Recognition
This trigger fires when the device detects you are performing a particular physical activity with the specified confidence level. It uses Google Play Services to analyze sensor data and determine your current movement state.
Options
When configuring this trigger, select one of the following activities:
- In Vehicle - Traveling in a car, bus, train, or other motorized transport
- On Bicycle - Riding a bicycle
- Running - Running or jogging
- Walking - Walking at a normal pace
- Still - Stationary with minimal movement
Confidence Level
Set a confidence threshold between 10% and 100%. This represents how certain the device must be that you are performing the selected activity before the trigger fires.
- Lower values (30-50%) - Trigger fires more readily, but may produce false positives
- Higher values (70-90%) - More accurate detection, but may occasionally miss legitimate activity changes
Comparison Mode
- Greater than or equal to (≥) - The trigger fires when confidence rises to or above your threshold. Use this to detect when an activity starts.
- Less than (<) - The trigger fires when confidence drops below your threshold. Use this to detect when an activity ends.
Example 1: Auto-connect car Bluetooth and play music
When you get in your car, automatically enable Bluetooth and start playing music.
Triggers Activity Recognition - In Vehicle (≥ 50%)
Actions Set Bluetooth State (Enable Bluetooth) Wait (5 Seconds) Connect to Bluetooth Device (Car Stereo) Media Controls (Play)
Example 2: Disable Wi-Fi when leaving home on foot
When you start walking, disable Wi-Fi to save battery.
Triggers Activity Recognition - Walking (≥ 60%)
Actions Set Wi-Fi State (Disable Wi-Fi)
Constraints Wi-Fi Connected
Example 3: Log when you stop running
Detect when a run has ended by monitoring for confidence dropping below threshold.
Triggers Activity Recognition - Running (< 50%)
Actions
Write To File - Append "{hour}:{minute}:{second} - Run ended" to exercise_log.txt
Example 4: Enable Do Not Disturb when stationary at work
Automatically silence your phone when you're sitting still at work.
Triggers Activity Recognition - Still (≥ 70%)
Actions Set Do Not Disturb Mode (Priority Only)
Constraints Location (At Work)
Tips for Reliability
- Enable location services - GPS and network location data feed into the recognition algorithm and improve accuracy
- Enable Wi-Fi scanning - Even when not connected, Wi-Fi scanning helps identify location context
- Enable Bluetooth - Bluetooth connections (e.g., car audio systems) can help confirm vehicle detection
- Adjust the update rate - The polling interval can be configured in MacroDroid Settings → Activity Recognition Update Rate (default is 120 seconds). Lower values detect changes faster but use more battery.
Permissions
On Android 10 and above, this trigger requires the Activity Recognition permission. MacroDroid will prompt you to grant this permission when you add the trigger.
Notes
- The trigger will not fire repeatedly for the same activity. It only fires when the detected activity changes and crosses your confidence threshold.
- When using greater than (≥) mode, the trigger fires when the selected activity becomes the most probable activity AND exceeds your confidence level.
- When using less than (<) mode, the trigger fires when confidence for the selected activity drops below your threshold (useful for detecting when an activity has ended).
- Detection accuracy depends on your device's sensors (accelerometer, gyroscope) and their quality. Some electric or very smooth vehicles may be harder to detect.
- This trigger uses the Google Activity Recognition API via Google Play Services.
Troubleshooting
- Trigger never fires - Lower the confidence threshold, ensure Google Play Services is installed and up to date
- Too many false triggers - Increase the confidence threshold
- Delayed detection - Reduce the Activity Recognition Update Rate in MacroDroid Settings
- Vehicle not detected - Ensure location services are enabled; try lowering the confidence threshold
See Also
- MacroDroid Settings Action - Can modify update rate