2.0 KiB
home_control
Detects an arrival when an iPhone reconnects to a Zyxel EX5601-T1. The service logs into the router's encrypted web API and polls its active LAN clients.
- Install dependencies:
python -m pip install -r requirements.txt - Fill in the router login and the iPhone Wi-Fi MAC address under
arrival_detectioninservice.yaml. - Test connectivity:
python service.py --once - Run continuously:
python service.py
Check any MAC address directly through the Zyxel client with:
python lib/_zyxel.py --mac AA:BB:CC:DD:EE:FF
Omit --mac to check arrival_detection.device.mac from service.yaml.
An arrival is logged after the phone was confirmed absent and then present. It
also calls send_notification() from notify.py; its message, ntfy topic, and
timeout are configured under arrival_detection.notification. Set
arrival_detection.enabled to false to disable this function.
On the iPhone, open Settings > Wi-Fi, tap the info button beside the home network, and copy Wi-Fi Address. If Private Wi-Fi Address is enabled, that per-network address is the correct one to configure.
Install as a systemd service
The included unit expects the project and its virtual environment at
/opt/home_control, owned by a dedicated home-control system user:
sudo useradd --system --home-dir /opt/home_control --shell /usr/sbin/nologin home-control
sudo chown -R home-control:home-control /opt/home_control
sudo chmod 600 /opt/home_control/service.yaml
sudo install -d -o home-control -g home-control -m 750 /log
sudo cp /opt/home_control/home-control.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now home-control.service
Check its state and follow its logs with:
sudo systemctl status home-control.service
sudo journalctl -u home-control.service -f
Confirmed arrival notifications are also appended to
/log/detect-arrivals.txt. The path is configurable as
arrival_detection.notification.event_log.