Skip to main content

Events

For changes shared across selected wearers, see group-variable value and connection-count events. These are separate from the event for a coach changing an exposed workspace variable.

Event variables

Events are the entry points of a program. Put the actions to run inside the event block. A block that listens for a task, game, calendar, or device event does not enable that feature or cause the event itself.

Use Lock Data → event variable inside the event to read its details. The dropdown changes with the enclosing event. Filter by title, ID, or event value when only some occurrences should count.

Community-chat gag status​

When community-chat gag changes runs when the gag status changes on an eligible keyholder-controlled lock, not a self lock. Its community-chat gag enabled? event variable is a Boolean snapshot of the new state. Compare it with true to distinguish enabling from disabling. The event does not itself enable the gag.

Enabling, disabling, and timed expiry produce events, normally delivered by a 15-second background sweep. Repeating the same status does not produce another event. These handlers cannot open dialogs. If a handler changes the gag itself, that change takes effect but does not trigger another round of gag-status handlers. Relationship changes and lock endings clear the gag and pending events rather than running old handlers against a new relationship.

Use Lock Data → is → community-chat gag enabled when you need this lock's current execution state instead of the event snapshot. Draft tests simulate actions and expiry; select the status event explicitly to test its handler. See gag actions and the Code example.

Reading event variables​

Place Lock Data → event variable inside an event, then select a field from its dropdown. The tables below use the same labels as the editor. These are read-only values for that occurrence; use set variable to copy one into a workspace variable when you need it later. Pass it as a parameter when calling a reusable function.

integer means a whole number; number can include a fractional part; string is Text in Manage variables; boolean is true or false. varies preserves the changed variable’s type. Date text and numeric timestamps are different values: check each field’s units before connecting it to a date/time input.

For a Boolean event field in an if condition, use compare values → event variable = true. For text, use a comparison or text contains. Connect numeric event fields to supported calculations, or use create text with to include them in a message.

Common event variables​

Common event variables

Most events offer these fields in addition to the values listed beside their block. The ordinary wheel-result, wheel-text-action, and dice-roll events expose only their own listed fields.

Event variableTypeDescription
event namestringName of the source event, such as task.completed or lock.time_changed.
event timestamp (Unix seconds)integerTime of the source event in Unix seconds. Connect directly to seconds-based date/time blocks.
triggered by extension?booleanTrue when the source is an extension or a recognized built-in module.
triggered by keyholder?booleanTrue when the event reports a direct keyholder action.
triggered by wearer?booleanTrue when the event reports a direct wearer action.
triggering extensionstringExtension slug or built-in module ID, such as wheel, dice, task, or public_voting. Empty for direct participant changes.

Fields describe the source event, not necessarily the current lock state. A field listed in the dropdown can still be absent from a particular payload: text generally becomes empty, numbers become 0, and Booleans become false. Buttons, schedules, and custom events do not necessarily supply the same metadata as webhook events. Do not treat a missing timestamp as a real date or assume a false actor flag identifies another actor.

Group variable events​

Use when group variable [score] changes to handle one exact key, or when a group variable changes for all enabled group variables. Both provide the variable name, previous/new values, connected count, and source username/user ID/lock ID. Program changes identify the originating lock's wearer; management edits identify the owner. No local value copies are needed. These handlers run in the background and cannot open dialogs. See group-variable examples and event semantics.

Buttons and schedules​

when lock started

Runs for the lock-start event. Editing or saving an already running program does not start the lock again.

Event variables

Uses the common event variables. No additional event-specific fields.

on GUI button

Set role, text, color, active, visible, cooldown, and optional tooltip text. Put actions inside its body.

Event variables

Uses the common event variables. No additional event-specific fields.

on coin flip

Set role, title, active, visible, cooldown, and tooltip. The server selects a fair heads/tails result; only that outcome's branch runs.

Event variables

Uses the common event variables. No additional event-specific fields.

on spin wheel

Set role, title, description, button color, enabled, visible, cooldown, and tooltip. Add 2–12 options, each with a label, color, and action branch.

Event variables

Uses the common event variables. No additional event-specific fields.

every … first run …

Repeats in minutes, hours, or days, with a minimum interval of 10 minutes. Choose the first run at lock start or after the delay.

Event variables

Uses the common event variables. No additional event-specific fields.

every selected weekday

Select one or more weekdays, 1–12 times in HH:mm format, and wearer-local time or UTC. Select all days for a daily schedule.

Event variables

Uses the common event variables. No additional event-specific fields.

For controls, visible determines whether the control appears; active/enabled determines whether it can be used while shown. An unconnected visible input defaults to true. Role limits use to wearer, keyholder, or either participant. Connect a Duration block for cooldown; zero means no cooldown. A disabled wearer-controls preview cannot execute the program.

Weekly schedules are checked once per minute. Duplicate times run once. Wearer-local time uses the wearer or lock timezone, not the editor's timezone. During daylight-saving changes, missing times are skipped and repeated times run once. After downtime, one overdue run is processed before the next future time is scheduled.

Lock, voting, and pillory events​

when lock time changed

When lock time changes, including task/Jigsaw rewards and PLE actions. A time change made inside this trigger is saved but does not trigger the same event again.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
time changed (seconds)integerApplied lock-time change in seconds; positive adds time and negative removes time.
before release datestringRelease date/time before the change, as date text. This is not a numeric Unix timestamp.
after release datestringRelease date/time after the change, as date text. This is not a numeric Unix timestamp.
requested delta (seconds)integerRequested lock-time change in seconds, before limits or other adjustments.
applied delta (seconds)integerActual lock-time change in seconds after adjustments. May differ from the requested amount, including zero.
when lock frozen

When the lock enters its frozen state.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
before frozen statebooleanWhether the lock was frozen before this change.
after frozen statebooleanWhether the lock is frozen after this change.
freeze duration (seconds)integerFreeze duration supplied by the event, in seconds. Zero alone does not distinguish an indefinite freeze from an omitted duration.
when lock unfrozen

When the lock leaves its frozen state.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
before frozen statebooleanWhether the lock was frozen before this change.
after frozen statebooleanWhether the lock is frozen after this change.
freeze duration (seconds)integerFreeze duration supplied by the event, in seconds. Zero alone does not distinguish an indefinite freeze from an omitted duration.
when timer hidden

When remaining-time visibility is hidden.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
timer visible beforebooleanWhether the timer was visible before the change.
timer visible afterbooleanWhether the timer is visible after the change.
when timer revealed

When remaining-time visibility is restored.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
timer visible beforebooleanWhether the timer was visible before the change.
timer visible afterbooleanWhether the timer is visible after the change.
when keyholder trusted

When the lock's keyholder is trusted.

Event variables

Uses the common event variables. No additional event-specific fields.

when max date increased

When the maximum end date increases. Read the old/new dates and delta from the event.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
before max release datestringPrevious maximum release date/time, as date text; empty when not supplied.
new maximum datestringNew maximum release date/time, as date text.
new maximum timestampintegerNew maximum release date as a Unix timestamp in milliseconds. Divide by 1000 before using seconds-based date/time blocks.
delta secondsintegerChange to the maximum release date, in seconds.
when share link changed time

When a share-link action changes lock time.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
voter usernamestringVoter name supplied with the event; defaults to Visitor when no name is supplied.
time changed (seconds)integerApplied share-link time change in seconds; positive adds time and negative removes it.
when community vote received

After an add, remove, or random Public Voting vote is saved, even if a limit prevents a time change. Requested and applied seconds can differ. Use the public-voting control blocks to change voting settings; configuration changes do not emit this vote event.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
vote type (add / remove / random)stringVote choice: add, remove, or random.
total votes receivedintegerTotal votes reported after this vote.
requested time change (seconds)integerRequested lock-time change in seconds, before limits or other adjustments.
applied time change (seconds)integerActual lock-time change in seconds after adjustments. May differ from the requested amount, including zero.
cards changedintegerCards changed by this vote. For pillory this represents cards added.
when pillory vote received

After a pillory vote is saved, including public-link votes. Read the current vote's time, total votes, accumulated vote time, and cards added.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
time added by this vote (seconds)integerLock time added by the current vote, in seconds, when supplied.
total time added by votes (seconds)integerAccumulated lock time added during pillory, in seconds.
total votes receivedintegerTotal votes reported after this vote.
cards addedintegerCards changed by this vote. For pillory this represents cards added.
when pillory entered

When pillory starts.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
pillory reasonstringReason supplied when pillory was started.
pillory duration (seconds)integerPillory voting duration supplied by the event, in seconds.
when pillory left

When pillory ends. Useful for recording its outcome.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
time added during pilloryintegerAccumulated lock time added during pillory, in seconds.
current vote time addedintegerLock time added by the current vote, in seconds, when supplied.
when lock archive/removal

When the archive/removal event is emitted. Treat this as a lifecycle notification; an ended session is not an active lock for further lock actions.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
archive sourcestringSource reported for the archive or removal operation.
archive actor rolestringRole of the actor responsible for the archive or removal.
archive lock idstringID of the affected lock.

Tasks and verification​

when task assigned

After task assignment. Store the task run id to recognize this specific assignment later.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
task run idstringID of this particular task assignment. Save it to match later completion or review events.
task idstringID of the task definition. Reassigning the same task can produce a different task run ID.
task statusstringStatus reported for this assignment or quiz result.
task pointsnumberTask points supplied with this event; this is not the lock’s total task-point balance.
task titlestringTitle or task text supplied with the assignment.
task descriptionstringAdditional task instructions; empty when none are supplied.
when task vote ended

When the task verification vote ends. Inspect approval/status before treating it as success.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
task submission timestamp (Unix seconds)integerOriginal task-photo submission time in Unix seconds, or the recorded completion or failure time for the task’s outcome when no photo submission exists; 0 if no relevant timestamp is available. Photo submissions keep their original time even when reviewed later.
task run idstringID of this particular task assignment. Save it to match later completion or review events.
task idstringID of the task definition. Reassigning the same task can produce a different task run ID.
task statusstringStatus reported for this assignment or quiz result.
task pointsnumberTask points supplied with this event; this is not the lock’s total task-point balance.
task titlestringTitle or task text supplied with the assignment.
task descriptionstringAdditional task instructions; empty when none are supplied.
photo verification approved?booleanWhether the task-photo review was approved. False does not by itself explain why it was rejected.
approval type (keyholder / community / auto / bot)stringReview source, such as keyholder, community, auto, or bot, when supplied.
rejection reasonstringReason supplied for rejection; empty when no rejection reason is supplied.
calendar event idstringID of the linked calendar entry. For task review, empty when the task is not linked to a calendar entry.
calendar occurrence datestringDate identifying this calendar occurrence, including one occurrence of a recurring entry. Empty for tasks without a calendar link.
when task photo verification approved

After task-photo approval, including calendar tasks and before/after photos. Approval can precede the task's minimum duration.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
task submission timestamp (Unix seconds)integerOriginal task-photo submission time in Unix seconds, or the recorded completion or failure time for the task’s outcome when no photo submission exists; 0 if no relevant timestamp is available. Photo submissions keep their original time even when reviewed later.
task run idstringID of this particular task assignment. Save it to match later completion or review events.
task idstringID of the task definition. Reassigning the same task can produce a different task run ID.
task statusstringStatus reported for this assignment or quiz result.
task pointsnumberTask points supplied with this event; this is not the lock’s total task-point balance.
task titlestringTitle or task text supplied with the assignment.
task descriptionstringAdditional task instructions; empty when none are supplied.
photo verification approved?booleanWhether the task-photo review was approved. False does not by itself explain why it was rejected.
approval type (keyholder / community / auto / bot)stringReview source, such as keyholder, community, auto, or bot, when supplied.
rejection reasonstringReason supplied for rejection; empty when no rejection reason is supplied.
calendar event idstringID of the linked calendar entry. For task review, empty when the task is not linked to a calendar entry.
calendar occurrence datestringDate identifying this calendar occurrence, including one occurrence of a recurring entry. Empty for tasks without a calendar link.
when task photo verification rejected

After task-photo rejection. Read rejection reason and task details.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
task submission timestamp (Unix seconds)integerOriginal task-photo submission time in Unix seconds, or the recorded completion or failure time for the task’s outcome when no photo submission exists; 0 if no relevant timestamp is available. Photo submissions keep their original time even when reviewed later.
task run idstringID of this particular task assignment. Save it to match later completion or review events.
task idstringID of the task definition. Reassigning the same task can produce a different task run ID.
task statusstringStatus reported for this assignment or quiz result.
task pointsnumberTask points supplied with this event; this is not the lock’s total task-point balance.
task titlestringTitle or task text supplied with the assignment.
task descriptionstringAdditional task instructions; empty when none are supplied.
photo verification approved?booleanWhether the task-photo review was approved. False does not by itself explain why it was rejected.
approval type (keyholder / community / auto / bot)stringReview source, such as keyholder, community, auto, or bot, when supplied.
rejection reasonstringReason supplied for rejection; empty when no rejection reason is supplied.
calendar event idstringID of the linked calendar entry. For task review, empty when the task is not linked to a calendar entry.
calendar occurrence datestringDate identifying this calendar occurrence, including one occurrence of a recurring entry. Empty for tasks without a calendar link.
when task completed

When the task completes. Use this for completion-only rewards.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
task submission timestamp (Unix seconds)integerOriginal task-photo submission time in Unix seconds, or the recorded completion or failure time for the task’s outcome when no photo submission exists; 0 if no relevant timestamp is available. Photo submissions keep their original time even when reviewed later.
task run idstringID of this particular task assignment. Save it to match later completion or review events.
task idstringID of the task definition. Reassigning the same task can produce a different task run ID.
task statusstringStatus reported for this assignment or quiz result.
task pointsnumberTask points supplied with this event; this is not the lock’s total task-point balance.
task titlestringTitle or task text supplied with the assignment.
task descriptionstringAdditional task instructions; empty when none are supplied.
when task failed

When the task fails. Filter by task run ID if tracking a particular assignment.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
task submission timestamp (Unix seconds)integerOriginal task-photo submission time in Unix seconds, or the recorded completion or failure time for the task’s outcome when no photo submission exists; 0 if no relevant timestamp is available. Photo submissions keep their original time even when reviewed later.
task run idstringID of this particular task assignment. Save it to match later completion or review events.
task idstringID of the task definition. Reassigning the same task can produce a different task run ID.
task statusstringStatus reported for this assignment or quiz result.
task pointsnumberTask points supplied with this event; this is not the lock’s total task-point balance.
task titlestringTitle or task text supplied with the assignment.
task descriptionstringAdditional task instructions; empty when none are supplied.
when verification picture submitted

When a verification picture is submitted. Submission alone is not approval.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
verification codestringVerification code supplied with the submission.
when daily photo verification approved

After keyholder, community, or automatic daily-photo approval. Excludes post-hygiene photos.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
verification idstringID of the daily-photo verification being reviewed.
verification datestringDate associated with the daily verification, as date text.
verification codestringVerification code supplied with the submission.
photo verification approved?booleanWhether the daily-photo verification was approved.
approval type (keyholder / community / auto)stringReview source, such as keyholder, community, or auto, when supplied.
rejection reasonstringReason supplied for rejection; empty when no rejection reason is supplied.
when daily photo verification rejected

After keyholder or community rejection of a submitted daily photo. Missing photos and post-hygiene photos do not run this event.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
verification idstringID of the daily-photo verification being reviewed.
verification datestringDate associated with the daily verification, as date text.
verification codestringVerification code supplied with the submission.
photo verification approved?booleanWhether the daily-photo verification was approved.
approval type (keyholder / community / auto)stringReview source, such as keyholder, community, or auto, when supplied.
rejection reasonstringReason supplied for rejection; empty when no rejection reason is supplied.
when cage check submitted

When the wearer submits a cage check.

Event variables

Uses the common event variables. No additional event-specific fields.

A task's task id identifies its definition; task run id identifies one assignment. Do not reward the same work in both photo-approved and task-completed stacks unless you intend two rewards. Use task submission timestamp (Unix seconds) when dating a calendar record to the submission.

Hygiene​

when hygienic break granted

Permission is granted. The break itself has not started.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
allowed opening time (seconds)integerAllowed opening duration for the hygienic break, in seconds.
penalty time (seconds)integerPenalty duration reported for the break, in seconds; use actual delta to inspect the applied change.
when hygienic break grant revoked

An unused grant is revoked. Accepting it or letting it expire does not run this event.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
allowed opening time (seconds)integerAllowed opening duration for the hygienic break, in seconds.
penalty time (seconds)integerPenalty duration reported for the break, in seconds; use actual delta to inspect the applied change.
when hygiene started

The hygienic opening starts.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
allowed opening time (seconds)integerAllowed opening duration for the hygienic break, in seconds.
penalty time (seconds)integerPenalty duration reported for the break, in seconds; use actual delta to inspect the applied change.
when hygiene resumed

The lock resumes after the opening.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
allowed opening time (seconds)integerAllowed opening duration for the hygienic break, in seconds.
unused opening time (seconds)integerUnused part of the allowed opening window, in seconds.
unlocked time (seconds)integerTime spent unlocked during the break, in seconds.
penalty time (seconds)integerPenalty duration reported for the break, in seconds; use actual delta to inspect the applied change.
actual delta (seconds)integerActual lock-time adjustment from the hygiene event, in seconds.
when hygiene resumed late

A late return is reported. Use the event's late minutes and actual delta to understand the result.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
allowed opening time (seconds)integerAllowed opening duration for the hygienic break, in seconds.
unused opening time (seconds)integerUnused part of the allowed opening window, in seconds.
unlocked time (seconds)integerTime spent unlocked during the break, in seconds.
penalty time (seconds)integerPenalty duration reported for the break, in seconds; use actual delta to inspect the applied change.
late minutesnumberHow late the wearer returned, measured in minutes rather than seconds.
actual delta (seconds)integerActual lock-time adjustment from the hygiene event, in seconds.

Games, coach, and devices​

when wheel result

A normal Wheel of Fortune result arrives. This is separate from the PLE on spin wheel control.

Event variables

Only the following values are available in this event’s dropdown.

Event variableTypeDescription
wheel option namestringLabel of the selected Wheel of Fortune option.
wheel result typestringType of outcome reported by the wheel.
wheel result messagestringDescription or message supplied with the wheel result.
lock time changed (seconds)integerApplied lock-time adjustment from the wheel result, in seconds.
wheel option idstringID of the selected wheel option.
when wheel text action

A wheel text-action event arrives. Use event text → wheel action text → equals to match an exact option label. The toolbox also includes a preconnected example of this filter.

Event variables

Only the following values are available in this event’s dropdown.

Event variableTypeDescription
action textstringText of the selected wheel text action. Use it to match a particular option.
when dice rolled

Saved dice results arrive. Read individual dice or player/bot lists.

Event variables

Only the following values are available in this event’s dropdown.

Event variableTypeDescription
number of diceintegerTotal number of dice in the roll.
dice typesstringText describing the dice types used in this roll.
player dice values (comma-separated)stringPlayer roll values as comma-separated text. Use rolled dice for a Number list instead.
bot dice values (comma-separated)stringBot roll values as comma-separated text. Use rolled dice for a Number list instead.
number of d4 diceintegerNumber of d4 dice used in this roll.
number of d6 diceintegerNumber of d6 dice used in this roll.
number of d8 diceintegerNumber of d8 dice used in this roll.
number of d10 diceintegerNumber of d10 dice used in this roll.
number of d12 diceintegerNumber of d12 dice used in this roll.
number of d20 diceintegerNumber of d20 dice used in this roll.
bot dice resultnumberBot’s total dice score reported for this roll.
player dice resultnumberPlayer’s total dice score reported for this roll.
lock time changed (seconds)integerApplied lock-time adjustment from the dice result, in seconds.
when Coach enabled

AI Coach or Bot Coach becomes enabled for the lock.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
Coach typestringIdentifies the coach whose enabled state changed.
Coach namestringDisplay name of that coach.
Coach enabled?booleanEnabled state reported after the coach change.
when Coach disabled

AI Coach or Bot Coach becomes disabled for the lock.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
Coach typestringIdentifies the coach whose enabled state changed.
Coach namestringDisplay name of that coach.
Coach enabled?booleanEnabled state reported after the coach change.
when AI changes a variable

An AI Keyholder or Bot Coach changes an exposed variable. Ordinary set variable steps are not this trigger.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
variable namestringName of the workspace variable that the coach changed.
previous valuevariesValue before the coach’s change. Keeps the original value type, such as number, string, Boolean, or Number list; may be null when absent.
new valuevariesValue after the coach’s change. Keeps the changed variable’s value type; it is not always text.
changed by AI?booleanWhether the change was reported as coming from a coach.
change sourcestringSource reported for the variable change; use it to distinguish which coach or integration made the change.
when device shocked

A shock command is successfully sent through the device path. This is not independent proof of physical delivery.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
shock success?booleanWhether the device command was reported as successfully sent. This is not independent confirmation of physical delivery.
shock strength (%)integerReported shock intensity as a percentage.
shock duration (seconds)integerReported shock duration in seconds.

Quiz result triggers are in the Quiz category.

Geofence​

when entering geofence

Entry into any area, a zone, a corridor, or a selected area. Choose the area filter on the block.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
area idstringID of the area involved in this entry or exit.
area namestringDisplay name of the area involved in this entry or exit.
area typestringArea type reported by the event, such as a zone or corridor.
geofence event timestampintegerTime of the geofence event in Unix milliseconds. Divide by 1000 for seconds-based date/time inputs.
currently allowed?booleanWhether the reported location is in an allowed geofence area.
when exiting geofence

Exit from the selected kind of area or specific area.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
area idstringID of the area involved in this entry or exit.
area namestringDisplay name of the area involved in this entry or exit.
area typestringArea type reported by the event, such as a zone or corridor.
geofence event timestampintegerTime of the geofence event in Unix milliseconds. Divide by 1000 for seconds-based date/time inputs.
currently allowed?booleanWhether the reported location is in an allowed geofence area.
when leaving all allowed geofence areas

A transition from an allowed area into a disallowed area.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
geofence event timestampintegerTime of the geofence event in Unix milliseconds. Divide by 1000 for seconds-based date/time inputs.
currently allowed?booleanWhether the reported location is in an allowed geofence area.
when returning to an allowed geofence area

A transition from a disallowed area back into an allowed area.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
geofence event timestampintegerTime of the geofence event in Unix milliseconds. Divide by 1000 for seconds-based date/time inputs.
currently allowed?booleanWhether the reported location is in an allowed geofence area.
when geofence penalty becomes active

The first penalty is applied after the grace period, using a server-validated location report. Repeated reports and shock cooldowns do not repeat it.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
geofence event timestampintegerTime of the geofence event in Unix milliseconds. Divide by 1000 for seconds-based date/time inputs.
when geofence penalty becomes inactive

An active penalty episode clears, such as on safe return, suspension, inactive schedule, or disabled geofencing. Returning during the grace period does not run it; added lock time is not undone.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
geofence event timestampintegerTime of the geofence event in Unix milliseconds. Divide by 1000 for seconds-based date/time inputs.

Device Control and Hardcore Mode​

when parental control self-lock timer expires

A timer-based self-control lock reaches zero.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
previous remaining (seconds)integerRemaining time at the previous timer check, in seconds.
current remaining (seconds)integerRemaining time at this timer or screen-time check, in seconds.
expiry timestampintegerTimer expiry as a Unix timestamp in milliseconds. Divide by 1000 for seconds-based date/time inputs.
self-lock modestringMode of the parental-control self-lock reported with the timer event.
when parental control self-lock remaining falls below

Remaining time crosses from above to at-or-below the connected duration.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
configured threshold (seconds)integerThreshold used for this crossing check, in seconds.
previous remaining (seconds)integerRemaining time at the previous timer check, in seconds.
current remaining (seconds)integerRemaining time at this timer or screen-time check, in seconds.
self-lock modestringMode of the parental-control self-lock reported with the timer event.
when screen-time allowance expires

Remaining daily screen-time allowance reaches zero.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
daily allowance (seconds)integerDaily screen-time allowance reported at the check, in seconds.
used screen time (seconds)integerScreen time already used, in seconds.
extra time (seconds)integerAdditional screen time granted for the day, in seconds.
remaining screen time (seconds)integerRemaining time at this timer or screen-time check, in seconds.
when screen-time remaining falls below

Remaining allowance crosses from above to at-or-below the connected duration.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
configured threshold (seconds)integerThreshold used for this crossing check, in seconds.
previous remaining (seconds)integerRemaining time at the previous timer check, in seconds.
current remaining (seconds)integerRemaining time at this timer or screen-time check, in seconds.
daily allowance (seconds)integerDaily screen-time allowance reported at the check, in seconds.
used screen time (seconds)integerScreen time already used, in seconds.
extra time (seconds)integerAdditional screen time granted for the day, in seconds.
when parental controls block an app

A registered device reports an app block. Read app, package, reason, rule source, and device ID.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
app namestringDisplay name of the blocked app.
package namestringPackage identifier of the blocked app; use this for a more specific match than its display name.
block reasonstringReason the device reported for blocking the app or website.
rule sourcestringSource of the restriction that caused the block.
parental-control device idstringID of the registered parental-control device that reported the block.
when parental controls block a website

A registered device reports a website block. The exposed website value is a normalized domain.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
website domainstringNormalized blocked domain. This is not the full URL, path, or page content.
block reasonstringReason the device reported for blocking the app or website.
rule sourcestringSource of the restriction that caused the block.
parental-control device idstringID of the registered parental-control device that reported the block.
when Hardcore Mode timer expires

Timer-based Bot Coach Hardcore Mode reaches zero.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
previous remaining (seconds)integerRemaining time at the previous timer check, in seconds.
current remaining (seconds)integerRemaining time at this timer or screen-time check, in seconds.
expiry timestampintegerTimer expiry as a Unix timestamp in milliseconds. Divide by 1000 for seconds-based date/time inputs.
when Hardcore Mode remaining falls below

Remaining Hardcore Mode time crosses from above to at-or-below the connected duration.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
configured threshold (seconds)integerThreshold used for this crossing check, in seconds.
previous remaining (seconds)integerRemaining time at the previous timer check, in seconds.
current remaining (seconds)integerRemaining time at this timer or screen-time check, in seconds.

Threshold events react to a crossing, not continuously while the value remains below the threshold.

Calendar events​

when a calendar event starts

An occurrence starts, including recurring and all-day entries.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
calendar event titlestringTitle of the calendar entry at the time of the event.
calendar event typestringName of the calendar entry’s category/type.
calendar event notesstringNotes or instructions saved on the calendar entry.
calendar event idstringID of the linked calendar entry. For task review, empty when the task is not linked to a calendar entry.
occurrence datestringDate identifying this calendar occurrence, including one occurrence of a recurring entry. Empty for tasks without a calendar link.
start date and timestringStart date/time as text. Use start timestamp when a numeric date input is required.
start timestampintegerStart of this calendar occurrence in Unix seconds; suitable for seconds-based date/time inputs.
end date and timestringEnd date/time as text. Use end timestamp when a numeric date input is required.
end timestampintegerEnd of this calendar occurrence in Unix seconds; suitable for seconds-based date/time inputs.
duration (seconds)integerDuration of this calendar occurrence, in seconds.
all-day event?booleanWhether this is an all-day calendar occurrence.
when a calendar event ends

An occurrence reaches its end time, using updated end times after edits. Deleting an entry does not trigger it.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
calendar event titlestringTitle of the calendar entry at the time of the event.
calendar event typestringName of the calendar entry’s category/type.
calendar event notesstringNotes or instructions saved on the calendar entry.
calendar event idstringID of the linked calendar entry. For task review, empty when the task is not linked to a calendar entry.
occurrence datestringDate identifying this calendar occurrence, including one occurrence of a recurring entry. Empty for tasks without a calendar link.
start date and timestringStart date/time as text. Use start timestamp when a numeric date input is required.
start timestampintegerStart of this calendar occurrence in Unix seconds; suitable for seconds-based date/time inputs.
end date and timestringEnd date/time as text. Use end timestamp when a numeric date input is required.
end timestampintegerEnd of this calendar occurrence in Unix seconds; suitable for seconds-based date/time inputs.
duration (seconds)integerDuration of this calendar occurrence, in seconds.
all-day event?booleanWhether this is an all-day calendar occurrence.
when a calendar event changes

Title, notes, dates, times, timezone, recurrence, category, or color changes. Reminder and completion-progress changes do not trigger it.

Event variables

The following values plus the common event variables.

Event variableTypeDescription
calendar event titlestringTitle of the calendar entry at the time of the event.
calendar event typestringName of the calendar entry’s category/type.
calendar event notesstringNotes or instructions saved on the calendar entry.
calendar event idstringID of the linked calendar entry. For task review, empty when the task is not linked to a calendar entry.
occurrence datestringDate identifying this calendar occurrence, including one occurrence of a recurring entry. Empty for tasks without a calendar link.
start date and timestringStart date/time as text. Use start timestamp when a numeric date input is required.
start timestampintegerStart of this calendar occurrence in Unix seconds; suitable for seconds-based date/time inputs.
end date and timestringEnd date/time as text. Use end timestamp when a numeric date input is required.
end timestampintegerEnd of this calendar occurrence in Unix seconds; suitable for seconds-based date/time inputs.
duration (seconds)integerDuration of this calendar occurrence, in seconds.
all-day event?booleanWhether this is an all-day calendar occurrence.
changed fieldsstringText listing the fields changed by this edit. It is not a Blockly list.

Filter calendar events by their ID or title when a stack is intended for just one entry.

Example: count completed tasks​

Create an Integer variable completedTasks with starting value 0:

when task completed
set completedTasks to completedTasks + 1
print text in UI: create text with "Completed: " and completedTasks

For a persistent notification from an automatic event, use send notification; UI output is viewed through the program's interface. In draft testing, run this event twice and expect 1, then 2. Use Reset test state to restart the mock counter.