Announcement

Collapse
No announcement yet.

Tracking UpTime

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tracking UpTime

    I've have set up my kids PlayStation 3 and WII game systems as DooNetwork devices so that HS is aware of their current status (on/off). I have the timers display turned on, but what I'd really like to to have a device or variable that tracks the total on or off time for the day/week/month so I can set limits on play time.

    Has anyone figured out how this is best accomplished?
    Regards, Bob

    #2
    If you have Ultralog, you could develop a database query that could calculate the total uptime for some specified time. Reading the HomeSeer log file(s) would be a little trickier.
    Jim Doolittle

    My Twitter
    My Hardware & Software

    Comment


      #3
      Jim,

      Thanks for the response. I was hoping for something more simple given that there is already a timer function being used by Homeseer and DooNetwork.
      Regards, Bob

      Comment


        #4
        There are timers but these timers are for how long device is ON or OFF and reset when device state changes. I think you are asking about cumulative ON/OFF times.

        HomeSeer has had the ability to use a game timer. Not sure if it is still supported in later HS 2.2 builds or in HS 2.3 but it used a X10 device that required a passcode to be entered for a given user and would shut game off if allotted time expired. Basically, it was like having the game console plugged into an appliance module that would shut off device.

        This may not be to just abruptly shut off power to some gaming consoles plus kids could figure out that they simply need to plug game console into wall and bypass the timer.

        Another options besides database queries is to create a custom script that runs when the device status changes. You could use a DooNetwork status change trigger to run the script. The script would store the device's accumulated ON time in another device's value field.
        Jim Doolittle

        My Twitter
        My Hardware & Software

        Comment


          #5
          Jim,

          Thanks again for the reply. After some thought, I think the best approach would be to create a seperate device to hold the accumlated timer information.

          When the actual device (ie., television) is first turned on it would display the current status (on) and it's timer like you currently do in DooMotion and DooNetwork - "On (1:00)".

          When the television is turned off, the device would display it's current status together with it's off time and acculated on time - somethins like this: "Off (0:25) - Accumulated On Time (1:15)"

          When turned on again, the timer would be set by script to the last accumulated on time (1:15 in the prior example) and continue counting up.

          All of this is, of course, very similar to what you already do in DooMotion and DooNetwork with the exception that your plugins reset the timers to 0:00 upon device status changes. I see that their is the ability to set the timer with scripts, but I don't see how to display the timer information within the device string like you do with DooMotion and DooNetwork. I this something that can easily be done for a device?
          Regards, Bob

          Comment


            #6
            This should not be too difficult but it will require you to have documentation for HS and DooNetwork scripting handy.

            You need to create a virtual device for your gaming console (e.g., "Gaming Console Timer") and an event that triggers when the Gaming Console goes online or offline and runs a script. You will need to do something like the following:
            • Create virtual device.
            • Create script.
              • Create procedure that initialize/resets the timer device value to 0. Device value will be number of minutes that console has been online.
              • Create procedure for updating device value and displaying device string.
                • If currently offline, use DooNetwork script commands for determining how long console had been on and add the number of minutes to the current devicevalue. Make sure that you leave device last change the same.
                • Display device string using logic that converts elapsed minutes to a hh:mm and put some parentheses around that string.
            • Create event that runs script when device goes online or offline.
            • Create event that performs action to shut console down when timer device value exceeds certain value in a specified amount of time using DateDiff of last change time (which should be when timer was reset) versus Now.
            I could provide a DooNetwork option to have timer display elapsed runtime rather than simply online or offline time. If so, you could create another DooNetwork device for game console timer. Note that this still leaves a lot of work for you to build logic and actions for dealing with max runtime being exceeded.

            If you have time to try a new build, I can add the new feature and you can do some console on/off checks to validate that it works.
            Jim Doolittle

            My Twitter
            My Hardware & Software

            Comment


              #7
              Originally posted by Jim Doolittle View Post

              If you have time to try a new build, I can add the new feature and you can do some console on/off checks to validate that it works.
              Jim,

              I've got the time to test if you can help with this. May be useful for other also.
              Regards, Bob

              Comment


                #8
                OK. Taking a break from the computer tonight (other than checking posts in five different forums - one HA and four fitness ). Should have time to whip out a new build tomorrow.
                Jim Doolittle

                My Twitter
                My Hardware & Software

                Comment

                Working...
                X