How 1valcl3b/projeto_rc works
This repository simulates an intelligent residential-security system. Camera footage is analyzed for people, animals, movement, and perimeter or zone threats; detections are published over MQTT, triggering protective actions while a separate receiver records occurrences and evidence for authenticated dashboard and API access. The graph also preserves zone calibration, actuator-state reporting, and optional Home Assistant, notification, and Asterisk integrations. Source excerpts support the main calls and data flows; file-based evidence/live-frame handoffs are documented or implied but not fully shown.
Main entry points: mosquitto.conf MQTT broker · reacao.py Threat response · api.py Authenticated API · deteccao.py Video detection
Components 19
Detection and monitoring
- Video detection
deteccao/deteccao.py - Camera zones
config/cameras.json - Zone calibration
scripts/calibrar_zonas.py - Live and evidence files
deteccao/deteccao.py
Messaging and response
- MQTT client utilities
comum/mqtt_util.py - MQTT broker
mosquitto/mosquitto.conf - Threat response
reacao/reacao.py - Virtual ESP32
esp32/esp32.py
Records and access
- Event receiver
receptor/receptor.py - Security database
mysql/init/01_schema.sql - Retry queue
receptor/receptor.py - Authenticated API
api/api.py - Web dashboard
api/dashboard.html
Simulation and configuration
- Event emulator
emulador/emulador.py
Other components
- Camera sources
- Home Assistant
- Notification endpoint
- Asterisk calling
- Homeowner
Connections 25
- Camera sources → Video detection: provides video
- Camera zones → Video detection: configures zones
deteccao/deteccao.py - Zone calibration → Camera zones: outputs settings
scripts/calibrar_zonas.py - Video detection → Live and evidence files: writes frames
deteccao/deteccao.py - Video detection → MQTT broker: publishes detections
deteccao/deteccao.py - MQTT client utilities → MQTT broker: connects clients
comum/mqtt_util.py - MQTT broker → Threat response: dispatches events
reacao/reacao.py - Threat response → MQTT broker: publishes commands
reacao/reacao.py - MQTT broker → Virtual ESP32: dispatches commands
esp32/esp32.py - Virtual ESP32 → MQTT broker: publishes state
esp32/esp32.py - MQTT broker → Threat response: dispatches actuator state
reacao/reacao.py - Threat response → Home Assistant: publishes discovery
reacao/reacao.py - Threat response → Notification endpoint: sends notification
reacao/reacao.py - Threat response → Asterisk calling: writes call file
reacao/reacao.py - MQTT broker → Event receiver: dispatches records
receptor/receptor.py - Event receiver → Security database: stores events
receptor/receptor.py - Event receiver → Retry queue: queues failures
receptor/receptor.py - Retry queue → Security database: retries records
receptor/receptor.py - Authenticated API → Security database: queries records
api/api.py - Authenticated API → Live and evidence files: reads live frames
api/api.py - MQTT broker → Authenticated API: dispatches state
api/api.py - Homeowner → Web dashboard: opens dashboard
- Web dashboard → Authenticated API: requests views
- Homeowner → Authenticated API: queries securely
api/api.py - Event emulator → MQTT broker: publishes scenarios
emulador/emulador.py