Announcement

Collapse
No announcement yet.

Is there a trigger on how long HS has been up?

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

    Is there a trigger on how long HS has been up?

    Is there a script command to the effect "IF HS.hasbeen running for x days then"? Or is it possible to use an event condituion?
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

    #2
    There is a scripting function of hs.SystemUptime however it will return a string of 'days hh:mm:ss' which may a slight pain to script with - depends on what you want to trigger on - hours or days (you'd have to read from the right to the first space to get days). Alternatively maybe Jon00's uptime script with a dummy device that starts when HS loads maybe easier as you could then get the data from the ini file with a simpler command...

    Comment


      #3
      Hmm, HS.Systemuptime sound clumbsy, but I have had a thought.

      Create a virtual device and have a script that runs at midnight and incremets the devices value by one every day. In the startup script have it reset to zero.

      It could then be used for a multitude of things. It could also change the string value of the device to the number of days.

      Do you think it would work?
      sigpic
      A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

      Comment


        #4
        should work but it won't be an exact figure of how long HS has been on, if you start HS at 23:00hrs for example then at midnight if you increment the value it will then show HS has been online for a day when in fact its only been on for an hour...

        Comment


          #5
          Originally posted by mrhappy View Post
          should work but it won't be an exact figure of how long HS has been on, if you start HS at 23:00hrs for example then at midnight if you increment the value it will then show HS has been online for a day when in fact its only been on for an hour...
          Yes appreciate that, however, for my purpose which is to gracefully restart HS after so many days it would be sufficient.

          My other thought is Jon00's uptine script.
          sigpic
          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

          Comment


            #6
            OK created the device, wrote the script modified the startup script and it appears to work perfectly.

            I have also modified my HST screen to show how many days HS has been up and how meny days till it will reboot with the facility to reset the day up to zero which extends the uptime.

            I feel quite pleased with myself.
            sigpic
            A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"

            Comment

            Working...
            X