Announcement

Collapse
No announcement yet.

Temp Logging Script?

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

    Temp Logging Script?

    Can anyone help me with a script to log temps from my serial RCS dual zone tstat? I'd like to have it log Upstairs, Downstairs, and the Ouside temps to 3 seperate files, adding a new file to the files each time the script is run.

    Thanks!

    -Mike

    #2
    I am doing something similar using Jon00's graphing monitor script. Its very easy to set up and lets you graph the values of any device over a period of time

    Jon

    Comment


      #3
      msbreton and nojstevens - I'm about to start working on a similar application/script to the one you mentioned. Can you share your code?

      Thanks.

      Comment


        #4
        No problem. Pretty simple, and I'm sure it could be written a little better, but it's working for me.

        sub main()
        dim rcs
        set rcs=hs.plugin("RCS Serial Thermostats")
        dim downstairs
        dim upstairs
        dim outside
        Const ForAppending = 8

        downstairs=rcs.gettemp(1,1)
        upstairs=rcs.gettemp(1,2)
        outside=rcs.gettemp(1,0)
        'msgbox cstr(downstairs) & " " & cstr(upstairs) & " " & cstr(outside)

        strFile = "C:\emdh\logs\DownstairsTemperature.txt"
        set objFSO = CreateObject("Scripting.FileSystemObject")
        set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
        objFile.WriteLine(now & " -- " & downstairs)
        objFile.Close

        strFile = "C:\emdh\logs\UpstairsTemperature.txt"
        set objFSO = CreateObject("Scripting.FileSystemObject")
        set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
        objFile.WriteLine(now & " -- " & upstairs)
        objFile.Close

        strFile = "C:\emdh\logs\OutsideTemperature.txt"
        set objFSO = CreateObject("Scripting.FileSystemObject")
        set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
        objFile.WriteLine(now & " -- " & outside)
        objFile.Close

        end sub

        Comment


          #5
          Thanks! I'll check this out and see if it helps anything I'm working on. If I add to or modify anything for my application, I'll share it with you in case you find some value out of it.

          Comment

          Working...
          X