Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
annndruha committed Apr 12, 2024
1 parent 508621b commit 40fd88f
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
# 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://<YOURDOMAIN>.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
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
Expand All @@ -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

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)

0 comments on commit 40fd88f

Please sign in to comment.