Aller au contenu

Telegram notification

Telegram

https://www.home-assistant.io/integrations/telegram_bot


  1. Tell Telegram to create a bot for you:

    In Telegram, open a chat with @BotFather and enter /newbot. Follow the instructions on screen and give your bot a name. BotFather will give you a link to your new bot and an HTTP API token. Store the token somewhere safe.

  2. To get a chat ID, send any message to the GetIDs bot.

    Then, enter /start. The bot will return your chat ID and the username.

  3. Create a Telegram bot in Home Assistant:

    Paste this into your configuration file:

    Replace the api_key and the allowed_chat_ids with your data.

telegram_bot: - platform: polling api_key: "7225744908:AAHosDTl37A9qQ_5NjHXOGWyyeRABK2MiH0" allowed_chat_ids: - 851022032

  1. Create a notifier:

Paste this into your configuration file:

Replace the name and the chat_id with your data.

# Notifier
notify:
  - platform: telegram
    name: "mathgon_telegram"
    chat_id: 851022032

Restart Home Assistant.

  1. From the conversation with BotFather, select the link to open a chat with your new bot.

  2. In the chat with the new bot, enter /start.

  3. Test the action: