Skip to content
Francois Corthay edited this page Jun 2, 2025 · 28 revisions

xPL is an open protocol intended to permit the control and monitoring of home automation devices.

The documentation and the scripts found here have been tested on Linux. They can function on little machines such as the Raspberry Pi (RPi). As the scripts are coded in Perl and Python, they also should work on macOS and Windows.

Table of Contents

Services

The xPL system does not have to be centralized. It can run on separate machines in a same network. The different tasks can be distributed over several devices who each accomplish their own set of tasks at their specific location. Each of the devices need to have their own hub running.

Elder Perl service scripts are found on my previous xPL wiki.

Base system

The xPL system requires the following:

Categories

The xPL services are grouped in the following categories:

HTTP ports

Some services listen to specific HTTP ports:

  • home control web server, default port 8001, transforms HTTP requests into xPL messages
  • xpl-rest, default port 8002, transforms HTTP requests into xPL messages
  • xpl-location, default port 8003, transforms GPS location messages into xPL messages

Moving the services

Moving services requires to stop them on a given device and starting them on another.

Stop a service on a given device:

su
ll /lib/systemd/system/xpl-*
systemctl list-units --type=service --state=running | grep xpl
SERVICE='xpl-central'
DIRECTORY='central'

SERVICE_DEFINITION="/lib/systemd/system/$SERVICE"
reset
echo -e "\n$SERVICE_DEFINITION.service\n"
echo ; cat $SERVICE_DEFINITION.service ; echo
systemctl stop $SERVICE
systemctl disable $SERVICE

SERVICE_SCRIPT="/home/control/Controls/xPL/$DIRECTORY/$SERVICE.pl"
reset
echo -e "\n$SERVICE_SCRIPT\n"
echo ; cat $SERVICE_SCRIPT ; echo

reboot

Start it on the other machine:

su
SERVICE='xpl-central'
DIRECTORY='central'

nano /lib/systemd/system/$SERVICE.service

SERVICE_SCRIPT="/home/control/Controls/xPL/$DIRECTORY/$SERVICE.pl"
nano $SERVICE_SCRIPT

ls -l $SERVICE_SCRIPT
chmod 775 $SERVICE_SCRIPT
chown control:users $SERVICE_SCRIPT
systemctl enable $SERVICE
systemctl start $SERVICE
systemctl status $SERVICE

Checking the services

Check the status of the xPL services:

systemctl list-units --type=service | grep \ xpl-

Clone this wiki locally