Original URL (with bug tracking etc.): https://sr.ht/~michalr/hswro-alarm-bot/
Michał Rudowicz ab5bd412f2 | ||
---|---|---|
.build.yml | ||
.gitignore | ||
.pre-commit-config.yaml | ||
COPYING | ||
README.md | ||
filters.go | ||
filters_test.go | ||
go.mod | ||
go.sum | ||
main.go | ||
satel_utils.go | ||
satel_utils_test.go | ||
sender_worker.go | ||
sender_worker_test.go |
README.md
Hackerspace Wroclaw Alarm Bot
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
Usage
$ TELEGRAM_APITOKEN=YOUR_API_TOKEN ./alarm_bot --satel_addr=127.0.0.1 --satel_port=31337 --tg_chat_id=YOUR_CHAT_ID_FROM_BOTFATHER
Filtering events by change type
It's possible to filter events by change type. Use the --allowed-types=TYPE1,TYPE2,...
command line parameter to do that. If that parameter is not provided, then all change types are allowed, otherwise only the provided ones will be used for notifications.
Supported types are:
zone-violation
zone-tamper
zone-alarm
zone-tamper-alarm
zone-alarm-memory
zone-tamper-alarm-memory
zone-bypass
zone-no-violation-trouble
zone-long-violation-trouble
armed-partition-suppressed
armed-partition
partition-armed-mode-2
partition-armed-mode-3
partition-with-1st-code-enter
partition-entry-time
partition-exit-time-over-10s
partition-exit-time-under-10s
partition-temporary-blocked
partition-blocked-guard-round
partition-alarm
partition-fire-alarm
partition-alarm-memory
partition-fire-alarm-memory
output
doors-opened
doors-opened-long
status-bit
trouble-part-1
trouble-part-2
trouble-part-3
trouble-part-4
trouble-part-5
trouble-memory-part-1
trouble-memory-part-2
trouble-memory-part-3
trouble-memory-part-4
trouble-memory-part-5
partition-with-violated-zones
zone-isolate
Debugging
Set the OMIT_TG
environment variable to, well, omit sending anything over to Telegram and just see the logs instead.