Skip to main content

Telegram

Notification
Telegram

Created: 7/29/2024
Updated: 3/13/2026

The telegram component can do two things:

  • First, it can send detection videos (and thumbnails) to a chat when a detection occurs.
  • Second, it can be used to control the PTZ (pan-tilt-zoom) for the ONVIF component from the chatbot directly, with commands like /home, /left, /right (see available commands below).

Configuration

Configuration example
/config/config.yaml
telegram:
telegram_bot_token: <bot_token_from_BotFather>
telegram_chat_ids:
- <your_chat_id>
detection_label: person
send_detection_thumbnail: true
send_detection_video: true
send_detection_message: false
cameras:
camera_1:
camera_2:
telegrammap required
Telegram bot to control cameras.

How to create a bot and get your chat ID:

Create a bot

  • In Telegram, open @BotFather.
  • Send /newbot, choose a name and a unique username.
  • Copy the token it returns (use this as telegram_bot_token).

Start a conversation

  • Private chat: open your bot and press Start, then send any message.
  • Group: add your bot to the group and send a message in the group.
    • If the bot does not receive group messages, disable privacy via @BotFather: /setprivacy → select your bot → Disable.

Find your chat ID

You can get your chat_id by sending a message to the GetIDs bot.

Configure Viseron

  • Put the numeric ID(s) in telegram_chat_ids.
  • You can list multiple IDs to notify several chats.

For more thorough instructions, see the Home Assistant Telegram docs: https://www.home-assistant.io/integrations/telegram/

Available commands

To find the available commands you can use, send /help to your bot in Telegram. As of the time of writing this documentation, the available help commands are described as follows:

info

Use /help <command> to get more information about a command. For commands starting from number 1 to 13, they only apply to cameras that have ONVIF component.

NoCommandsDescriptionNotes
1/home or /hMove the camera to its home position.If supported by the camera.
2/left or /lPan the camera to the left.Using the RelativeMove operation. And will use ContinuousMove as a fallback if it is not supported.
3/right or /rPan the camera to the right.Using the RelativeMove operation. And will use ContinuousMove as a fallback if it is not supported.
4/up or /uTilt the camera up.Using the RelativeMove operation. And will use ContinuousMove as a fallback if it is not supported.
5/down or /dTilt the camera down.Using the RelativeMove operation. And will use ContinuousMove as a fallback if it is not supported.
6/zo or /oZoom the camera out.Using the RelativeMove operation. And will use ContinuousMove as a fallback if it is not supported.
7/zi or /iZoom the camera in.Using the RelativeMove operation. And will use ContinuousMove as a fallback if it is not supported.
8/posGet the current (PTZ) position of the camera.If supported by the camera.
9/preset or /prChange the camera to a preset position.Will display user-defined presets and presets that are already in the ONVIF camera.
10/repeatPresets are paths when names are reused.-
11/patrol or /pSwings the camera from left to right and back.The default duration is 60 seconds. It will not work properly if your camera does not support GetStatus, RelativeMove, and AbsoluteMove operations.
12/lissaPerform Lissajous curve swing patrols.Must be stopped manually with the /stop command. It will not work properly if your camera does not support GetStatus, RelativeMove, and AbsoluteMove operations.
13/stop or /stStop the patrol.-
14/record or /rRecord a video with the camera.-
15/stop_recorder or /srStop an ongoing manual recording.-
16/list or /li or /selectList all available cameras.-
17/which or /wGet the currently active camera.It is important to know which camera to execute.
18/toggle or /tToggle the camera on or off.-
19/snapshotTake a snapshot with the camera.-
20/helpDisplay a list of commands and their description.-

Troubleshooting

To enable debug logging for telegram, add the following to your config.yaml
/config/config.yaml
logger:
logs:
viseron.components.telegram: debug