Run Action Plugin
- toggle status: changes the status of an alarm. If enabled, it gets disabled and vice-versa
- Enable: enable an alarm. If already enabled, the action is ignored
- Disable: disable an alarm. If already disabled, the action is ignored
- Run: run an alarm. This will run the selected alarm regardless of its status or scheduled time.
Each of these operations can be applied to an alarm listed or you can also pass a variable with an alarm id to the field "Run action for id". Finally you can also pass variables to the personal message field to be shown when an alarm is triggered.
In the sample project, the task "Run Battery Alarm" is run when the event "battery full" is triggered. It does the following:
- Set variable %batterylevel to %BATT
- Set variable %alarmid to %nextAlarmId (more on this later)
- Run alarm with %alarmid and message "Battery level is at %batterylevel%"
The example uses %nextAlarmId set from other events but it is useful to have one specific alarm that you can leave disabled just to run this kind of alarm from Tasker.
Set Variable Plugin
- Time in milliseconds
- Readable time, for example, "Tomorrow at 08:00"
- Id of the alarm. You can use this id with the Run Action plugin.
Note that a requirement of Tasker is that all variables passed to plugins must be local. That means they have to be all lowercase. If you want to access this value in other tasks, you have to set the value of this variable to a global one. See more about Tasker variables here.
In the sample project, the task "Update Next Alarm" is called whenever an alarm is dismissed, set or disabled. This ensures that we can always have the time of the next alarm in a Tasker variable updated.
- triggered (id 0)
- snoozed (id 1)
- dismissed (id 2)
- set (id 3)
- disabled (id 4)
This can apply to all alarms or only to a specific one. Check the box "Restrict alarm" to restrict the event only to a specific alarm.
When any of these events are triggered, AlarmPad also updates the following two variables:
- %alarmpadstatus: indicates the id of the status that triggered the event according to the values above.
- %alarmpadid: indicates the id of the alarm that triggered the event
On the sample project, the task "Handle Alarm Event" is called whenever any of the events from AlarmPad are triggered. It checks for the current status of the variable %alarmpadstatus and act on them accordingly. For example, when %alarmpadstatus = 0, we set the global variable %isAlarmRinging to 1. This variable is then set again to 0 when %alarmpadstatus = 1 (snoozed) or %alarmpadstatus = 2 (dismissed).
We use %isAlarmRinging in another task to dismiss an alarm if it is set to 1 and the device was shaken.
Dismissing and snoozing an alarm
You can also dismiss and snooze an alarm from Tasker using a "Send Intent" task. If you want to dismiss an alarm, set its action to com.thetalkerapp.alarm.ALARM_DISMISS. Similarly, to snooze an alarm, set its action to com.thetalkerapp.alarm.ALARM_SNOOZE.
In the sample project, the tasks "Dismiss Alarm" and "Snooze Alarm" show how this is done.
Setting an alarm
You can also use Tasker's "set alarm" task to set a new alarm. When adding an alarm from inside AlarmPad, check the box "remember my selection" to set the options you want for the alarms as default. Then, when setting an alarm from Tasker, these default options will be remembered.