A powerful Home Assistant custom integration that processes camera snapshots with advanced image manipulation, overlay capabilities, and a professional web-based configuration UI.
- Visual Configuration Panel: Modern, responsive web interface for all settings
- Live Preview: See changes in real-time as you configure
- Interactive Crop Tool: Drag and resize crop regions visually on the preview
- Rich Entity Search: Searchable dropdown with entity details and domains
- State Icon Manager: Professional icon picker with full Material Design Icons library (loaded from CDN)
- Flexible Resizing: Scale images with or without maintaining aspect ratio (1-7680px width, 1-4320px height)
- Visual Cropping: Interactive crop tool with live preview
- Quality Control: Adjustable JPEG compression (1-100%)
- High Performance: In-memory processing with minimal overhead
- Date/Time Stamp: Custom format using Python strftime
- Custom Text: Static text or Home Assistant templates
- Multi-State Icons: Configure different icons, text, and colors for each entity state
- Support for complex conditions (equals, not equals, contains, greater than, less than, in list, etc.)
- Template support for dynamic text (e.g.,
{{ relative_time(...) }} ago) - Real-time template preview with error detection
- Per-state customization: icon, text, colors, background fill
- Flexible Positioning: Place overlays in any corner
- Rich Styling: Custom colors, font sizes, and backgrounds with transparency
- Stream Passthrough: Use original camera's stream
- Custom RTSP: Optional override with custom RTSP URL
- API Compatible: Works with Home Assistant's camera proxy API
The professional web interface provides visual configuration with live preview:
- Split-screen layout: configuration on the left, live preview on the right
- Tabbed interface for organized settings (Dimensions, Crop, Overlays, State Icons, Stream)
- Real-time preview updates as you change settings
Visual crop editor with drag-and-resize handles:
- Click "Enable Visual Crop Editor" to activate
- Drag the crop box to reposition
- Resize using corner handles
- Coordinates auto-update in the form
Professional icon picker and multi-state configuration:
- Full MDI Library: Material Design Icons loaded dynamically from CDN
- Curated Categories: Commonly-used icons organized by category (CCTV, Motion Detection, Alarms, Lights, Security, etc.)
- Search Functionality: Find any icon using "mdi:icon-name" format
- Multi-state rules with complex conditions
- Live template rendering in preview with error detection
- Color pickers for icon and text colors
- Icon background fill option for solid/filled appearance
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/Patras3/camera-snapshot-processor - Select category: "Integration"
- Click "Add"
- Find "Camera Snapshot Processor" in the integration list
- Click "Download"
- Restart Home Assistant
- Download the latest release from GitHub
- Copy the
custom_components/camera_snapshot_processorfolder to your Home Assistant'scustom_componentsdirectory - Restart Home Assistant
- Go to Settings → Devices & Services
- Click + Add Integration
- Search for "Camera Snapshot Processor"
- Click Submit to complete setup
- Find Snapshot Processor panel in your Home Assistant sidebar
All camera configuration is done through the Snapshot Processor panel in your sidebar:
- Open the panel: Click "Snapshot Processor" in your sidebar (left panel)
- Add a camera: Click the "➕ Add Camera" button
- Select source: Choose a camera from your available cameras list
- Configure with live preview:
- Dimensions tab: Set width, height, aspect ratio, quality
- Crop tab: Enable cropping with visual editor or manual coordinates
- Overlays tab: Add date/time stamps and custom text
- State Icons tab: Add dynamic icons that change based on entity states
- Stream tab: Optionally configure custom RTSP stream URL
- Watch preview: Changes update in real-time on the right panel
- Save: Click "💾 Save" button to apply your configuration
State icons allow you to display different icons and text based on entity state:
- In the Snapshot Processor panel, select your camera
- Go to the State Icons tab
- Click Add State Icon
- Configure:
- Entity: Select the entity to monitor (lights, sensors, locks, etc.)
- Label: Optional label text (e.g., "Living Room")
- Position: Choose corner placement
- Font Size: Adjust icon and text size
- Add state-specific rules:
- Click Add State Rule for each state you want to customize
- Set Condition (equals, not equals, contains, etc.)
- Choose Icon using the visual picker (7,000+ MDI icons from CDN)
- Set Text (static or template like
{{ states('sensor.temp') }}°C) - Pick Colors for icon and text
- Enable Icon Background for filled/solid icons
- Templates render in real-time - see the actual result or
<error>with details - Click Save Configuration when done
Source: 4K camera (3840×2160) Output: Full HD (1920×1080) with date/time in bottom-right
Settings:
- Width: 1920, Height: 1080
- Keep aspect ratio: Yes
- DateTime enabled: Yes, position bottom-right
- Format:
%Y-%m-%d %H:%M:%S
Source: Wide-angle hallway camera Output: Cropped to door area with lock status
Settings:
- Crop: X=800, Y=200, Width=1200, Height=900
- Width: 640, Height: 480
- State Icon:
- Entity:
lock.front_door - States:
- Locked:
mdi:lock(red) - Unlocked:
mdi:lock-open(green)
- Locked:
- Entity:
Source: Any camera Output: Shows temperature with color-coded icon
Settings:
- State Icon:
- Entity:
sensor.living_room_temperature - States:
- Greater than 25:
mdi:thermometer(red), text:{{ states('sensor.living_room_temperature') }}°C - Less than 18:
mdi:snowflake(blue), text:{{ states('sensor.living_room_temperature') }}°C - Default:
mdi:thermometer(white), text:{{ states('sensor.living_room_temperature') }}°C
- Greater than 25:
- Entity:
automation:
- alias: "Save processed snapshot on motion"
trigger:
- platform: state
entity_id: binary_sensor.front_door_motion
to: "on"
action:
- service: camera.snapshot
target:
entity_id: camera.front_door_processed
data:
filename: "/config/www/snapshots/motion_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg"Processed snapshots are available through Home Assistant's camera proxy:
http://<your-ha-url>:8123/api/camera_proxy/camera.<camera_name>_processed?token=<long-access-token>
Get the token from Settings → Your Profile → Long-Lived Access Tokens.
State icon text supports Home Assistant templates:
- Current state:
{{ states('sensor.temperature') }}°C - Relative time:
{{ relative_time(states.sun.sun.last_changed) }} ago - Attribute:
{{ state_attr('sun.sun', 'elevation') }}° - Conditional:
{{ 'Hot' if states('sensor.temp')|float > 25 else 'Cool' }}
Use the 🧪 Test Template button in the state icon manager to test templates in real-time!
- Home Assistant ≥ 2025.9.4
- Python ≥ 3.11
- Pillow ≥ 10.0.0 (auto-installed)
- Fetch snapshot from source camera
- Load image into memory (Pillow)
- Apply cropping (if enabled)
- Resize with aspect ratio handling
- Render overlays:
- Date/time with custom format
- Custom text (static or template)
- State icons with conditional rendering
- Compress to JPEG with specified quality
- Return processed bytes
- Check entity current state
- Evaluate rules in order (first match wins)
- Render templates if text_template is enabled
- Select appropriate icon, text, and colors
- Render using MDI font or emoji
- Apply icon background fill if enabled
- Composite onto image at specified position
async_camera_image(): Returns processed snapshotstream_source(): Proxies to original camera's stream- Camera proxy API:
/api/camera_proxy/camera.<entity_id> - Frontend API:
/api/camera_snapshot_processor/*for web UI
- Restart Home Assistant after installation
- Check logs: Settings → System → Logs
- Verify source camera is working
- Verify source camera provides valid images
- Check crop coordinates don't exceed image bounds
- Review logs for specific error messages
- Use the 🧪 Test Template button to validate templates
- Hover over
<error>in preview to see error details - Ensure entity IDs exist and are spelled correctly
- Use proper Jinja2 syntax with
{{ }}delimiters
- Clear browser cache and refresh
- Check browser console for errors
- Verify integration is properly installed
- Check Home Assistant logs for frontend errors
- Processes images in-memory (no disk I/O)
- Efficient Pillow operations with font caching
- Suitable for frequent polling (1 minute intervals, 10+ cameras)
- No caching - always fresh images
- Template rendering cached per render cycle
- Minimal CPU overhead
Primary Security: This integration relies on Home Assistant's security model. Camera Snapshot Processor is a lightweight image processing layer that inherits Home Assistant's authentication, credential storage, and sandboxing.
- Daily CVE Scans: Dependencies scanned for known vulnerabilities (pip-audit)
- CodeQL Analysis: Automated code security analysis
- Dependabot: Automatic dependency update PRs
- Minimal Dependencies: Only Pillow library required
- No Network Exposure: Runs entirely within Home Assistant
- Credential Sanitization: RTSP URLs sanitized in debug logs (
***:***@) - Home Assistant Security: Inherits authentication, encryption, and access control
Found a security concern? Use GitHub Issues or Security Advisory. This is a hobby project, so fixes are released on a normal schedule (unless critical).
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Issues: GitHub Issues
- Feature Requests: GitHub Discussions
This project is licensed under the MIT License - see the LICENSE file for details.
Created by @Patras3
With special thanks to the Home Assistant community for feedback and testing.
Initial stable release of Camera Snapshot Processor.
Features:
- Professional web-based configuration panel with live preview
- Interactive visual crop editor with drag-and-resize
- Advanced state icon manager with full MDI library (7,000+ icons loaded from CDN)
- Multi-state support with complex conditions (equals, not equals, contains, gt, lt, in list, etc.)
- Home Assistant template support for dynamic text with real-time preview
- Real-time template error detection with helpful messages
- Rich entity search with domain tags
- Per-state customization (icon, text, colors, icon background fill)
- Icon background fill option for solid/filled icon appearance
- Template testing directly in UI with "🧪 Test Template" button
- "📊 Use Entity State" button for quick template insertion
- CDN-powered icon loading: All Material Design Icons available without bloating repository
Technical:
- Complete UI redesign with modern, responsive interface
- Split-screen layout with live preview
- Tabbed configuration for better organization
- MDI icons rendered using official CSS library
- Smart icon translation: Frontend translates icon names to Unicode at config-time for zero runtime overhead
- Curated icon categories with search for all MDI icons
- Improved color pickers with RGB/RGBA support
- Comprehensive error handling and user feedback
- RTSP URL credential sanitization in logs
- Orphaned entity cleanup
- Home Assistant 2025.12+ compatibility
Quality:
- Code quality: Passes black, isort, flake8 with zero violations
- Security: Daily CVE scans, CodeQL analysis, Dependabot monitoring
- Performance: Suitable for 10+ cameras with 1-minute polling intervals
- Compatibility: Home Assistant ≥ 2025.9.4, Python ≥ 3.11