Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General information

Axxon One allows you to send text notifications to Telegram chat when any event occurs from the objects registered in the Axxon One objects object tree. Once configured, the notification sending is initiated by the Axxon One macroa macro.

Before configuring notifications sending from Axxon One to Telegram, create a bot and a group chat with this bot in Telegram. For the distribution package and manuals on working with Telegram, see the developer's official website telegram.org.

Info
titleNote

For the correct operation of Telegram bot and notification sending, the user who created the bot must have @username specified in Telegram.

Configuring an action

To configure notification sending in via Telegram bot, do the following:

  1. Go to the Programming tab.
  2. In the Event rules or Cycle rules list, click Create... (see Configuring macros).
  3. Select a start condition that triggers a macro (see Configuring start conditions).
  4. Click the Image Added button below start conditions.
  5. From the drop-down list, select the "General: Execute web - query" action.
    Image Added
  6. In the Authentication method parameter, select the Select the authentication method:
    1. Basic
    or Digest
    1. (
    1
    1. default)
    . By default, the Basic authentication method is selected.

    Image Removed

    Select
    1. ;
    2. Digest.
  7. In the Command parameter, select the query type:
    1. POST (
    2). Four types are supported: POST, GET, PUT, DELETE. By default, the POST query type is selected.
    1. defaul);
    2. GET;
    3. PUT;
    4. DELETE.
  8. In the HTTP/HTTPS parameter, select the server protocol:Select the server protocol: HTTP or HTTPS (3).
    1. HTTP;
    2. HTTPS.
      Note
      titleAttention!
    1. For the correct notifications sending, you must select the HTTPS protocol.

  9. Enter In the IP address of the server (4). The parameter, enter the IP address of the Telegram server is apiserver—api.telegram.org.Enter the port of the server (5). The
  10. In the Port parameter, enter the port of the Telegram server is server—443. 
  11. In the Path parameter, enter Enter the path of the query (6). The path of the query should must look like this: /bot<BOTToken>/sendMessage?chat_id=<СhatID>&&text=<Text>, where <BOTToken> is an ID of the bot in Telegram;
    Info
    titleNote

    The ID is ID is provided when you create the bot

    <СhatID> is an the ID of the chat;

    Info
    titleNote

    To find out learn the ID of the chat, add the @RawDataBot bot to the chat. After adding, the bot will send a message to the chat that will contain the result of the execution of the getUpdates function. Find ChatId in the message. Then remove the @RawDataBot bot from the chat.

    <Text> is a notification text. You can enter the set of US-ASCII characters (Latin characters and digits) in the notification text. For the notification text to display correctly with other characters and punctuation marks, you need to encode them. The encoding is described in the RFC 3986 standard and called URL-encoding, URLencoded, or percent-encoding. For example, a space character is encoded as %20..

  12. Click the Apply Image Added button.

Configuration of the General: Execute web query action is complete.

When  you use the When using the "General: Execute web - query" action, all fields for sending a web - query to the specified server can be filled in (see Executing a Execute web query). However, the Username, Password and Query fields are not required for sending a notification via Telegram bot.