Create a Trigger
Goal: run a macro automatically when something happens — a door opens, a temperature crosses a threshold, motion is detected.
A trigger (attribute trigger) watches an attribute and runs an action when its value changes and a condition is met. Triggers are GEM's event-driven automation, as opposed to schedules (time-based) and macros (manually run).
Before you start
- You're logged in as an administrator.
- The macro you want the trigger to run already exists (see Build a Macro), or you'll create it as part of this flow.
- You know which attribute carries the event — e.g. a door zone's open/closed state, a sensor's motion attribute, a thermostat's temperature.
Steps
-
Open Triggers and click Add.
Open Triggers
-
Basic Settings
- Trigger Name —
lowercase_with_underscores(e.g.door_alert,temp_warning). - Debounce (minutes) — minimum time between activations. Set this for noisy sources (a motion sensor that fires every second) so the action runs at most once per interval. Default is
0. - Status — enable the trigger.
- Trigger Name —
-
Trigger Condition — choose the attribute to watch and the comparison that should fire it (equals, greater than, changed, etc.) against a value. This is the event.
-
Additional Condition (optional gate) — an extra condition that must also be true for the action to run. Use it to scope a trigger — e.g. only when the site is in "Away" mode, or only when another zone is off.
-
Action to Execute — select the macro to run when the trigger fires.
-
Schedule Configuration — optionally limit the trigger to specific days and hours (e.g. motion lighting only after sunset). Outside that window the trigger won't act.
-
Click Create Trigger.
Verify it
Cause the event (open the door, trip the sensor, change the value) and confirm the macro runs. If it fires too often, raise the debounce; if it fires when it shouldn't, tighten the additional condition or the active hours.
Related
- Wire a Motion-Activated Light — a full walkthrough combining a trigger and macros.
- Schedule a Macro — the time-based counterpart.
- Triggers in the Admin Reference — every field, including the day/hour masks.