Set up Telegram using Nabu Casa

I have Telegram working using webhooks via Nabu Casa. I also switched from polling to avoid all those requests (and I think webhooks is a bit quicker as well).

There is no need to configure an url in the Telegram config when you have defined the external url in the basic information setup.

You have to add 127.0.0.1 to trusted_networks as otherwise the messages aren’t received by the bot.

This is my config:

telegram_bot:
  - platform: webhooks 
    api_key: !secret api_telegram
    trusted_networks:
      - 149.154.160.0/20
      - 91.108.4.0/22
      - 127.0.0.1
    allowed_chat_ids:
      - !secret chatid_telegram
      - !secret alarm_chatid_telegram
      - !secret info_chatid_telegram
      - !secret user_chatid_telegram
4 Likes