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
Options
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:- Current working directory
~/.local/etc/etc/pai/usr/local/etc/pai
pai.conf, pai.json, pai.yaml.You can also set the config path with the PAI_CONFIG_FILE environment variable.Examples
Startup sequence
Load configuration
PAI reads the configuration file (or searches default locations) and applies any
PAI_* environment variable overrides on top.Configure logging
Console and file logging are configured according to
LOGGING_LEVEL_CONSOLE, LOGGING_LEVEL_FILE, and LOGGING_FILE.Register encodings
Additional Paradox label encodings (e.g.
paradox-en) are registered with Python’s codec system.Connect to panel
PAI establishes a connection to the alarm panel using the configured
CONNECTION_TYPE (Serial or IP).Signals
| Signal | Behavior |
|---|---|
SIGINT (Ctrl+C) | Graceful shutdown — disconnects from the panel and stops all interfaces cleanly |
SIGTERM | Graceful shutdown — same behavior as SIGINT |
Environment variables
Any configuration key can be overridden via an environment variable namedPAI_<KEY>. For example:
Running as a system service
/etc/systemd/system/pai.service