• 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

    Meta data script for KWH

    Scripting general Discussion
    3
    4
    2.8k
    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.
    • R
      ray
      last edited by

      I want to setup the 15 minutes profile for KWH in meta data. I write the script "return p78.value - p78.ago(MINUTE,15) ;" It works but it also end up some issues.

      1. The first value of the meta data equals to the value of the KWH.
      2. When there are power outage or other problem to make the KWH data not available in a period of time. When the KWH resumes to have data. The first resumed meta value is not correct. In my case, I got an interruption of the KWH so I missed some data in a few days, the last value read of the KWH is 317.58. After the interruption, the data read for the calculation is 389.66. The meta data becomes 72.08 (= 389.66 - 317.58) but 317.58 is few days ago. It mislead that there is a jump in the 15 minute.

      Another issue is the "logging type" of the meta data. If I use "when point value changes", whenever the result of the calculation is the same value as the last value. The value does not record in the database. It looks like there is an interruption in that period. If I put "All data", the data missing in the interruption becomes "0". It means no consumption in that period of time. I just want to have "null" or no data means interruption and "0" means no change of the KWH.

      I try another script to make the first value becomes 0

      if (p78.ago(MINUTE,15) != 0)
      return p78.value - p78.ago(MINUTE,15) ;
      else
      return 0 ;

      I will be grateful if you can have a script to solve my issues.

      Thanks ! :)

      1 Reply Last reply Reply Quote 0
      • M
        mlohbihler
        last edited by

        You could try just using a logging type of 15 minute interval, with an accumulator of average.

        Best regards,
        Matthew

        1 Reply Last reply Reply Quote 0
        • hussamH
          hussam
          last edited by

          this actually one problem i also meet? what 's your solve now?

          Here is some suggest:
          you script below is not right, because .ago will get the least value before 15 miniute,but not get the value at before 15 miniute.
          if (p78.ago(MINUTE,15) != 0)
          return p78.value - p78.ago(MINUTE,15) ;
          else
          return 0 ;

          the best way is official provide on function to get the exactly time values.

          the second way you can try like this,
          if ((p78.ago(MINUTE,15) -p78.ago((MINUTE,16))==0),this means you point is interruption

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