• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Cooldown for mail or event

    User help
    3
    3
    1.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Xof1986X
      Xof1986
      last edited by Xof1986

      Good Afternoon,

      Is there a setting somewhere for cool downs on events or the email handler on an event?

      I have a boolean point that when false an event is triggered. If that point starts flapping between true and false I don't want 20 emails to be sent in the next 30 seconds about it.

      I know for high limit events you can set how long it needs to stay at a certain threshold however that is not the functionality I am looking for.

      This would be something like a reset limit except for it being a time count down instead of point value threshhold.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • CraigWebC
        CraigWeb
        last edited by

        I take it you are useing the point event detectors. Use the state detector and set a period in the duration.
        0_1525512500148_Screen Shot 2018-05-05 at 11.25.32.png

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by phildunlap

          Hi Xof1986,

          There are not any such options builtin currently. You could hack it up by calling model.clear(); in the script body of the email event handler to make the FTL file fail to process, and then the email will not be sent. I see an easy way to put this into the script, at least, so that one could detect if they didn't want to send an email for whatever reason they could return. Perhaps mitigating floods of emails with an explicit timer setting is common enough that it would warrant being outside the general purpose script body for simplicity.

          It sounds like a script like this would prevent email in the current release in your situation, but it will produce an error in the log file,

          var values = p.last(10);
          for(var k = values.length-1; k > 0; k+=1) { //> 0 to not include the current value
            if( values[k].booleanValue === false && p.time - values[k].time < 60000 ) {
              model.clear(); //Happened within 1 minute, cause an FTL error instead of another email
              return;
            }
          }
          

          It would be even easier if you set a point from the script body whenever you sent the email, then used that point's timestamp in the email handler to see if you should clear the model.

          I will ensure that a better way to prevent emails from sending using the script makes it into 3.4.2, since it should be very simple to do.

          Edit: I have added the ability for a script on an email handler to return CANCEL; or return UNCHANGED; to prevent sending the email. I suspect it will be a few weeks before we release 3.4.2 unless major bugs are discovered.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post