# ============================================================================ # Required — fill these in before running. # ============================================================================ TELEGRAM_TOKEN=your_bot_token_here TELEGRAM_CHAT_ID=-100123456789 RTSP_URL=rtsp://admin:VERIFICATION_CODE@192.168.1.100:554/h264/ch01/main/av_stream # ============================================================================ # Fall detection # ============================================================================ # Minutes on the floor before alerting (default: 3). FALL_THRESHOLD_MINUTES=3 # Minutes between repeated fall alerts (default: 15). ALERT_COOLDOWN_MINUTES=15 # Consecutive "not on floor" frames required before declaring all-clear # (default: 3). Hysteresis to avoid flapping on ambiguous detections. NOT_ON_FLOOR_STREAK_MAX=3 # Floor polygon — only "lying down" poses with a hip inside this zone count # as a fall. Format: "x1,y1;x2,y2;x3,y3;x4,y4". Captured interactively via: # uv run python scripts/setup_roi.py reference.jpg --zone floor # FLOOR_ROI= # ============================================================================ # Climb-out detection # ============================================================================ # Seconds of climbing posture before alerting (default: 10). CLIMB_THRESHOLD_SECONDS=10 # Minutes between repeated climb-out alerts (default: 5). CLIMB_ALERT_COOLDOWN_MINUTES=5 # Suppress climb-out alerts when more than one person is in the frame # (default: true). Rationale: if a helper is present, nonno is being # assisted — not climbing alone. Falsy values accepted: 0 / false / no. CLIMB_SUPPRESS_WHEN_SUPERVISED=true # Bed polygon — climb-out triggers when a hip is inside this zone and an # ankle is outside. Without it, climb-out detection is disabled. Same # format as FLOOR_ROI. Captured via: # uv run python scripts/setup_roi.py reference.jpg --zone bed # BED_ROI= # ============================================================================ # Sampling and runtime # ============================================================================ # How often to sample a frame for analysis, in seconds (default: 5). FRAME_INTERVAL_SECONDS=5 # Back-off (seconds) before retrying after a camera read failure # (default: 0.01). In the happy path the background reader spins without # sleeping to drain the FFmpeg buffer. # READER_POLL_INTERVAL=0.01 # Path of the rotating log file (default: fall-watch.log, relative to cwd). # Rotates daily at 20:00, keeps 7 days of backups. # LOG_FILE=fall-watch.log # Root log level — DEBUG / INFO / WARNING / ERROR (default: INFO). # LOG_LEVEL=INFO