Sending an alarm notification via Telegram

Introduction

Hello and welcome to a new guide on how to best use Movicon.NExT™.

In this technote we will show you how to configure the Alarm Dispatcher to send notifications by Telegram.

Example

We will use an example to give you a better idea of how to do this.

How to create the tag

Having already started up the software and loaded the project:

How to create and associate the alarm

We shall now create an alarm in this way:

Now that we have created and configured the tag and alarm, we can go ahead and assign the two elements:

How to create the Screen

Now, we will need to create a screen:

Once the screen has been created, you can then change the project's properties by inserting the screen as the project's Main screen which will show when the project starts up. To do this:

Once you have finished configuring the project startup page, click on the Save All icon located on the toolbar at the top to save the project.

Now, open the Main screen and click on the Toolbox tab on the far right of the editor window to open the Toolbox library provided by Movicon.NExT.
Go to the Toggle Switches folder and drag a Vertical Switch onto the screen. Drag the boolTest Tag onto the object to associate it.

How to create the Telegram bot

To use the plugin correctly, you will need to create a Telegram bot to receive messages sent by the Alarm Dispatcher.
How to create a Telegram bot:

Chat ID Recovery

The Chat ID can be recovered in this way:

How to create a user within the project

To use the Alarm Dispatcher correctly, you will need to create a user within the project.
This user will be the one who receives notifications from the Alarm Dispatcher.
To do this:

How to configure the Alarm Dispatcher’s Telegram plugin

We shall now configure the Alarm Dispatcher:

Now that the Telegram plugin has been included on the list, we can now go ahead and configure it:

Next, go to the Notifications tab to configure the message to be sent:

Save the project by clicking on the Save All button on the Movicon.NExT Editor’s toolbar at the top.

Runtime Test

Click the Start Runtime icon to test to see if everything works in runtime.
Once the application has started up and the screen has opened, click on the switch to change the boolTest value from 0 to 1.
In this condition, the alarm associated to the tag will activate and the Alarm Dispatcher will send a Telegram to the user to notify them that the alarm is active.