Add Telegram chat action and simplify memory mode schedule

- Add chat_action parameter to all Telegram notifications
- Support typing, upload_photo, upload_video, upload_document actions
- Make memory mode interval fixed at 24h (daily notifications)
- Remove configurable interval input for memory mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-03 02:48:09 +03:00
parent dce47a9f75
commit e526a54130
2 changed files with 42 additions and 22 deletions

View File

@@ -36,8 +36,8 @@ blueprint:
album_id_entities:
name: Album ID Entities
description: >
List of sensor or input_text entities containing album IDs to monitor.
Only albums matching these IDs will trigger notifications.
List of album entities from the Immich Album Watcher integration to monitor.
Only albums matching these entities will trigger notifications.
Leave empty to track all albums.
Album IDs are stable and won't change if albums get renamed.
Album names and share URLs are automatically read from the entity's
@@ -45,9 +45,7 @@ blueprint:
default: []
selector:
entity:
domain:
- sensor
- input_text
integration: immich_album_watcher
multiple: true
track_assets_added:
@@ -453,6 +451,27 @@ blueprint:
selector:
boolean:
telegram_chat_action:
name: Chat Action
description: >
Telegram chat action to display while processing (e.g., "typing...", "uploading photo...").
Shows a status indicator in the chat while the bot is preparing/sending media.
Set to "None" to disable chat actions.
default: "upload_photo"
selector:
select:
options:
- label: "None"
value: ""
- label: "Typing..."
value: "typing"
- label: "Uploading Photo..."
value: "upload_photo"
- label: "Uploading Video..."
value: "upload_video"
- label: "Uploading Document..."
value: "upload_document"
# -------------------------------------------------------------------------
# Periodic Summary
# -------------------------------------------------------------------------
@@ -695,22 +714,11 @@ blueprint:
selector:
boolean:
memory_mode_interval_hours:
name: Interval (Hours)
description: "How often to send memory notifications (in hours)"
default: 24
selector:
number:
min: 1
max: 168
unit_of_measurement: hours
mode: slider
memory_mode_start_hour:
name: Start Hour
description: >
Hour of day (0-23) when the first memory notification should be sent.
Example: Start hour 9 with 24h interval = daily at 09:00.
Hour of day (0-23) when the daily memory notification should be sent.
Memory notifications are sent once per day at this hour.
default: 9
selector:
number:
@@ -924,6 +932,7 @@ variables:
telegram_media_delay: !input telegram_media_delay
telegram_video_warning_template: !input telegram_video_warning
telegram_disable_url_preview: !input telegram_disable_url_preview
telegram_chat_action: !input telegram_chat_action
# Periodic Summary Settings
enable_periodic_summary: !input enable_periodic_summary
@@ -949,7 +958,6 @@ variables:
# Memory Mode Settings
enable_memory_mode: !input enable_memory_mode
memory_mode_interval_hours: !input memory_mode_interval_hours
memory_mode_start_hour: !input memory_mode_start_hour
memory_mode_album_mode: !input memory_mode_album_mode
memory_mode_limit: !input memory_mode_limit
@@ -1365,8 +1373,7 @@ variables:
{% elif trigger.id == 'hourly_timer' and enable_memory_mode %}
{% set current_hour = now().hour %}
{% set start = memory_mode_start_hour | int %}
{% set interval = memory_mode_interval_hours | int %}
{{ (current_hour - start) % interval == 0 }}
{{ current_hour == start }}
{% else %}
{{ false }}
{% endif %}
@@ -1437,6 +1444,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ periodic_summary_formatted }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
# ---------------------------------------------------------------------------
# SCHEDULED ASSETS: Send notifications with assets from tracked albums
@@ -1670,6 +1678,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ scheduled_message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
# Extract message ID for reply
- variables:
@@ -1693,6 +1702,7 @@ action:
max_group_size: "{{ max_media_per_group }}"
chunk_delay: "{{ telegram_media_delay }}"
wait_for_response: false
chat_action: "{{ telegram_chat_action }}"
# Combined Mode: Fetch from all albums and combine into one notification
# Distributes the limit evenly across albums (e.g., limit=10 with 2 albums = 5 each)
@@ -1921,6 +1931,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ combined_message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
- variables:
combined_reply_to_id: "{{ telegram_combined_text_response[album_id_entities[0]].message_id | default(0) | int }}"
@@ -1942,6 +1953,7 @@ action:
max_group_size: "{{ max_media_per_group }}"
chunk_delay: "{{ telegram_media_delay }}"
wait_for_response: false
chat_action: "{{ telegram_chat_action }}"
# ---------------------------------------------------------------------------
# MEMORY MODE: Send "On This Day" memories from tracked albums
@@ -2170,6 +2182,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ memory_message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
# Extract message ID for reply
- variables:
@@ -2193,6 +2206,7 @@ action:
max_group_size: "{{ max_media_per_group }}"
chunk_delay: "{{ telegram_media_delay }}"
wait_for_response: false
chat_action: "{{ telegram_chat_action }}"
# Combined Mode: Fetch from all albums and combine into one notification
- conditions:
@@ -2411,6 +2425,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ memory_comb_message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
- variables:
memory_comb_reply_to_id: "{{ telegram_memory_comb_text_response[album_id_entities[0]].message_id | default(0) | int }}"
@@ -2432,6 +2447,7 @@ action:
max_group_size: "{{ max_media_per_group }}"
chunk_delay: "{{ telegram_media_delay }}"
wait_for_response: false
chat_action: "{{ telegram_chat_action }}"
# Stop here if this was a scheduled trigger - don't continue to event-based actions
- choose:
@@ -2634,6 +2650,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
# ---------------------------------------------------------------------
# CASE 5: Album Deleted
@@ -2670,6 +2687,7 @@ action:
chat_id: "{{ repeat.item }}"
caption: "{{ message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
# ---------------------------------------------------------------------------
# Send Media to Telegram (if enabled)
@@ -2795,6 +2813,7 @@ action:
chat_id: "{{ current_chat_id }}"
caption: "{{ telegram_message }}"
disable_web_page_preview: "{{ telegram_disable_url_preview }}"
chat_action: "{{ telegram_chat_action }}"
# Extract message ID for replies
- variables:
@@ -2831,3 +2850,4 @@ action:
max_group_size: "{{ max_media_per_group }}"
chunk_delay: "{{ telegram_media_delay }}"
wait_for_response: false
chat_action: "{{ telegram_chat_action }}"