Announcement

Collapse
No announcement yet.

Store High and Low Temperature [Discussion]

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

    Store High and Low Temperature [Discussion]

    Post any problems, comments or suggestions for the script in this thread.

    The script is available HERE
    Visit My Home Seer Site at:
    www.JohnWPB.com
    Created with LCARS

    #2
    Startup Problem

    John,

    Like the idea of the script but seem to be having a small problem getting it up and running:

    12/23/2004 7:24:41 AM~!~Error~!~Script error in file: StoreHighLowTemperatures.txt: 13:Type mismatch: 'hs.setDeviceValue' in line 259

    I've changed the commenting to "devicestring" as suggested with no improvement. BTW I'm using your XMLweather to get data and its working fine.

    Comment


      #3
      John,

      Don't know where my brain was this AM. The message I'm seeing in the log now is"

      12/23/2004 4:48:52 PM~!~Error~!~Script error in file: StoreHighLowTemperatures.txt: 13:Type mismatch: 'currenttemp' in line 215

      Also, in case I was not clear before I'm triggering off the XLMweather script you wrote to get the temp. The XMLWeather script appears to be working as it should... it's showing data in the device. and it has changed throughout the day.

      Comment


        #4
        John,

        At the end of your script recordlowtemp has to be recordhightemp.
        Now you have high and low the same value.

        Like your script!

        Peter
        Peter

        http://ohh.pcgsm.nl

        Comment


          #5
          Peterpc wrote:
          At the end of your script recordlowtemp has to be recordhightemp.
          Now you have high and low the same value.
          Peter, I am not quite sure what you mean.... here are the last few lines of code from the script. The "recordlowtemp" is stored, and then the device code is incremented by one and then the "recordhightemp: is then stored in that device string.

          Unless I am missing someting, I think I have this done correctly. If these are not the lines of code you are talking about, please let me know so I can correct it. I had Jon00 test this script for a couple weeks before I posted it, just to make sure it was working as I intended.

          Code:
          storecode = ""
           storecode = Housecode & int(devcode)
           hs.setDeviceString storecode,recordlowtemp
            
            storecode = ""
            storecode = Housecode & int(devcode+1)
            hs.setDeviceString storecode,recordhightemp
          In this case, if the housecode was "A", and devcode was "1" then storecode would be "A1"

          then storecode is reset to nothing to then move on to the record hightemp.

          Now the Housecode is still "A", and we add 1 to the devcode, and make the storecode "A2".

          This would make A1 the device to store the low temp. and a2 the device to store the high temp.

          This is at least how it was intended to be done I do not see an error from my point of view, but it is always better to have a second pair of eyes to catch an unforseen bug.
          Visit My Home Seer Site at:
          www.JohnWPB.com
          Created with LCARS

          Comment


            #6
            What you show is correct, but the file you published the end is:


            ' The following lines will pull the current Record High & Low from the text file, and keep the
            ' HS Devices up to date, even if for some reason the devices lose the values.
            storecode = ""
            storecode = Housecode & int(devcode)
            hs.setDeviceString storecode,recordlowtemp
            hs.setDeviceValue storecode,recordlowtemp
            storecode = ""
            storecode = Housecode & int(devcode+1)
            hs.setDeviceString storecode,recordlowtemp
            hs.setDeviceValue storecode,recordlowtemp
            end sub

            Peter
            Peter

            http://ohh.pcgsm.nl

            Comment


              #7
              I have a temperature sensor which is captured as a variable in one of my devices. I would like to know hi/lo on a daily basis. In the evening, I'd like to know the high temp for that day; and in the morning, the low temp overnight.

              Is this script a good way to do that? If so, would I create another event to delete the text file every midnight? Or is there a better way?

              And I assume I would trigger the script at each change in my device variable?

              Mark
              Mark

              Comment


                #8
                John,

                I changed your script to save the month records in a separate file and make new records every month.
                Hope you like it.

                Peter
                Attached Files
                Peter

                http://ohh.pcgsm.nl

                Comment


                  #9
                  Good Job; The only issue I have is that I can not understand German.

                  Comment


                    #10
                    dbrunner10,
                    your avatar is a Dutch bear brand, and so is the ''German'', but this is the ranslation:

                    if speak = "true" then hs.speak "De laagste temperatuur van de maand is nu " & currenttemps & " graden. "
                    hs.WriteLog "high_low","De laagste temperatuur van de maand is nu " & currenttemp & " graden. "
                    was original

                    if speak = "true" then hs.speak "A New Record Low of " & currenttemp & " degrees has been set. "

                    and

                    if speak = "true" then hs.speak "De hoogste temperatuur van de maand is nu " & currenttemps & " graden. "
                    hs.WriteLog "high_low","De hoogste temperatuur van de maand is nu " & currenttemp & " graden. "

                    was original

                    if speak = "true" then hs.speak "A New record High of " & currenttemp & " degrees has been set. "

                    and replace in ''currenttemps = " min " & int(currenttemp)''
                    min with minus and all is english!

                    Peter
                    Peter

                    http://ohh.pcgsm.nl

                    Comment

                    Working...
                    X