- Asset cache now validates entries by comparing stored thumbhash with current
Immich thumbhash instead of using TTL expiration. This makes cache invalidation
precise (only when content actually changes) and eliminates unnecessary re-uploads.
URL-based cache retains TTL for non-Immich URLs.
- Add TELEGRAM_MAX_VIDEO_SIZE (50 MB) check to skip oversized videos in both
single-video and media-group paths, preventing entire groups from failing.
- Split media groups into sub-groups by cumulative upload size to ensure each
sendMediaGroup request stays under Telegram's 50 MB upload limit.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add type: document as default media type (instead of photo)
- Add optional content_type field for explicit MIME type specification
- Documents are sent separately (Telegram API limitation for media groups)
- Default content types: image/jpeg (photo), video/mp4 (video), auto-detect (document)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shows typing/upload indicator while processing media. Supports:
typing, upload_photo, upload_video, upload_document actions.
Set to empty string to disable. Default: typing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Renamed the date filter parameter and changed default behavior to match
Google Photos memories - now excludes assets from the same year as the
reference date, returning only photos from previous years on that day.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add offset parameter for pagination support
- Add on_this_day parameter for memories filtering (match month and day)
- Add city, state, country parameters for geolocation filtering
- Update README with new parameters and examples
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace filter parameter with independent favorite_only boolean
- Add order_by parameter supporting date, rating, and name sorting
- Rename count to limit for clarity
- Add date range filtering with min_date and max_date parameters
- Add asset_type filtering for photos and videos
- Update README with language support section and fixed sensor list
- Add translations for all new parameters
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove photo downscaling logic in favor of cleaner error handling
- Add intelligent Telegram API error logging with diagnostics and suggestions
- Define Telegram photo limits as global constants (TELEGRAM_MAX_PHOTO_SIZE, TELEGRAM_MAX_DIMENSION_SUM)
- Add photo_url support for image assets (matching video_url for videos)
- Unify asset detail building with shared _build_asset_detail() helper method
- Enhance get_assets service to return complete asset data matching events
- Simplify attribute naming by removing redundant asset_ prefix from values
BREAKING CHANGE: Asset attribute keys changed from "asset_type", "asset_filename"
to simpler "type", "filename" for consistency and cleaner JSON responses
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements send_large_photos_as_documents parameter to handle photos
exceeding Telegram's limits (10MB file size or 10000px dimension sum).
Features:
- Automatic detection of oversized photos using file size and PIL-based
dimension checking
- Two handling modes:
* send_large_photos_as_documents=false (default): Intelligently
downsizes photos using Lanczos resampling and progressive JPEG
quality reduction to fit within Telegram limits
* send_large_photos_as_documents=true: Sends oversized photos as
documents to preserve original quality
- For media groups: separates oversized photos and sends them as
documents after the main group, or downsizes them inline
- Maintains backward compatibility with existing max_asset_data_size
parameter for hard size limits
This resolves PHOTO_INVALID_DIMENSIONS errors for large images like
26MP photos while giving users control over quality vs. file size.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Introduces optional max_asset_data_size parameter (in bytes) to filter
out oversized photos and videos from Telegram notifications. Assets
exceeding the limit are skipped with a warning, preventing
PHOTO_INVALID_DIMENSIONS errors for large images (e.g., 26MP photos).
Changes:
- Add max_asset_data_size parameter to service signature
- Implement size checking for single photos/videos
- Filter oversized assets in media groups
- Update services.yaml, translations, and documentation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add `wait_for_response` parameter (default: true) for fire-and-forget operation
- Change supports_response to OPTIONAL to allow both modes
- Refactor execution logic into `_execute_telegram_notification` method
- Background tasks created with `hass.async_create_task` when wait_for_response=false
- Update documentation with non-blocking mode example and response behavior
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Renamed send_telegram_media_group to send_telegram_notification with expanded capabilities:
- Text messages (when urls is empty)
- Single photo/video (uses sendPhoto/sendVideo APIs)
- Media groups (uses sendMediaGroup API)
- Automatic chunking for unlimited media URLs
- Smart optimization: single-item chunks use appropriate single-item APIs
New parameters:
- max_group_size (2-10, default 10): control items per media group
- chunk_delay (0-60000ms, default 0): delay between chunks for rate limiting
- disable_web_page_preview: disable link previews in text messages
The service now intelligently selects the most efficient Telegram API endpoint based on content type and chunk size, with comprehensive error handling and logging.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>