This document describes the structure of the Home Assistant Sentry add-on repository.
Home-Assistant-Sentry/
├── ha_sentry/ # Add-on directory
│ ├── rootfs/ # Root filesystem for the add-on container
│ │ ├── app/ # Main application code
│ │ │ ├── main.py # Entry point for the application
│ │ │ ├── config_manager.py # Configuration management
│ │ │ ├── ha_client.py # Home Assistant API client
│ │ │ ├── ai_client.py # AI provider integration
│ │ │ ├── dashboard_manager.py # Dashboard entities manager
│ │ │ ├── dependency_analyzer.py # Dependency analysis
│ │ │ └── sentry_service.py # Main service coordinator
│ │ └── usr/
│ │ └── bin/
│ │ └── run.sh # Add-on startup script
│ ├── config.yaml # Add-on configuration (Home Assistant)
│ ├── config.json # Add-on configuration (JSON format)
│ ├── build.json # Build configuration for multi-arch
│ ├── Dockerfile # Container image definition
│ ├── CHANGELOG.md # Version history (add-on directory)
│ └── requirements.txt # Python dependencies
├── tests/ # Test files
│ ├── test_basic.py # Basic module tests
│ └── test_dependency_analyzer.py # Dependency analyzer tests
├── repository.json # Repository metadata for Supervisor
├── README.md # Main documentation
├── DOCS.md # Detailed user documentation
├── QUICKSTART.md # Quick start guide
├── EXAMPLES.md # Configuration examples
├── STRUCTURE.md # This file
├── LICENSE # MIT License
└── .gitignore # Git ignore rules
- config.yaml: Home Assistant add-on metadata and options schema (in
ha_sentry/) - config.json: Alternative JSON format for add-on configuration (in
ha_sentry/) - build.json: Build configuration for multi-architecture support (in
ha_sentry/) - Dockerfile: Container image build instructions (in
ha_sentry/) - repository.json: Repository metadata for Home Assistant Supervisor
- main.py: Application entry point, starts the service
- config_manager.py: Loads and manages configuration from environment
- ha_client.py: Client for Home Assistant Supervisor and Core APIs
- ai_client.py: Client for AI providers (OpenAI, Ollama, LMStudio, etc.)
- dashboard_manager.py: Creates and updates sensor entities
- sentry_service.py: Main service that coordinates update checks and analysis
- run.sh: Startup script that loads configuration and starts Python app
- README.md: Overview, features, quick start
- DOCS.md: Comprehensive user documentation
- EXAMPLES.md: Configuration examples
- CHANGELOG.md: Version history and changes (in
ha_sentry/)
- Startup: run.sh loads config → starts main.py
- Initialization: main.py → config_manager → sentry_service
- Scheduled Check: sentry_service → ha_client (get updates)
- Analysis: sentry_service → ai_client (analyze conflicts)
- Reporting: sentry_service → dashboard_manager → ha_client (update sensors)
- Notification: sentry_service → ha_client (create notification)
- Loads configuration from environment variables
- Provides settings to other components
- Manages API credentials
- Communicates with Supervisor API for add-on info
- Communicates with Core API for HACS info
- Creates notifications and sensor states
- Supports multiple AI providers
- Analyzes updates for conflicts
- Falls back to heuristic analysis if AI unavailable
- Creates sensor entities
- Updates sensor states with analysis results
- Coordinates all components
- Manages scheduling
- Runs update checks
- Reports results
- Edit
config.yaml: Add provider to schema - Edit
ai_client.py: Add provider initialization in_initialize_client() - Test with new provider configuration
- Edit
dashboard_manager.py: Add new sensor inupdate_sensors() - Use
ha_client.set_sensor_state()to create/update - Document new sensor in README.md
- Edit
ai_client.py: Update_fallback_analysis()for heuristics - Edit
_get_system_prompt()to guide AI analysis - Test with various update scenarios
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Set environment variables for testing
- Run tests:
python3 tests/test_basic.py
The add-on is built by Home Assistant when installed. For manual builds:
docker build -t ha-sentry .See CONTRIBUTING.md for guidelines on contributing to this project.