Quiet hours are now specified per send_telegram_notification call via
quiet_hours_start/quiet_hours_end params instead of being a hub-wide
integration option. This allows different automations to use different
quiet hours windows (or none at all).
- Remove quiet_hours_start/end from config options UI and const.py
- Add quiet_hours_start/end as optional HH:MM params on the service
- Remove ignore_quiet_hours param (omit quiet hours params to send immediately)
- Queue stores quiet_hours_end per item; each unique end time gets its
own async_track_time_change timer for replay
- On startup, items whose quiet hours have passed are sent immediately
- Add async_remove_indices() to NotificationQueue for selective removal
- Timers are cleaned up when no more items need them
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add quiet hours support to queue notifications during configured time windows
- Fix UnboundLocalError when single-item document chunk exceeds max_asset_data_size
- Fix document-only multi-item chunks being silently dropped (missing skip guard)
- Fix notification queue entity lookup by storing entity_id in queued params
- Fix quiet hours using OS timezone instead of HA-configured timezone (dt_util.now)
- Fix chat_action schema rejecting empty string from "Disabled" selector
- Fix stale thumbhash cache entries not being removed on mismatch
- Fix translation descriptions for send_large_photos_as_documents
- Add batch async_set_many() to TelegramFileCache to reduce disk writes
- Add max-entries eviction (2000) for thumbhash cache to prevent unbounded growth
- Eliminate redundant _is_asset_id/get_asset_thumbhash lookups in media group loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
Add asset_count, last_updated, and created_at attributes to the
Album ID sensor for convenient access to album metadata.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add _pending_asset_ids to track assets detected but not yet processed
- Fire events when pending assets become processed (thumbhash available)
- Fixes issue where videos added during transcoding never triggered events
- Add debug logging for change detection and pending asset tracking
- Document external domain feature in README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fetch externalDomain from Immich server config on startup
- Use external domain for user-facing URLs (share links, asset URLs)
- Keep internal connection URL for API calls
- Add get_internal_download_url() to convert external URLs back to
internal for faster local network downloads (Telegram notifications)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use thumbhash for all assets instead of encodedVideoPath for videos
(encodedVideoPath is not exposed in Immich API response)
- Add isTrashed check to exclude trashed assets from events
- Simplify processing status logic for both photos and videos
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement caching for Telegram file_ids to avoid re-uploading the same media.
Cached IDs are reused for subsequent sends, improving performance significantly.
Added configurable cache TTL option (1-168 hours, default 48).
Also added city, state, and country fields from Immich reverse geocoding
to asset data in events and get_assets service.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Expose GPS coordinates from EXIF data in asset responses. The latitude
and longitude fields are included in get_assets service responses and
event data when available.
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>
- Add Telegram Bot Token to configuration options
- Document send_telegram_media_group service with examples
- Update get_recent_assets example with entity target
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CONTRIBUTING.md with development guidelines
- Issue templates for bugs and feature requests
- Pull request template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>