• 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

    Need to Display Hour(24) in dashboard, New and not sure where to start.

    Mango Automation general Discussion
    2
    4
    1.7k
    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.
    • L
      LarryE
      last edited by

      Need to Display Hour(24) in dashboard, New and not sure where to start.

      1 Reply Last reply Reply Quote 0
      • jeremyhJ
        jeremyh
        last edited by

        You can create a meta point in Mango, set to alphanumeric, with the following script:

        t=new Date();
        h=t.getHours();
        m=t.getMinutes();
        s=t.getSeconds();
        if(s<=9) s="0"+s;
        if(m<=9) m="0"+m;
        if(h<=9) h="0"+h;
        return h+":"+m+":"+s;
        

        It will return the time in 24H format (including seconds, so adjust as needed).

        You can then place your Meta Point onto your DGLux dashboard by binding it to an indicator. To do this just insert a text indicator and then drag the meta point from the sidebar onto the indicator.

        1 Reply Last reply Reply Quote 0
        • L
          LarryE
          last edited by

          @jeremyh said:

          t=new Date();
          h=t.getHours();
          m=t.getMinutes();
          s=t.getSeconds();
          if(s<=9) s="0"+s;
          if(m<=9) m="0"+m;
          if(h<=9) h="0"+h;
          return h+":"+m+":"+s;

          Jeremyh Thanks so much for the quick reply, It works great and will allow my shift changes to be at system time and in sync.

          1 Reply Last reply Reply Quote 0
          • jeremyhJ
            jeremyh
            last edited by

            No problem.

            I've just realised that crontab will not allow for updates faster than one minute, so you might like to just make it HH:MM and forget about the seconds.

            You might also like to set the point properties to 'do not log' with a cache size of 1 as there is likely no benefit to storing these values on disk or more than one record in memory.

            Cheers

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