02-ago: [proyecto] Sistema vigilancia Tapo con deteccion movimiento/persona + notificacion Telegram/Alexa

This commit is contained in:
minguezsanzjuanjose
2026-08-02 11:02:05 +02:00
parent 3a38e889db
commit 496c2bb9bc
9 changed files with 240 additions and 0 deletions

30
vigilancia/config.py Normal file
View File

@@ -0,0 +1,30 @@
import os
from pathlib import Path
from dotenv import load_dotenv
load_dotenv(Path(__file__).resolve().parent / ".env")
def _cams():
cams = []
i = 1
while True:
nombre = os.getenv(f"CAM_{i}_NOMBRE")
rtsp = os.getenv(f"CAM_{i}_RTSP")
if not nombre or not rtsp:
break
cams.append({"nombre": nombre, "rtsp": rtsp})
i += 1
return cams
CAMARAS = _cams()
TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN")
TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID")
HORA_INICIO = int(os.getenv("HORA_INICIO", 0))
HORA_FIN = int(os.getenv("HORA_FIN", 23))
COOLDOWN = int(os.getenv("COOLDOWN", 30))
WEBHOOK_ALEXA = os.getenv("WEBHOOK_ALEXA", "").strip()
SNAPSHOT_DIR = os.getenv("SNAPSHOT_DIR", "snapshots")