Have no idea is it possible or not.
Example code:
telegram_bot:
- platform: polling
api_key: ...
parse_mode: ...
allowed_chat_ids:
- xxxxxxxxx
...
notify:
- platform: telegram
name: telegram_xxx
chat_id: xxxxxxxxx
Usage:
service: notify.telegram_xxx
data:
message: hello
Scenario:
- User sent some message using “notify.telegram_xxx” service.
- Due to some reasons the message is not sent (at least not delivered).
- There is an error in Log like:
2024-08-09 06:37:39.532 ERROR (MainThread) [homeassistant.components.telegram_bot] Error sending message: Timed out. Args: (-1009917799099, ‘…’), kwargs: {‘parse_mode’: <ParseMode.HTML>, ‘disable_web_page_preview’: False, ‘disable_notification’: False, ‘reply_to_message_id’: None, ‘reply_markup’: None, ‘read_timeout’: None, ‘message_thread_id’: None}
A desired behaviour:
There is a possibility to get a status of sending a message - “success/failed”.
Then, if “failed”, we can call the “notify.telegram_xxx” service again.