Announcement

Collapse
No announcement yet.

Script issue from v1 to v2

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

  • Script issue from v1 to v2

    Originally posted in the script library forum where it can not be answered, so moved it here .





    <TABLE class=tborder id=post677419 cellSpacing=1 cellPadding=3 width="100%" align=center border=0><TBODY><TR><TD class=thead>#1


    <!-- status icon and date --> Today, 06:08 AM <!-- / status icon and date -->


    </TD></TR><TR><TD class=alt2 style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"><!-- user info --><TABLE cellSpacing=3 cellPadding=0 width="100%" border=0><TBODY><TR><TD noWrap>jerrybeck <SCRIPT type=text/javascript> vbmenu_register("postmenu_677419", true); </SCRIPT>


    Viewer


    </TD><TD width="100%"></TD><TD vAlign=top noWrap>Join Date: Nov 2005


    Posts: 1




    </TD></TR></TBODY></TABLE><!-- / user info --></TD></TR><TR><TD class=alt1><!-- message, attachments, sig --><!-- icon and title --> Script issue from v1 to v2


    <HR style="COLOR: #d1d1e1" SIZE=1><!-- / icon and title --><!-- message -->Hello, I run an extensive Christmas Light Show with 40,000 lights and I use HS to controll all of them, with stop lights and radio stations... One of the features I like is the ability to count car's each night, at least that is what I use to be able to do until version 2... Can someone help debug my old script for me please... I am up to 3 hours trying different tweeks and the help is very limited on the HS2 platform... This is what I do to creat and count cars, I use 3 counters all alike, and then I want to display the number as Q1, Q2 & Q3 and make a note in the log file... I would really appreciate some help, we open the show on Thanksgiving night...



    Startup.txt file is:
    dim counter1
    dim counter2
    dim counter3

    Counter1.txt file is:
    sub main()
    counter1=hs.getvar("Counter1")
    Counter1=Counter1 + 1
    hs.SaveVar"Counter1",Counter1
    hs.setdevicestring "Q1",Counter1
    hs.getvar"counter1"
    hs.writelog"Counter1",(Counter1)
    end sub


    </TD></TR></TBODY></TABLE>
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"
    HomeSeer 3 V 3.0.0.318 with ALEXA (AKA Amazon Echo)
    BL Radar V2.0.217; BLRF V2.0.85.0; HS Touch V3.0.0.1034 X10 V3.0.0.42; PHLocation V3.0.0.38; Zwave V3.0.1.110; X10 V3.0.0.42
    BLBackup V2.0.39;ImperiHome3.0.0.20 All on Windows XP Pro

  • #2
    Not 100% sure what you are trying to do, but is it's just to keep count of cars try this.
    Code:
    Sub main()
     
    dim x
    x=hs.DeviceValue ("Q1")
    x=x+1
    hs.SetDeviceValue "Q1"(X)
    hs.setdevicestring "Q1",(X)
    hs.writelog"Counter1",(X)
     
    end sub
    Hope this helps, may have some sintax wrong as to whether (X) should have inverted commas.
    sigpic
    A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"
    HomeSeer 3 V 3.0.0.318 with ALEXA (AKA Amazon Echo)
    BL Radar V2.0.217; BLRF V2.0.85.0; HS Touch V3.0.0.1034 X10 V3.0.0.42; PHLocation V3.0.0.38; Zwave V3.0.1.110; X10 V3.0.0.42
    BLBackup V2.0.39;ImperiHome3.0.0.20 All on Windows XP Pro

    Comment


    • #3
      Thank you, car counters work

      Thank you for your assistance, the script worked after one minor correction to adding a comma in line 6 between the "(...

      Thank you again...

      JB

      Comment

      Working...
      X