Telegram Bot

Telegram Bot Programming

Since smartphones have been available, completely new possibilities have opened up for remote access to industrial processes. The interactions that are possible with the smartphone can be designed in a variety of convenient ways and go beyond simple text notifications.
With the Telegram Bot connection, the OPC Router enables the “Telegram” messenger to be linked to the industrial process (see Video). Authenticated users of the bot can receive messages, i.e. alarms, production messages, operating states, (push notifications), but can also actively trigger actions via the Telegram Bot. Application-specific queries and activities can be configured in the OPC Router, which are then called up from the smartphone via authenticated remote access.
You can easily create a convenient remote access to your production system and give the users the possibility for quick reactions in exceptional situations and easy access to production data.

Example for sending messages to a Telegram Client

Transmission of data from a MQTT message to a Telegram client. Here process data.
Message representation in the Telegram Client. Process data and status messages.

Achieve more with Combined Systems

In production, systems work with important data – data that is vital for the production value chain. Easy connectivity, which is established with the OPC Router, seaks to get the right data to the right people just in time, making production a value-rich experience by optimizing data transfers.

Industry 4.0 with Telegram Bots

Industry 4.0 relies on fast and automated data exchange. The Telegram Messenger plug-in involves people and ensures optimized information distribution through targeted and bidirectional messaging.

About the OPC Router

With the OPC Router you can graphically network your systems. Numerous plug-ins make it a data hub in the industrial environment. It creates the connection from OPC to Telegram, from SQL to Telegram, from SAP to Telegram, from MQTT to Telegram and much more.

Simple configuration, sophisticated monitoring and robustness characterize it.

Combining Systems

That’s how easy it is.

Transfer Objects

The transfer object of the Telegram Messenger plug-in establishes the connection to the Telegram Bot. When a transfer is triggered, messages can be sent to selected recipients. Different formats are available for the messages.

Message formats

Text for classic text messages.
Image for sending images.
Audio for sound recording.
Video for video sequences.
Document for sending files.
Location to send location information displayed on the smartphone in the map app.
Contact for sending VCards.

Trigger Functions

The Telegram Messenger plug-in has its own trigger. In connections this trigger can be used and gets a name. The name of the trigger becomes a command in the Telegram Bot. At the Telegram Client (Smartphone/Web/PC) this command can be called directly by the user. The call then causes the connection containing the trigger to be executed and the data transfers contained in it to take place.

The created triggers are listed to the user after calling the “/help” command:

Triggers of the OPC Router connections are displayed as commands in the Telegram Client and can be called directly from here.


The Telegram Messenger Plug-in does not have its own browsing.

Telegram Bot Plug-in application examples

Alarm system with Telegram

Together with the SQL Server plug-in of the OPC router (MS SQL, MySQL, Orcale, Access, ODBC), effective alarm systems with smartphone connection can be easily configured. For this purpose, alarm messages, which are managed, generated and stored in the SQL database, are sent via the bot to the registered Telegram clients. The OPC Router can also offer the clients commands so that fault acknowledgements and comment functions can be designed. With the access of the Telegram plug-in to the SQL data, the Telegram client can also be offered queries, for example for access to detailed data on alarm messages.

Telegram Bot
MS SQL Server
Smart Factory

Create Telegram Bot without programming

Creating a Telegram Bot is done with just a few clicks. Filling the bot with life is possible by programming in C#, Python and other languages, but it’s a lot of work. With the OPC Router Telegram Bot Plug-in it is possible without complex programming and is realized by simple graphic configuration. Messages from other plug-ins (SAP, OPC, MQTT, etc.) can simply be sent to the bot and are then sent to the registered clients. Commands can be created by simply creating triggers in the OPC Router project. Create your telegram bot for your system in a few minutes.

Video: Creating Telegram Bots

More Plug-ins

How do Transfer Objects, Trigger and Browsing work?

The connections the OPC Router establishes between systems can be addressed with the core functions of the OPC Router. Depending on the nature of the respective plug-in, functions vary, which is due to the functional scope of the respective connceted systems.

Transfer Objects

Sources and Destinations

Transfer objects are the sources and destinations inside the OPC Router. They contain data fields with read and write functions. Depending on the respective interconnected system, the possible configuration scope of sources and destinations may vary.

Homegeinity on the Outside – Heterogeinity on the Inside

Inside the OPC Router configuration, the transfer object abstracts the respective system of any connected system into a simple data input and data output block.

Trigger Functions

Prompting Transfers

Triggers determine execution time of data transfers. Various Triggers can be active, independent of source or destination. Various Triggers can be used in combination via AND/OR-connections. Triggers can also serve as data sources if the prompting event is coupled with receiving data.


Searching and Finding Data Fields

The configuration of sources and destintions is simplified. Differing browsing mechanisms are available, depending on the type of system and/or plug-in.

Reading out Structures

Even complex structures can be selected without requiring detailed knowledge about subsystems. The plug-ins presents structures of data sources according to the specification of the respected plug-in.