Files
haos-blueprints/Common/Telegram Question
alexei.dolgolyov 24f89e57b8 Replace deprecated target with chat_id in Telegram bot service calls
Fixes deprecation warning for HA 2026.9.0 where telegram_bot.send_message
`target` parameter is being removed in favor of `chat_id`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 00:46:17 +03:00
..

Telegram Keyboard Action Blueprint

This blueprint creates interactive Telegram messages with inline keyboard buttons. When a button is pressed, the corresponding callback action runs.

How It Works

  1. Manual trigger (service call) → Sends message with keyboard to chat(s)
  2. Button press → Triggers telegram_callback event
  3. Blueprint matches callback data to keyboard_id
  4. Executes the corresponding button's callback action
  5. Optionally sends answer and/or hides keyboard/message

Chat ID Resolution

Chat IDs can be provided in two ways:

  • Directly as text list (chat_ids input)
  • From notify entities with friendly names like "Alex (123456789)" - the number in parentheses is extracted as the chat ID

Multiple Telegram Bots

If you have multiple Telegram bots configured in Home Assistant, you must specify the config_entry_id to identify which bot to use.

Find it in: Settings → Devices & Services → Telegram Bot → your bot → URL

Callback Data Format

Each button sends callback data: /<keyboard_id>_<button_index>

Example: /my_keyboard_0 for first button of keyboard "my_keyboard"

Author

Alexei Dolgolyov (dolgolyov.alexei@gmail.com)