# 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. 1. Install dependencies: `python -m pip install -r requirements.txt` 2. Fill in the router login and the iPhone Wi-Fi MAC address under `arrival_detection` in `service.yaml`. 3. Test connectivity: `python service.py --once` 4. Run continuously: `python service.py` 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: ```bash 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: ```bash 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`.