• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Tobias
    3. Topics

    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
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by Tobias

    • T

      Alarms in meta data

      User help
      • • • Tobias
      4
      0
      Votes
      4
      Posts
      1.4k
      Views

      phildunlapP

      Interesting request!

      Currently, it is not possible to define an event handler for all events at one level or above, but that sounds like it would be the ideal way to address this. Currently, I would find myself either using a mailing list or user with a "send alarm emails" setting of "Urgent" and either having that be enough (you can send SMS to many carriers over email, but you would not control the message text) or having a script check if new alarms have occurred in the last X minutes. You could also add an event handler to every event type, that's an option.

      So far as the script goes, add the output point into the context, we'll run it on 0 0/5 * * * ? (every five minutes) and have something like....

      var activeEvents = com.serotonin.m2m2.Common.eventManager.getAllActive(); var maxLevel = 0; for( var k = 0; k < activeEvents.length; k+=1 ) { if( activeEvents[k].activeTimestamp < checkedUnto.time ) continue; if( activeEvents[k].alarmLevel > maxLevel ) maxLevel = activeEvents[k].alarmLevel; } if( maxLevel >= com.serotonin.m2m2.rt.event.AlarmLevels.URGENT ) output.set(1); else output.set(0); checkedUnto.set(!checkedUnto.value); //Ping-pong a context binary point to track time

      While this has the disadvantage of perhaps taking five minutes to alert of an alarm (you could speed up the cron patter though), it will have the advantage of also communicating the "server offline" state through failing to send an 'all is good' message on that five minute interval.

      If you want to go down the add-to-every event type route, I can help with the script you may need there. I think we probably will add the ability to define an event handler for all events at or above levels.

    • T

      How to get Time Data from Status on DGlux?

      User help
      • • • Tobias
      2
      0
      Votes
      2
      Posts
      1.3k
      Views

      phildunlapP

      Hi Tobias!

      It is certainly possible! Unfortunately, it's not as easy as a click and drag. There is not a direct way to query our statistics engine from DGLux for binary points.

      To do this, you'll want to use a Meta point in Mango to generate the information you're interested in. The meta point would look something like this, with p being the varName of the Door point in the script's context, running every minute (you can use the cron selector, or enter "0 * * * * ?":

      statistics = p.past(MINUTE); if(statistics.data[0].value == true) return statistics.data[0].proportion; if(statistics.data.length < 2) return 0; return statistics.data[1].proportion;

      Now we've got a data point giving us minute resolution (finer resolutions can be achieved in modifying the cron and call to past()) for the binary point. This data point will have the meaning "Proportion of minute open" and will be numeric.

      From DGLux, you can query this point to get the values into a table. Then, you can bind the value column to a binding column on another sheet. You'll want to use the Sum rollup. Create another binding column on that table bind the value column again, and use the Count rollup. Create a formula column and have its formula be "return countColumnName - sumColumnName". Now you can bind these columns (sum and the forumla columns, click and drag the column headers) to a pie chart to get minutes in each state. If you wanted it to be a proportion, you could make formula columns and divide by the count. If you do not see anything in the sheet with the binding columns after binding (first step on the second sheet), click the add row button.

      You can use the meta point's history generation function to get this to work even for your past point values.