Scripting Assistance.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Dazman
    Automated Home Lurker
    • Feb 2006
    • 8

    Scripting Assistance.

    Hi Everyone,

    I having ago a writing my own scripts within homeseer, I'm doing quite well but have hit a small problem.
    The problem first appeared simple but my solutions have proved fruitless.
    I have installed a x10 key fob next to my front door when leaving the house I turn off an x10 code and it runs a script.
    This script tells homeseer I'm going out, so please activate security mode and enable some previously disabled events.
    These re-enabled events include extra timed light functions and turning a radio on and off etc.
    When I re-enter the house I turn the x10 code on and it turns off security mode and disables events.
    This all works great except sometimes the RF key fob doesn’t transmit the x10 code, probably because I stand too close to the key fob and attenuate the RF.

    So what I want to do is toggle the lamp next to the front door from within the script.
    This will act as a tell tale to show the script has run.
    This lamp is OFF during the day but ON at sun down.
    So I want the script to perform the following.

    If lamp is ON: Turn OFF, wait 1sec Turn ON
    If lamp is OFF: Turn ON, wait 1 sec Turn OFF

    I'm sure there is a simple solution, but I can't see the wood for the trees.

    Thanks

    Darren.
  • jon00
    Automated Home Sr Member
    • Jan 2004
    • 64

    #2
    Re: Scripting Assistance.

    Try this within your script.

    In this example "A1" would be your lamp

    For the daytime use i.e. lamp is off:

    Status=hs.devicestatus("A1")
    If Status=3 then
    hs.execX10 "A1","on"
    hs.waitsecs 1
    hs.execX10 "A1","off"
    end if

    For night time use i.e. lamp is on:

    Status=hs.devicestatus("A1")
    If Status=2 then
    hs.execX10 "A1","off"
    hs.waitsecs 1
    hs.execX10 "A1","on"
    end if
    Jon

    www.jon00.me.uk

    Comment

    • Dazman
      Automated Home Lurker
      • Feb 2006
      • 8

      #3
      Re: Scripting Assistance.

      Hi Jon,

      That work perfectly !
      Thank you very much for your help.
      It's much appreciated.

      Kind Regards

      Darren.

      Comment

      Working...
      X