Announcement

Collapse
No announcement yet.

Timer - how to calculate percent of total day running

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Timer - how to calculate percent of total day running

    I have a timer that is started and stopped depending on the number of watts my deep freezer is drawing. At the end of the day, I would like to know what percent of the day was the freezer running. I need to display the result in a HSTouch application. How would I do that calculation? I do have EasyTrigger.

    Thanks!

    #2
    If you restart the timer at midnight, then stop and resume during the day, I would expect that at the end of the day the timer would reflect the total run time for the freezer.

    Are you asking how to express the time on the timer as a fraction of 24 hours?
    To do that, I think you should be able to divide the value of the timer device by 86400, the number of seconds in a day.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Is there some immediate script that would do the calculation and then store the result in a virtual device? That’s where I’m stuck. Can easytrigger do that?


      Sent from my iPhone using Tapatalk

      Comment


        #4
        I haven't used the capability, but ET can be used to set a device value to an expression. In this case the expression would be the (value of the timer) / 86400. It's described in the ET user guide.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment


          #5
          Solved: First created a virtual device to store the percentage used. Using EasyTrigger, I set the new virtual device using Set Device To Expression. The expression is $$DVR:1070: / 86400 * 100 where device 1070 is the ref of the device that mirrors the timer's value. The *100 is just to get the formatting correct for a percentage.

          Thanks for the inspiration Uncle Michael

          Comment


            #6
            Excellent.
            Mike____________________________________________________________ __________________
            HS3 Pro Edition 3.0.0.548, NUC i3

            HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

            Comment

            Working...
            X