Custom Rules

Rule structure, conditions, and operators.

Rule Structure

{
  "name": "Rule name shown in alerts",
  "enabled": true,
  "priority": "high",
  "conditions": {
    "operator": "AND",
    "conditions": [
      { "field": "...", "operator": "...", "value": "..." }
    ]
  },
  "notification_enabled": true
}
FieldTypeDescription
namestringπŸ“ Display name for the rule
enabledbooleanβœ… Whether the rule is active
prioritystring🎯 low, medium, high, or critical
conditionsobjectβš™οΈ Condition tree (see below)
notification_enabledbooleanπŸ“± Send push notifications when triggered

Condition Fields

FieldTypeDescriptionExample
icaostringπŸ”’ 24-bit ICAO hex addressA12345
callsignstring🏷️ Flight number or callsignUAL123
squawkstringπŸ“» Transponder code7700
altitudenumberπŸ“ Barometric altitude (feet)35000
distancenumberπŸ“ Distance from receiver (NM)10
typestring✈️ ICAO aircraft type codeB738
militarybooleanπŸŽ–οΈ Military aircraft flagtrue
categorystringπŸ“¦ Aircraft size categoryA3

Operators

OperatorMeaningWorks With
eqβœ… EqualsAll types
ne❌ Not equalsAll types
lt⬇️ Less thanNumbers
gt⬆️ Greater thanNumbers
le⬇️ Less than or equalNumbers
ge⬆️ Greater than or equalNumbers
containsπŸ” Contains substringStrings
startswith🏁 Starts withStrings

Combining Conditions

Use AND and OR operators to build complex rules. You can nest condition groups.

Alert when a military aircraft is below 10,000ft within 25nm:

{
  "operator": "AND",
  "conditions": [
    { "field": "military", "operator": "eq", "value": true },
    { "field": "altitude", "operator": "lt", "value": 10000 },
    { "field": "distance", "operator": "lt", "value": 25 }
  ]
}
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#1e3a5f', 'primaryTextColor': '#fff', 'primaryBorderColor': '#3b82f6', 'lineColor': '#60a5fa'}}}%%
flowchart LR
    M["πŸŽ–οΈ Military = true"] --> AND{"βœ… AND"}
    A["πŸ“ Altitude < 10000"] --> AND
    D["πŸ“ Distance < 25"] --> AND
    AND --> ALERT["πŸ”” Alert!"]

    style AND fill:#7c4a03,stroke:#f59e0b,stroke-width:2px,color:#fff
    style ALERT fill:#065f46,stroke:#10b981,stroke-width:2px,color:#fff

Creating Rules