config
Michał Rudowicz 2024-03-10 21:34:00 +01:00
rodzic 7815009318
commit a7eb36aa92
1 zmienionych plików z 34 dodań i 2 usunięć

Wyświetl plik

@ -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.