Skip to main content
By default PAI monitors all resources on the panel. The LIMITS configuration option lets you restrict monitoring to specific subsets, which is useful for improving performance, reducing noise, and limiting exposure of resources you do not need to manage.

Why use limits

  • Performance: Fetching labels and status for every resource takes time at startup and during refreshes. Restricting to only the resources in use reduces this overhead significantly.
  • Reduce noise: Unused zones or keypads often generate spurious events. Excluding them keeps your event stream and MQTT topics clean.
  • Privacy: Limiting users or partitions prevents information about unused parts of the system from being published to interfaces like MQTT.

The LIMITS option

LIMITS is a dictionary where each key is a resource type and each value specifies which IDs to include. An empty dictionary (the default) means no restrictions — all resources are monitored.

Supported resource types

KeyDescription
zoneZones to monitor and control
userUsers to consider
doorDoors to consider
pgmPGM outputs to monitor and control
partitionPartitions to monitor and control
moduleBus modules to monitor
repeaterRepeaters to monitor
keypadKeypads to monitor

Value types

Each resource type accepts one of these value types:
  • range — A Python range, e.g. range(1, 17) covers IDs 1 through 16.
  • list — An explicit list of IDs, e.g. [1, 2, 3, 4].
  • 'auto' — PAI detects which resources are actually present on the panel and monitors only those.
When a resource type is omitted from LIMITS, all IDs for that type are monitored. You only need to specify the types you want to restrict.

Configuration examples

LIMITS = {
    'zone': range(1, 17),
    'user': [1, 2, 3, 4],
    'door': range(1, 32),
    'pgm': range(1, 17),
    'partition': [1, 2],
    'module': range(1, 17),
    'repeater': range(1, 9),
    'keypad': range(1, 9)
}
JSON and YAML do not support Python range() expressions. You must enumerate all IDs as a list. For large ranges, the Python .conf format is more concise.

Using auto detection

Setting a resource type’s value to 'auto' instructs PAI to query the panel at startup and monitor only the resources it finds are actually enrolled.
pai.conf
LIMITS = {
    'zone': 'auto',
    'partition': 'auto',
    'pgm': 'auto',
}
The 'auto' value is only supported in the Python .conf format. JSON and YAML configs must use explicit lists. In code, 'auto' causes PAI to fall back to the caller-supplied default list, meaning the behavior depends on the context in which the resource is resolved.

Disabling limits

To monitor all resources with no restrictions, set LIMITS to an empty dictionary or omit it entirely.
pai.conf
# Monitor everything (default behavior)
LIMITS = {}

Build docs developers (and LLMs) love