Skip to content

Telegram Bot Integration

five above infinity edited this page Jul 30, 2026 · 2 revisions

Telegram Bot Integration

Thingino can communicate via Telegram to receive commands and send replies, which can be still images or video clips from the camera.

Configuration

Telegram Bot Integration can be configured via Settings --> Telegram Bot (config-telegrambot.html).

This requires at least a Telegram Bot token. How to obtain this token is described on the configuration page.

The configuration entered in the Telegram Bot Configuration page is stored int /etc/telegrambot.json.

The configuration contains a few preconfigured commands that the bot responds to, such as start, help or snap to take a still image.

The shell commands specified as actions for each command are run as root. Their (text-)output is returned in the telegram chat.

The shell command send2telegram, a shell script residing in /sbin/send2telegram can be used in actions to send still images (command /sbin/send2telegram -S) or short video clips (command /sbin/send2telegram -V) to a telegram chat.

send2telegram does not use the tokens and settings from the configuration page (stored in /etc/telegrambot.json) but from the telegram section in the configuration file /etc/send2.json.

Due to this the preconfigured commands snap to 'Snap a picture' with the action /sbin/send2telegram -S and clipto 'Record a clip' will not work without either setting the token in /etc/send2.json or extending the action command to provide the token via the command line parameter -t.

send2telegram also needs a channel to reply to, which can either be configured via /etc/send2.json or, according to the hint at the settings page can be given via the parameter -c from the variable $chat_id.

The later is required if the bot shall reply with the images or videos in the same chat where the commands are sent, which is usually desired.

⚠️This seems to be currently broken, see https://github.com/themactep/thingino-firmware/issues/1367, resulting in the $chat_id variable to not being set.

The fixed chat id for a telegram channel set in /etc/send2.json can be obtained e.g. from the Telegram web client. When accessing a channel on the web client, the channel id can be found in the URL in the form https://web.telegram.org/k/#-12345678, where the number 12345678 is an example for a partial chat or channel id. To be a valid channel id this number 12345678 must be prefixed with '-100' resulting in '-10012345678' as the entry for the channel setting in /etc/send2.json.

⚠️When updating the Telegram Bot Service Settings on the settings page, saving the changes and restarting the Telegram service via the button 'Restart Service' the settings are not taken into account. Instead a full restart of the camera is required for the settings to be applied. See https://github.com/themactep/thingino-firmware/issues/1367.

Commands and Actions for panning and tilting the camera

Command Description Action
left Pan the camera left motors -x -100 -y 0 -d g; motors -p
righ Pan the camera right motors -x 100 -y 0 -d g; motors -p
up Tilt the camera up motors -x 0 -y 100 -d g; motors -p
donw Tilt the camera down motors -x 0 -y -100 -d g; motors -p
home Home the camera motors -d h; motors -p
  1. Wiki Home
  2. About the Project
    1. Contributions
    2. Features
    3. Project Philosophy
    4. Releases
  3. Getting Started
    1. FAQ
    2. Glossary
    3. Hardware Identification
    4. Image Builder
    5. USB Boot Mode
    6. Ingenic USB Cloner
      1. OTG Booting
    7. PPSTRONG
    8. Installation: General
    9. Installation: No Tools Methods
    10. Resources and Links
    11. Support Community
    12. Troubleshooting
    13. UART Connection
    14. Updating Firmware
    15. Unbricking
    16. Web UI
  4. Supported Cameras
    1. Cameras
    2. 360 AP1PA3
    3. AliExpress LTIA‐37FJZ (Vanhua Z55 module)
    4. AOQEE C1
    5. Aosu C5L
    6. Cinnado
      1. Cinnado D1 2K
      2. Cinnado D1 3K
    7. Dekco DC5L
    8. Eufy
      1. Eufy E210 Outdoor Cam
      2. Eufy E220
    9. Galayou/Wansview
      1. Galayou G2
      2. Galayou G7
      3. Wansview W6
      4. Wansview W7/Galayou Y4
    10. Hualai (Wyze/Atom/Neos/Personal)
      1. Dafang Upgrading for Wyze v2
      2. NEOS conversion
      3. Personal Cam Pan and Cam 2
      4. Wyze Cam Pan V1
      5. Wyze Doorbell (V1)
        1. Chime Reverse Engineering
        2. Flashing VDB1 over UART (YMODEM)
        3. MQTT Control and Monitoring
      6. Wyze v2/Neos SmartCam/ATOM Cam 1
      7. Wyze v3
      8. Wyze Accessories
    11. iFlytek XFP301‐M
    12. Jienuo JN-107-AR-E-WIFI
    13. Jooan A6M
    14. LaView L2
    15. LongPlus X07
    16. LSC 3215672
    17. Sannce I21AG
    18. Sonoff Cam‐S2 and B1P
    19. TP-Link Tapo C100/C110/C111
    20. Wuuk Y0510
    21. Xiaomi
      1. Xiaomi Mijia1080p (SXJ02ZM)
      2. Xiaomi MJSXJ03HL
      3. Xiaomi Outdoor Camera AW200 (MJSXJ05HL)
  5. Configuration
    1. Administration
    2. Automation
      1. Configuring camera using runonce.sh script
    3. Cron jobs
    4. General
    5. LED Indicators
    6. Lighting
    7. Media Streaming Endpoints
    8. Network Storage
    9. Networking
      1. DHCP: Timezone
      2. Wireless Networking
      3. USB Direct w CDC (NCM)
      4. USB Ethernet Networking
      5. Remote Access
      6. VPN
        1. Tailscale
        2. Wireguard
        3. Zerotier
      7. Wi-Fi
        1. Self Hosted AP
        2. Tips and Tricks
      8. WWAN (Cellular)
    10. Night Mode
    11. ONVIF
    12. OSD (On-screen Display)
    13. Plugins
      1. Motion Guard
      2. Yandex Disk
    14. SSH Access Keys
    15. Wi-Fi Access
    16. Provisioning
    17. Streamer Bitrate Control
    18. Video Rotation
  6. Integration
    1. Home Assistant
    2. Frigate
    3. Ingenic A1/$15 NVR
    4. LightNVR
    5. Mobile Apps
    6. MQTT Integration
    7. Telegram Bot Integration
    8. Virtual Webcam on Linux
    9. Mainsail (Klipper)
  7. Development
    1. Booting
      1. Boot: MMC SD
      2. Boot: NFS
    2. CH341A Programmer
    3. RTSP Players
    4. Flash Chips
    5. go2rtc
    6. Porting Guide
    7. Ingenic Platform Capability Matrix
    8. Ingenic Image Processor
    9. ISP Reserved Memory (RMEM)
    10. Debugging
    11. Software
      1. Building From Sources
      2. Buildroot
      3. Toolchain
      4. Choice of JSON library
    12. SSL and TLS Web UI in thingino
    13. Tech Info
      1. Hardware
      2. PWM Info
      3. Supported Hardware
      4. T23 GPIOs
      5. T31 GPIOs
    14. U-Boot Cheatsheet
    15. Zeratul/Atlas/Tassadar
    16. Resources

Clone this wiki locally