A lightweight Flask API for retrieving status and zone information from a Sigma alarm system.
- Logs in and authenticates with the Sigma alarm panel
- Parses alarm status, AC power, battery level, and zone data
- Provides a single
/statusendpoint returning JSON - Resilient to flaky network and partial HTML responses (retry logic)
git clone https://github.com/yourname/sigma-alarm-api.git
cd sigma-alarm-apiCreate a .env file or export the following variables:
SIGMA_BASE_URL=http://192.168.1.1:5053
SIGMA_USERNAME=<your_username>
SIGMA_PASSWORD=<your_password_or_pin>
SIGMA_MAX_ATTEMPTS=5
SIGMA_RETRY_TOTAL=5
SIGMA_RETRY_BACKOFF=0.5
SIGMA_RETRY_HTML=3
SIGMA_LOG_LEVEL=INFOpip install -r requirements.txt
export FLASK_APP=sigma_api.py
flask runAccess it at http://localhost:8080/status
docker build -t sigma-alarm-api .
docker run -p 8080:8080 --env-file .env sigma-alarm-apiTest it:
curl http://localhost:8080/status | jq| Variable | Description | Required | Default |
|---|---|---|---|
SIGMA_BASE_URL |
Base URL of the Sigma alarm web UI | ✅ | – |
SIGMA_USERNAME |
Login username | ✅ | – |
SIGMA_PASSWORD |
Login password or PIN | ✅ | – |
SIGMA_MAX_ATTEMPTS |
Retry attempts for full flow | ❌ | 3 |
SIGMA_RETRY_TOTAL |
Retry attempts for HTTP requests | ❌ | 3 |
SIGMA_RETRY_BACKOFF |
Backoff factor for retries | ❌ | 0.5 |
SIGMA_RETRY_HTML |
Retry attempts for HTML parsing failures | ❌ | 3 |
SIGMA_LOG_LEVEL |
Logging level (DEBUG, INFO, WARNING, etc.) |
❌ | INFO |
sigma_api.py # Flask app
sigma_client.py # Sigma alarm communication logic
log_config.py # Centralized logging config
requirements.txt # Dependencies
Dockerfile # Docker image definition
MIT – use freely, modify, distribute.