Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

« Vorherige Version anzeigen Version 5 Nächste Version anzeigen »



Description:

To setup LCOS based e-mail alerts you need to configure an SMTP mail server, as well as actions that trigger the respective behavior.

You will need to setup the following variables:

Mandatory variables:

  • SMTP_SERVER
  • SMTP_USER
  • SMTP_PASSWORT
  • MAIL_SENDER
  • MAIL_TO

Optional variables:

  • projektName
  • locationName

List of used variables:

VariableBeschreibung




Add-in codes:

Configure email:

/**
 * @param {Config} config
 * @param {Context} context
 * Do not edit this comment or parameter types. Required for code suggestions
*/
exports.main = function (config, context) {

  if (context.device.isGateway) {

    config.setScalarByOid("1.2.27.1", context.vars.SMTP_SERVER);
    config.setScalarByOid("1.2.27.2", "587");
    config.setScalarByOid("1.2.27.12", "2");
    config.setScalarByOid("1.2.27.13", "3");
    config.setScalarByOid("1.2.27.3", "");
    config.setScalarByOid("1.2.27.4", "110");
    config.setScalarByOid("1.2.27.11", "");
    config.setScalarByOid("1.2.27.5", context.vars.SMTP_USER);
    config.setScalarByOid("1.2.27.6", context.vars.SMTP_PASSWORT);
    config.setScalarByOid("1.2.27.7", context.vars.MAIL_SENDER);
    config.setScalarByOid("1.2.27.8", "30");
    config.setScalarByOid("1.2.27.9", "72");
    config.setScalarByOid("1.2.27.10", "100");
  }
};

/*
   [  1] SMTP-Server         : 64 chars from  #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz`
   [  2] SMTP-Port           : 5 chars from 1234567890
   [ 12] SMTP-use-TLS        : Yes (1), No (0), Preferred (2), Required (3)
   [ 13] SMTP-Authentication : None (0), Plain-Text-Preferred (1), Encrypted (2), Preferred-Encrypted (3)
   [  3] POP3-Server         : 64 chars from  #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz`
   [  4] POP3-Port           : 5 chars from 1234567890
   [ 11] Loopback-Addr.      : 16 chars from ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789
   [  5] User-Name           : 63 chars from  #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz`
   [  6] Password            : 31 chars from  #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz`
   [  7] E-Mail-Sender       : 63 chars from  #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz`
   [  8] Send-Again-(min.)   : 3 chars from 1234567890
   [  9] Hold-Time-(hrs.)    : 3 chars from 1234567890
   [ 10] Buffers             : 3 chars from 1234567890
*/

Add-in as JSON file:

email.json





  • Keine Stichwörter