Results 1 to 3 of 3

Thread: Scripting Assistance.

  1. #1
    Automated Home Lurker
    Join Date
    Feb 2006
    Location
    Portsmouth, UK
    Posts
    8

    Default 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.

  2. #2
    Automated Home Sr Member jon00's Avatar
    Join Date
    Jan 2004
    Location
    Bromley, UK
    Posts
    64

    Default 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

  3. #3
    Automated Home Lurker
    Join Date
    Feb 2006
    Location
    Portsmouth, UK
    Posts
    8

    Default Re: Scripting Assistance.

    Hi Jon,

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

    Kind Regards

    Darren.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •