odoo_mqtt/iot_bridge/config.dev.yaml
matthias.lotz ba588842ad feat: Add automatic API documentation generation and device status monitoring
- Implement build script (build_docs.py) with AST parser to auto-generate HTML docs from docstrings
- Add comprehensive Google-style docstrings to all controllers and models
- Create static/description/index.html for Odoo Apps UI with module overview
- Generate api_reference.html (20.5 KB) from source code, linked from Odoo UI
- Add DOCUMENTATION_STRATEGY.md with comparison of 5 documentation approaches
- Create API.md with complete REST API documentation

Device Status Monitoring:
- Implement device_status_monitor.py with health checks and offline detection
- Add /status endpoint for device health overview
- Automatic offline detection after message_timeout_s

Config Push Architecture:
- Add POST /config endpoint to IoT Bridge for dynamic device management
- Auto-push device config from Odoo on create/write/unlink
- Implement device_manager.py for runtime device updates

E2E Tests:
- All 6 E2E tests passing (Create, Update, Push, Delete, Restart, Status Monitor)
- Test coverage for device lifecycle and config synchronization

Documentation is auto-generated via: ./build_docs.sh
View in Odoo: Settings → Apps → Open Workshop MQTT → API Reference
2026-02-15 11:03:22 +01:00

58 lines
1.7 KiB
YAML

# IoT Bridge Development Configuration
# For use with docker-compose.dev.yaml and local Mosquitto
mqtt:
broker: "mosquitto" # Docker service name from docker-compose
port: 1883 # Unencrypted for local development
username: "" # Leave empty if Mosquitto allows anonymous
password: ""
client_id: "iot_bridge_dev"
keepalive: 60
use_tls: false # No TLS for local testing
odoo:
# Local Odoo instance from docker-compose
base_url: "http://odoo-dev:8069"
database: "odoo"
username: "admin"
api_key: "" # Add your API key here when ready for Phase 2
use_mock: false # Using real Odoo REST API
logging:
level: "DEBUG" # More verbose for development
format: "json"
# Event Queue Configuration
event_queue:
max_retries: 3
initial_retry_delay_s: 2
max_retry_delay_s: 60
retry_backoff_factor: 2.0
devices:
- device_id: "shellypmminig3-48f6eeb73a1c"
mqtt_topic: "shaperorigin/status/pm1:0"
parser_type: "shelly_pm_mini_g3"
machine_name: "Shaper Origin"
session_config:
strategy: "power_threshold"
standby_threshold_w: 20
working_threshold_w: 100
start_debounce_s: 3
stop_debounce_s: 15
message_timeout_s: 20
heartbeat_interval_s: 300 # 5 minutes
- device_id: "testshelly-simulator"
mqtt_topic: "testshelly/status/pm1:0"
parser_type: "shelly_pm_mini_g3"
machine_name: "Test Shelly Simulator"
session_config:
strategy: "power_threshold"
standby_threshold_w: 20
working_threshold_w: 100
start_debounce_s: 3
stop_debounce_s: 15
message_timeout_s: 20
heartbeat_interval_s: 30 # 30 seconds for faster testing