-
Notifications
You must be signed in to change notification settings - Fork 291
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.
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.
$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.
| 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 |
- Wiki Home
- About the Project
- Getting Started
-
Supported Cameras
- Cameras
- 360 AP1PA3
- AliExpress LTIA‐37FJZ (Vanhua Z55 module)
- AOQEE C1
- Aosu C5L
- Cinnado
- Dekco DC5L
- Eufy
- Galayou/Wansview
- Hualai (Wyze/Atom/Neos/Personal)
- iFlytek XFP301‐M
- Jienuo JN-107-AR-E-WIFI
- Jooan A6M
- LaView L2
- LongPlus X07
- LSC 3215672
- Sannce I21AG
- Sonoff Cam‐S2 and B1P
- TP-Link Tapo C100/C110/C111
- Wuuk Y0510
- Xiaomi
- Configuration
- Integration
- Development