# Setting up a Telegram bot for Unit and notes on the config

**URL:** <https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382>\
**Category:** Firmware / Klipper / Portal\
**Created:** [August 11, 2025, 3:38pm UTC](https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382 "2025-08-11T15:38:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruslan\_p\_261](https://forum.idryer.org/letter_avatar_proxy/v4/letter/r/f04885/32.png) [@ruslan\_p\_261](https://forum.idryer.org/u/ruslan_p_261)\
**Post date:** [August 11, 2025, 3:38pm UTC](https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382/1 "2025-08-11T15:38:36Z")

</div>

Setting up a Telegram bot

Sooo…

First, you need to have a Unit already set up and running smoothly.

How to connect a Unit to a Telegram bot and control drying remotely:

1. In Telegram, find @BotFather ([https://t.me/BotFather](https://t.me/BotFather)), message it, and send /newbot, come up with a name for the bot in English, and then follow the instructions — basically a mini quest — after which you’ll get the HTTP API we need;
2. Go into KIAUH and install the bot;
3. Now you need to add to the bot config so you can control it. To do that, open the config file in an editor (depending on the system, the config may be in different folders)

nano /home/…../printer\_data/config/telegram.conf  
In the bot\_token line, paste the API you got earlier from BotFather, and at this stage save the config file.  
Then restart the bot and apply the config changes with: sudo systemctl restart moonraker-telegram-bot ;  
4. Open our bot, which will accept commands from us to control the dryer, and send the /start command, but in response you’ll get an error like… Unauthorized access detected with chat id: 12345qwerty (at this stage we specifically need the chat id);  
5. Open the Telegram bot config file from step 3 again and put the id from our bot’s message into the chat\_id line. You also need to remove the timelapse section and save the config file, then restart the service (the command is in step 3).  
After all these steps, the bot will send a message and should hopefully let you control the dryer using the configured macros 🤘🏻

> **🇷🇺 Оригинал**
>
> Настройка телеграм бота
> 
> Итаааак…
> 
> Предварительно требуется настроенный и спокойно работающий Unit
> 
> Как подключить Unit к телеграмм боту и управлять сушкой удаленно:
> 
> 1. Ищем в телеграмме @BotFather ([https://t.me/BotFather](https://t.me/BotFather)) стучимся к нему и пишем /newbot, придумываем название бота на Английском языке и следует инструкция, которую нужно пройти, почти квест, пройдя который мы получим нужный нам HTTP API;
> 2. Заходим в KIAUH и устанавливаем бота;
> 3. Теперь, нужно дополнить конфиг бота, для того что бы управлять им, для этого открываем в редакторе файл конфигурации (в зависимости от системы конфиг может находиться в различных папках)  
> nano /home/…../printer\_data/config/telegram.conf  
> В строку bot\_token вписываем ранее полученный API от Бота-отца и на данном этапе сохраняем файл конфига.  
> Далее для перезапуска бота и применения изменений в конфиге вводим: sudo systemctl restart moonraker-telegram-bot ;
> 4. Заходим в нашего бота, который будет принимать от нас команды для управления сушилкой и пишем команду /start, но в ответ получим ошибку вида… Unauthorized access detected with chat id: 12345qwerty (на этом этапе нам нужен именно chat id);
> 5. Снова открываем файл конфигурации телеграмм бота из п.3 и вносим в строку chat\_id id из сообщения нашего бота, также необходимо убрать секцию таймлапса и сохранить файл конфига, далее перезагрузить службу (команда в п.3)  
> После проделанных манипуляций бот напишет сообщение и возможно будет управлять сушилкой при помощи настроенных макросов 🤘🏻

---

<div class="post-metadata">

**Author:** ![ivan\_vorotnikov\_394](https://forum.idryer.org/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@ivan\_vorotnikov\_394](https://forum.idryer.org/u/ivan_vorotnikov_394)\
**Post date:** [August 11, 2025, 3:54pm UTC](https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382/2 "2025-08-11T15:54:10Z")

</div>

Ah, well that’s just the standard TG bot setup.  
For the full picture, you also need to define the sensors correctly in telegram.cfg.

> **🇷🇺 Оригинал**
>
> А, ну это же стандартная настройка бота тг.  
> Чтобы полная картина была - нужно правильно датчики в телеграм.кфг прописать.

---

<div class="post-metadata">

**Author:** ![dmitriy\_fedorov\_284](https://forum.idryer.org/letter_avatar_proxy/v4/letter/d/838e76/32.png) [@dmitriy\_fedorov\_284](https://forum.idryer.org/u/dmitriy_fedorov_284)\
**Post date:** [August 11, 2025, 4:10pm UTC](https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382/3 "2025-08-11T16:10:09Z")

</div>

Yeah, true, but first it at least needs to work with remote commands, and for the especially picky ones who want more, you can also make it send status messages)

> **🇷🇺 Оригинал**
>
> Так то да, для начала нужно хоть что бы оно работало от удаленных команд, а для особо искушенных и желающих уже можно статус сообщения что б отсылал)

---

<div class="post-metadata">

**Author:** ![ivan\_vorotnikov\_394](https://forum.idryer.org/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@ivan\_vorotnikov\_394](https://forum.idryer.org/u/ivan_vorotnikov_394)\
**Post date:** [August 11, 2025, 4:31pm UTC](https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382/4 "2025-08-11T16:31:57Z")

</div>

I also installed the bot right away. When I add more Units later, then I’ll properly sort out the config)

> **🇷🇺 Оригинал**
>
> Тоже сразу бота поставил. Когда буду ещё юнитов добавлять, тогда и займусь нормально конфигом)

---

<div class="post-metadata">

**Author:** ![dmitry\_demidov\_258](https://forum.idryer.org/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@dmitry\_demidov\_258](https://forum.idryer.org/u/dmitry_demidov_258)\
**Post date:** [August 11, 2025, 4:33pm UTC](https://forum.idryer.org/t/setting-up-a-telegram-bot-for-unit-and-notes-on-the-config/1382/5 "2025-08-11T16:33:31Z")

</div>

One weird thing about the Telegram bot for the Unit — for some reason there are spaces between capital letters 🤷‍♂️

Printer standby

🌡 M C U: 46 °C  
🌡 I Dryer U 1 Air: 31 °C  
🌪 Fan U 1: 0%  
♨ I Dryer U 1 Heater: 31 °C

> **🇷🇺 Оригинал**
>
> из странненького про телегобот для юнита - почему-то пробелы между заглавными буквами🤷‍♂️
> 
> Printer standby
> 
> 🌡 M C U: 46 °C  
> 🌡 I Dryer U 1 Air: 31 °C  
> 🌪 Fan U 1: 0%  
> ♨ I Dryer U 1 Heater: 31 °C
