From a7eb36aa92f8d3c44db9aab4122de5864d17a932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Sun, 10 Mar 2024 21:34:00 +0100 Subject: [PATCH] Update README --- README.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 46192f7..0a5f982 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ Warning: this is a proof of concept, don't rely on it -I didn't even test it yet so no idea if it works +It was very basically tested, and while it seems to work, approach it without any expectations. +In other words - treat it as a toy, not as a tool that will save your life or valuables, because it probably won't. ## Usage @@ -66,10 +67,41 @@ Supported types are: - `partition-with-violated-zones` - `zone-isolate` -### Filtering events by index (I guess "zone", but I'm not sure) +### Filtering events by index (which meaning depends on the change type) Use the `--allowed-indexes=1,2,3,...` command line parameter to set the list of allowed indexes (of course provide your own list instead of `1,2,3,...`). If that parameter is not provided, then all indexes are allowed; otherwise the notification is sent for all indexes. +## example systemd unit + +``` +[Unit] +Description=Satel Alarm Telegram Status Notifier +Requires=network.target +After=network.target + +[Service] +Type=simple +ExecStart=/path/to/alarm_bot --satel-addr=192.168.13.37 --satel-port=7094 --tg-chat-id=1234,4567,9876 +Environment=TELEGRAM_APITOKEN=YOUR_API_TOKEN +Environment=NOTIFY_URL_DISARM="http://localhost/disarmed" +Environment=NOTIFY_URL_ARM="http://localhost/armed" +DynamicUser=True +RuntimeDirectory=hswro-alarm-bot +StateDirectory=hswro-alarm-bot +RestartSec=30 +Restart=on-failure + +CPUAccounting=true +CPUQuota=5% +MemoryAccounting=true +MemoryHigh=25M +MemoryMax=50M + +[Install] +WantedBy=multi-user.target + +``` + ## Debugging Set the `OMIT_TG` environment variable to, well, omit sending anything over to Telegram and just see the logs instead.