From 40fd88fb956cb6afbef7414c25f8c9c38dec5660 Mon Sep 17 00:00:00 2001 From: Andrey Marakulin Date: Fri, 12 Apr 2024 11:21:25 +0300 Subject: [PATCH] Update README.md --- README.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 24f06f9..9bcdf98 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -# Keenetic Wi-Fi Telegram Logger +# Keenetic Wi-Fi/LAN clients Telegram logger > Work only with Keenetic routers. -Simple python script which sends you a Telegram message when a device connected to Wi-Fi or disconnected. Also send message if host became unreachable. -Script use REST (over CLI) Keenetic-API. For test propose check your router web-interface at `https://yourdomain.keenetic.pro/a` +Simple python script which sends you a Telegram message when a device connects to Wi-Fi/LAN or disconnects. Also sends message if router becomes unreachable or comes back online. +Script use REST Keenetic-API. For test propose check your router web-interface at `https://.keenetic.pro/a` -Script ask router for list of clients every 5 seconds, but routers has delay for updated state, so real refresh rate for connect ~20 seconds for disconnect ~1-20 minutes. +Machine on which this script is running must be located outside the network that you plan to monitor. -## How to use (Linux) +The script ask router for list of clients every 5 seconds, but routers have a state update delay, so real refresh rate for device connect ~20 seconds for disconnect ~1-10 minutes. + +## How to use (Linux + docker) Clone repo and go to folder: ```shell @@ -15,12 +17,15 @@ git clone https://github.com/annndruha/keenetic_wifi_telegram_logger cd keenetic_wifi_telegram_logger ``` -Create in .env-file repository folder : +Create in .env-file in repository folder: ```shell touch .env ``` -Fill your values in .env-file (`nano .env` etc.): +Fill your values in .env-file (`nano .env` etc.) as in example: + +(TG_CHAT_ID - Telegram id of the user who will receive notifications) + ```text WIFI_NAME=🏠 Home Wi-Fi WIFI_HOST=https://yourdomain.keenetic.pro @@ -36,8 +41,13 @@ docker compose up -d ``` ## User notes +A Telegram message consists of the following notations: * Device connection mark as 🟢 symbol * Device disconnection mark as 🔴 symbol -* Unregistered devices also mark with symbol ⚠️ in Telegram message. +* Unregistered devices also mark with symbol ⚠️ * If router became unreachable marks with 🔥 symbol and send error description -* Device name selection order: user-defined-name, device-build-in-name, mac-address \ No newline at end of file + +Device name order to show in message (take first available name): +* user-defined-name (manually set via router web-interface) +* device-build-in-name (device-side specified name) +* mac-address (if no else name available) \ No newline at end of file