Skip to main content
PAI reads its configuration from a file at startup. You can use Python (.conf), JSON, or YAML syntax. Settings can also be overridden at runtime using environment variables.

Config file formats

PAI supports three file formats.
FormatExtensionsNotes
Python.conf, .pyEvaluated with exec(). Supports expressions like 15 * 60.
JSON.jsonStandard JSON. No comments or expressions.
YAML.yamlRequires the YAML extra (pip install "paradox-alarm-interface[YAML]").

Config file search order

When no explicit path is given, PAI searches for a config file in these locations, in order:
1

Current working directory

./pai.conf, ./pai.json, ./pai.yaml
2

User local config

~/.local/etc/pai.conf, ~/.local/etc/pai.json, ~/.local/etc/pai.yaml
3

System config

/etc/pai/pai.conf, /etc/pai/pai.json, /etc/pai/pai.yaml
4

Local system config

/usr/local/etc/pai/pai.conf, /usr/local/etc/pai/pai.json, /usr/local/etc/pai/pai.yaml
The first matching file found is used. If no file is found, PAI exits with an error.
Set the PAI_CONFIG_FILE environment variable to point PAI directly to a config file at any path, bypassing the search order entirely.
PAI_CONFIG_FILE=/opt/myconfig/pai.conf pai

Environment variable overrides

Any configuration key can be overridden by an environment variable prefixed with PAI_. PAI strips the prefix and matches the remainder against known config keys.
# Equivalent to setting MQTT_ENABLE = True in the config file
export PAI_MQTT_ENABLE=true

# Equivalent to setting KEEP_ALIVE_INTERVAL = 30
export PAI_KEEP_ALIVE_INTERVAL=30
Environment variables are applied after the config file is read, so they take precedence over file-based settings.

Config file examples

# /etc/pai/pai.conf
import logging

# Connection
CONNECTION_TYPE = 'Serial'
SERIAL_PORT = '/dev/ttyS1'
SERIAL_BAUD = 9600

# Logging
LOGGING_LEVEL_CONSOLE = logging.INFO
LOGGING_LEVEL_FILE = logging.ERROR
LOGGING_FILE = '/var/log/paradox.log'

# Panel
PASSWORD = '0000'
KEEP_ALIVE_INTERVAL = 10
SYNC_TIME = False

# MQTT
MQTT_ENABLE = True
MQTT_HOST = '127.0.0.1'
MQTT_PORT = 1883
YAML support requires an optional dependency. Install it with pip install "paradox-alarm-interface[YAML]" before using a .yaml config file.
In JSON and YAML files, logging levels must be specified as integers. The Python logging module values are: DEBUG=10, INFO=20, WARNING=30, ERROR=40, CRITICAL=50.

Next steps

General settings

Connection, logging, panel behavior, and timing options.

Resource limits

Restrict which zones, partitions, outputs, and users PAI monitors.

Build docs developers (and LLMs) love