| Crates.io | houserat |
| lib.rs | houserat |
| version | 0.4.0 |
| created_at | 2019-08-22 20:56:01.662881+00 |
| updated_at | 2019-09-11 21:07:46.727301+00 |
| description | Notifies when known devices connect to the network |
| homepage | |
| repository | https://github.com/drrlvn/houserat/ |
| max_upload_size | |
| id | 158965 |
| size | 167,673 |
A daemon that monitors network traffic for DHCP and ARP packets from known devices and sends a notification using Telegram when these devices connect or disconnect.
yay -S houseratcargo install houserat (note that you'll have to manually install the service and
config files)/etc/houserat/config.toml with bot token, device and user information
(example).systemctl enable --now houserat.Once you have your bot token you'll need to get chat IDs for every user that subscribes to notifications. The easiest way to do that is:
https://api.telegram.org/bot<token>/getUpdates in a browser (replacing <token> with your
bot token) and look for the chat ID, it should be in message.chat.id in the result array.chat_id field for that user in config.toml.getUpdates API method and
adding ?offset=<update_id+1>, where the update_id is found in the result. This would make it
easier to find other chat IDs when repeating this process.Houserat detects devices connecting to the network when they send a DHCP request packet. It will then notify that device's subscriber and start polling this device to detect when it goes away. Since phones don't always respond to PING packets houserat uses ARP requests which all devices must respond to.
When several ARP requests go unanswered the device is considered disconnected and a notification is sent to the subscriber.
Houserat has several features designed to reduce notification spam: