Announcement

Collapse
No announcement yet.

Export Timer Value to CSV every 24 hours

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

  • Export Timer Value to CSV every 24 hours

    I have never worked with scripts other than modifying my startup and shutdown scripts in very basic ways. I love HS3 but rarely get time to do more than the basic stuff.

    I am wondering if someone could point me in the right direction for writing a script(or using a plug-in) that could export the value of a timer to a CSV file at the end of each day. I have timer active whenever my HVAC is NOT idle. So, I'd like to get a daily value added to a .CSV so I can keep track of the run time.

    I appreciate any help you can give. Thanks

    Ryan

    Current Date/Time: 1/8/2017 10:45:21 PM
    HomeSeer Version: HS3 Standard Edition 3.0.0.297
    Operating System: Microsoft Windows 7 Home Premium - Work Station
    System Uptime: 1 Day 22 Hours 56 Minutes 8 Seconds
    IP Address: 192.168.1.149
    Number of Devices: 37
    Number of Events: 10
    Available Threads: 200

    Enabled Plug-Ins
    3.0.0.75: HSTouch Server
    3.0.1.66: Z-Wave
    Last edited by ryanbmsu; January 8th, 2017, 10:46 PM. Reason: Added system profile.

  • #2
    The script in this thread below is probably a good starting point. What data do you want to go into the CSV? Just the date and the value? Also take a look at this: https://board.homeseer.com/showthread.php?t=171875.

    Cheers
    Al
    HS 3.0.0.548: 1970 Devices 1149 Events
    Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

    Comment


    • #3
      Great. Thanks. I'll take a look at the script in that thread. After doing more searching I stumbled on the Jon00 Database Charting tool but I was not able to find it on his site. Not sure if I just missed it or if it had been removed.

      As you mentioned, I was just looking to export a timestamp and current timer value.

      Thanks again!

      Comment


      • #4
        Originally posted by ryanbmsu View Post
        Great. Thanks. I'll take a look at the script in that thread. After doing more searching I stumbled on the Jon00 Database Charting tool but I was not able to find it on his site. Not sure if I just missed it or if it had been removed.

        As you mentioned, I was just looking to export a timestamp and current timer value.

        Thanks again!
        You're welcome. You can access his site by just clicking on his signature banner in any of his posts.

        Cheers
        Al
        HS 3.0.0.548: 1970 Devices 1149 Events
        Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

        Comment


        • #5
          Originally posted by sparkman View Post
          You're welcome. You can access his site by just clicking on his signature banner in any of his posts.

          Cheers
          Al
          Yeah, I just couldn't locate the utility once in the site. I'll look around again. Lots of good stuff in there.

          Comment


          • #6
            Here's what I use to write HVAC times to a file each night:
            PHP Code:
            Sub Main(Parms as Object)

                    
            Dim sw as System.IO.StreamWriter
                    
            Try
                         
            sw = New System.IO.StreamWriter("/usr/local/HomeSeer/Data/HVACTimers.txt",True)
                         
            sw.WriteLine("BR HVAC" "," Now().ToString("MM-dd-yyyy") & "," hs.TimerValue("BR HVAC Runtime"))
            sw.WriteLine("LR HVAC" "," Now().ToString("MM-dd-yyyy") & "," hs.TimerValue("LR HVAC Runtime"))
                         
            sw.Flush()
                    Catch 
            ex as Exception
                         hs
            .writeLog("WriteHVACTimersToFile",ex.message)
                    Finally
                         If(
            Not sw Is Nothingthen sw.Close()
                    
            End Try

            End Sub 
            HS3Pro Running on a Raspberry Pi3
            64 Z-Wave Nodes, 168 Events, 280 Devices
            UPB modules via OMNI plugin/panel
            Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
            HSTouch Clients: 3 Android, 1 Joggler

            Comment

            Working...
            X