trigger sun, triggersun, kPMTriggerTriggerSun — Trigger at a given angle of the Sun.


trigger sun structure { type, at, geolocation, offset, availability, scatter, quiet, drift };
type : string, choice
at : string, choice, default
geolocation : geolocation structure
offset : integer, default, optional, range -86400..86400
availability : string, choice, optional
scatter : integer, default, optional, range 60..43200
quiet : boolean, default, optional
drift : integer, default, optional, range 1..86400


Trigger at a given angle of the Sun.

sun trigger will trigger when the Sun reaches a specific angle on the days provided.


type. Type of trigger being described.

type is a string. type must be sun, kPMTriggerType_Sun.

at. Astronomical Sun event to calculate.

at is a string. If at is omitted, the default sunrise is used. at must be one of the following ten constants:

  • night end, kPMTriggerAt_NightEnd.
  • nautical dawn, kPMTriggerAt_NauticalDawn.
  • dawn, kPMTriggerAt_Dawn.
  • sunrise, kPMTriggerAt_Sunrise.
  • sunrise limit, kPMTriggerAt_SunriseLimit.
  • sunset limit, kPMTriggerAt_SunsetLimit.
  • sunset, kPMTriggerAt_Sunset.
  • dusk, kPMTriggerAt_Dusk.
  • nautical dusk, kPMTriggerAt_NauticalDusk.
  • night begin, kPMTriggerAt_NightBegin.

geolocation. Location to calculate Sun position from.

geolocation is a geolocation structure.

offset. Offset from the calculated astronomical event.

Useful for creating triggers to occur some time before an astronomical event.

offset is an integer. If offset is omitted, the default -1800 is used. offset is optional. offset must be between -86400 and 86400, inclusive.

availability. Should the host be made available for this trigger.

availability is a string. availability is optional. availability must be one of the following three constants:

  • wake up, kPMTriggerAvailability_WakeUp.
  • power on, kPMTriggerAvailability_PowerOn.
  • power on or wake up, kPMTriggerAvailability_PowerOnOrWakeUp.

scatter. Scatter the date.

scatter is an integer. If scatter is omitted, the default 300 is used. scatter is optional. scatter must be between 60 and 43200, inclusive.

quiet. Minimise the notifications.

quiet is a boolean. If quiet is omitted, the default false is used. quiet is optional.

drift. Acceptable drift.

drift is an integer. If drift is omitted, the default 120 is used. drift is optional. drift must be between 1 and 86400, inclusive.