Announcement

Collapse
No announcement yet.

Unexpected script behavior

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

    Unexpected script behavior

    I'm writing a script to save the high and low temerature swings of a temp device. I read the old values right out of a virtual device campare it to the new temperature make any changes then write the whole string back to the virtual device. the high temp seems to be working but the low temp is allways equal to nowtemp and I dont know why. Anybody see something wrong?

    sub Main()

    dim nowtemp, recenthigh, recentlow, high, low
    dim mystring, myarray

    nowtemp = hs.devicevalue ("#21")
    mystring = hs.devicestring ("s10")
    myarray = Split(mystring)


    recenthigh = myarray(6)
    recentlow = myarray(11)
    high = myarray(13)
    low = myarray(15)

    if recenthigh < nowtemp then recenthigh = nowtemp


    if recentlow > nowtemp then recentlow = nowtemp


    if high < nowtemp then high = nowtemp


    if low > nowtemp then low = nowtemp


    hs.SetDeviceString "s10","Current "& nowtemp &" " & "<br> Since Midnight High " & recenthigh &" " &"<br> Since Midnight Low "& recentlow &" " &"<br>High " & high &" " & "<br>Low " & low ,True

    end sub
    https://forums.homeseer.com/forum/de...plifier-plugin

    #2
    Hack up any hairballs lately? (I'm an old Bloom County fan).

    OOPS, see next post.

    The hairball comment still stands.


    ~Bill

    Comment


      #3
      Or maybe that wasn't it, use this as an example:


      low = CDbl(myarray(15))

      I think VBS considers them a string instead of a value unless you do this.



      ~Bill

      Comment


        #4
        After sleeping on it I thought that might be what was happening but I wasnt....ACCKKK!!! cat spittle...(damn hairballs)...sure how to fix it.

        That seemed to fix it, now i'll be able to make it to band practice with the boingers tonight!
        https://forums.homeseer.com/forum/de...plifier-plugin

        Comment

        Working...
        X