Rules¶
A rule is an extra condition that has to hold after a spot's or zone's trigger has fired, before the sound actually plays. Use rules to express "play this only if X has already happened" or "don't play this while Y is going on".
A trigger says where something can fire. A rule says whether it should.
When to use rules¶
- Sequential narration: "play spot B only after spot A has finished".
- Mutual exclusion: "play this only if no other ambient is currently active".
- Time-of-day or date constraints: "only play between 09:00 and 17:00", "only on Saturdays".
- Cool-down: "don't replay this spot if it played in the last 60 seconds".
If you find yourself fighting the rules editor, ask whether you really need a rule — sometimes the simpler answer is just to remove a trigger or use a zone for "scene" behaviour.
The rule editor¶
Open a spot or zone, then expand the Rules section. The panel shows:
- A list of rules, one per row.
- A logic toggle: AND (all rules must hold) or OR (any rule holds).
- An Add rule button.
A spot or zone with no rules plays whenever a trigger fires — that's the common case.
Rule types¶
Each rule has a type (what kind of thing it watches) and an event type (what state of that thing it cares about).
Spot rules¶
Reference another spot by key. Event types:
- SPOT_TRIGGERED — fires while the referenced spot has been triggered.
- SPOT_NOT_TRIGGERED — fires while the referenced spot has not been triggered.
- SPOT_FINISHED — fires once the referenced spot has finished playing.
- SPOT_NOT_FINISHED — fires while the referenced spot has not yet finished.
- SPOT_FINISHED_FOR_MS — fires once the referenced spot finished at least N milliseconds ago. Use the min ms since finished field.
Ambient rules¶
Reference an ambient zone by key. Event types:
- AMBIENT_TRIGGERED — fires while the referenced ambient zone is currently triggered.
- AMBIENT_NOT_TRIGGERED — fires while it is not.
- AMBIENT_TIME_SINCE_TRIGGERED — fires once at least N milliseconds have passed since the zone was triggered. Use the min ms since triggered field.
DateTime and Time rules¶
Use these to restrict playback to particular dates or times of day.
AND vs OR¶
When a spot has multiple rules, the logic toggle decides how they combine:
- AND — every rule must be satisfied. Use for narrowing: "after A finished AND it's daytime".
- OR — any one rule being satisfied is enough. Use for branching: "after A finished OR after B finished".
For more complex expressions you may need to model with multiple spots, each with its own simpler rule set.
Dangling rules¶
If a spot or zone that's referenced by a rule is later deleted, the rule becomes dangling — it's still in the rule list but its target is gone. Dangling rules show with a red border in the editor and a red error icon next to the spot/zone name in the list.
The admin does not auto-delete dangling rules. They stay so you can see exactly where the broken reference is and decide what to do — re-target the rule to a different spot/zone, or remove the rule entirely.
When you delete a spot or zone that's referenced elsewhere, the admin warns you up-front and lists the dependents.
Tips¶
- Use SPOT_FINISHED_FOR_MS sparingly — small ms values can produce racy behaviour on slow devices.
- Don't rely on AMBIENT_TRIGGERED for "is the listener inside this zone right now?" — beacon detection is noisy. Prefer GPS or a longer min ms since triggered debounce.
- Test on real hardware. The simulation in the admin can't fully reproduce field behaviour.