Skip to main content
pai-service is the main process for PAI. It loads configuration, connects to the Paradox panel, and runs all enabled interfaces (MQTT, Pushbullet, Signal, GSM, Home Assistant notifications, IP interface).

Usage

pai-service [OPTIONS]

Options

-c, --config
string
default:"None"
Path to an alternative configuration file. Supports .conf / .py, .json, and .yaml formats.When not specified, PAI searches for a config file in these locations in order:
  1. Current working directory
  2. ~/.local/etc
  3. /etc/pai
  4. /usr/local/etc/pai
Filenames searched: pai.conf, pai.json, pai.yaml.You can also set the config path with the PAI_CONFIG_FILE environment variable.

Examples

pai-service

Startup sequence

1

Load configuration

PAI reads the configuration file (or searches default locations) and applies any PAI_* environment variable overrides on top.
2

Configure logging

Console and file logging are configured according to LOGGING_LEVEL_CONSOLE, LOGGING_LEVEL_FILE, and LOGGING_FILE.
3

Register encodings

Additional Paradox label encodings (e.g. paradox-en) are registered with Python’s codec system.
4

Connect to panel

PAI establishes a connection to the alarm panel using the configured CONNECTION_TYPE (Serial or IP).
5

Start interfaces

All enabled interfaces start and begin publishing state and event data.

Signals

SignalBehavior
SIGINT (Ctrl+C)Graceful shutdown — disconnects from the panel and stops all interfaces cleanly
SIGTERMGraceful shutdown — same behavior as SIGINT

Environment variables

Any configuration key can be overridden via an environment variable named PAI_<KEY>. For example:
PAI_MQTT_ENABLE=True PAI_MQTT_HOST=192.168.1.10 pai-service
Integer values are automatically converted. Other types follow the same validation rules as the config file.
Environment variable overrides are applied after the config file is read. They take precedence over file values.

Running as a system service

/etc/systemd/system/pai.service
[Unit]
Description=Paradox Alarm Interface
After=network.target

[Service]
ExecStart=pai-service -c /etc/pai/pai.conf
Restart=on-failure
User=pai

[Install]
WantedBy=multi-user.target
sudo systemctl enable pai
sudo systemctl start pai

Build docs developers (and LLMs) love