-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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.
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.
The xPL system requires the following:
The xPL services are grouped in the following categories:
-
lights and blinds control
- KNX home automation integration
- myStrom buttons integration
- Flic Button integration
- Shelly LED strips control
- specific services such as displaying time with a LED strip
-
audio/video devices control
- Multiroom audio snapcast controller
- Sony Bravia Screen
- Denon AV controller
-
utilities
- audio alerts
- notifications push to a smartphone
- scripts launcher
- dawn and dusk information
- device location
- RPi GPIO control
-
central services
- central clock sending ticks every minute
- central control command dispatcher
- home state status storage
- REST listener interface
- HTTP request sender
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 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
Check the status of the xPL services:
systemctl list-units --type=service | grep \ xpl-