From 27ff2ae8f02ca6235f2661e0d500a795a227597c Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Thu, 5 Feb 2026 02:18:36 +0300 Subject: [PATCH] Remove telegram_notify_targets from Immich Album Watcher Simplify Telegram recipient configuration to only use input_text entities for chat IDs. Removes the notify entity friendly name parsing which was complex and error-prone. Co-Authored-By: Claude Opus 4.5 --- Common/Immich Album Watcher/README.md | 3 +-- Common/Immich Album Watcher/blueprint.yaml | 28 +--------------------- manifest.json | 2 +- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/Common/Immich Album Watcher/README.md b/Common/Immich Album Watcher/README.md index 9c47da0..1acdd3e 100644 --- a/Common/Immich Album Watcher/README.md +++ b/Common/Immich Album Watcher/README.md @@ -130,8 +130,7 @@ When enabled, photos/videos are sent as media attachments to Telegram using the ### Supported Recipients -1. **Notify Entities**: Select Telegram notify entities. Chat ID is extracted from the friendly name. Format: `"Name (123456789)"` -2. **Input Text Entities**: Select input_text entities containing chat IDs for groups/channels. +Select input_text entities containing Telegram chat IDs. Can be user IDs (positive) or group IDs (negative). ### Requirements diff --git a/Common/Immich Album Watcher/blueprint.yaml b/Common/Immich Album Watcher/blueprint.yaml index 2f743e2..c7a59e2 100644 --- a/Common/Immich Album Watcher/blueprint.yaml +++ b/Common/Immich Album Watcher/blueprint.yaml @@ -364,24 +364,10 @@ blueprint: selector: boolean: - telegram_notify_targets: - name: Telegram Notify Targets - description: > - Select Telegram notify entities to send media to. - The chat ID will be extracted from the entity's friendly name. - Expected format: "Name (123456789)" where the number in parentheses is the chat ID. - default: [] - selector: - entity: - domain: notify - multiple: true - telegram_chat_id_entities: name: Telegram Chat ID Entities description: > List of input_text entities containing Telegram chat IDs to send media to. - Use this for chat IDs not associated with notify entities, - or as a fallback if friendly name parsing doesn't work. Can be user IDs (positive) or group IDs (negative). Chat IDs are read from the entity states. default: [] @@ -948,7 +934,6 @@ variables: # Telegram Media Settings send_telegram_media: !input send_telegram_media - telegram_notify_targets: !input telegram_notify_targets telegram_chat_id_entities: !input telegram_chat_id_entities max_media_to_send: !input max_media_to_send max_media_per_group: !input max_media_per_group @@ -991,20 +976,9 @@ variables: memory_mode_min_rating: !input memory_mode_min_rating memory_mode_message_template: !input memory_mode_message - # Parse chat IDs from notify entity friendly names (format: "Name (123456789)") - # and combine with chat IDs from input_text entities + # Read chat IDs from input_text entity states telegram_chat_ids: > {% set ns = namespace(ids = []) %} - {# Extract chat IDs from notify entity friendly names #} - {% for entity_id in telegram_notify_targets %} - {% set friendly_name = state_attr(entity_id, 'friendly_name') | default('') %} - {# Match number in parentheses at the end: "Diana (350705409)" -> "350705409" #} - {% set match = friendly_name | regex_findall('\\((-?\\d+)\\)\\s*$') %} - {% if match | length > 0 %} - {% set ns.ids = ns.ids + [match[0]] %} - {% endif %} - {% endfor %} - {# Read chat IDs from input_text entity states #} {% for entity_id in telegram_chat_id_entities %} {% set value = states(entity_id) | default('') | trim %} {% if value | length > 0 and value not in ['unknown', 'unavailable'] and value not in ns.ids %} diff --git a/manifest.json b/manifest.json index 230d39d..96f53df 100644 --- a/manifest.json +++ b/manifest.json @@ -1,3 +1,3 @@ { - "version": "1.30.0" + "version": "1.31.0" }