Changes

3,172 bytes added ,  Yesterday at 20:26
no edit summary
Line 1: Line 1: −
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
<pre class="header-style">This trigger will fire when a Stopwatch hits the configured time value. Stopwatches are named timers that can be started, stopped, and reset using actions, and this trigger allows you to perform actions when a stopwatch reaches a specific duration.</pre>
This trigger will fire when a Stopwatch hits the configured time value.
     −
You can use integer variables to trigger based on seconds.
+
''' Options '''
</pre>
+
 
* ''[https://macrodroidforum.com/wiki/index.php/Variables#Integer Variable | Integer]''
+
* '''Stopwatch''' - Select an existing stopwatch or create a new one
 +
* '''Time Value''' - The duration at which the trigger should fire, specified in hours, minutes, and seconds
 +
* '''Variable''' - Optionally use an integer variable to specify the time value in seconds
 +
* '''Use Alarm''' - When enabled (default), uses Android's alarm functionality to ensure precise timing even when the device is asleep
 +
 
 +
''' Variable Support '''
 +
 
 +
The time value can be specified using an integer variable instead of a fixed value. The variable should contain the number of seconds at which the trigger should fire. Dictionary keys can be used to access nested values.
 +
 
 +
''' Requirements '''
 +
 
 +
* Schedule Exact Alarm permission (Android 12+)
 +
 
 +
''' Examples '''
 +
 
 +
'''Example 1: Pomodoro technique'''
 +
 
 +
Get notified when a 25-minute work session ends:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Stopwatch: Work Timer at 25m 0s</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Display Notification: "Time for a break!"
 +
Vibrate: Long pulse
 +
Speak Text: "Work session complete, take a 5 minute break"</pre>
 +
 
 +
'''Example 2: Exercise intervals'''
 +
 
 +
Trigger at specific intervals during a workout:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Stopwatch: Workout at 1m 0s</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Vibrate: Short pulse
 +
Speak Text: "Switch exercise"</pre>
 +
 
 +
'''Example 3: Parking meter reminder'''
 +
 
 +
Get reminded before parking expires:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Stopwatch: Parking at 1h 45m 0s</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Display Notification (High Priority): "Parking expires in 15 minutes!"
 +
Vibrate: Alarm pattern
 +
Speak Text: "Warning: Parking expires soon"</pre>
 +
 
 +
'''Example 4: Variable-based timer'''
 +
 
 +
Use a variable to set dynamic timer duration:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Stopwatch: Custom Timer at {lv=timer_duration} seconds</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Display Notification: "Timer complete"
 +
Stopwatch: Reset "Custom Timer"</pre>
 +
 
 +
''' How Stopwatches Work '''
 +
 
 +
1. Create a stopwatch with a unique name
 +
2. Use the Stopwatch action to Start, Stop, or Reset the stopwatch
 +
3. Configure the Stopwatch trigger to fire when the stopwatch reaches a specific time
 +
4. The trigger will fire even if the device screen is off (if Use Alarm is enabled)
 +
 
 +
''' Notes '''
 +
 
 +
* The stopwatch must be active (started) for the trigger to fire
 +
* If the stopwatch is already past the specified time when enabled, the trigger will not fire until the stopwatch is reset and started again
 +
* For very short delays (5 seconds or less), an alternative timing mechanism is used instead of alarms for better accuracy
 +
* When using variables, changes to the variable value will cause the trigger to reschedule
 +
* The "Use Alarm" option is recommended to ensure the trigger fires even when the device is in deep sleep
 +
* Stopwatches persist across app restarts and device reboots
 +
* If a stopwatch does not exist when importing a macro, it will be automatically created
 +
 
 +
''' See Also '''
 +
 
 +
* [[Action:_Stopwatch_Control|Stopwatch Control]]
 +
* [[Trigger:_Regular_Interval|Regular Interval]]
 +
* [[Constraint:_Stopwatch|Stopwatch Constraint]]
 +
* [[Action:_Wait_Before_Next_Action|Wait Before Next Action]]