Announcement

Collapse
No announcement yet.

No timers? Variables? How do I....

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

    No timers? Variables? How do I....

    I am trying to recreate some of my ADI CMAX routines in HS.

    If X10 A1=on received ' motion sensor sends A1 on
    then variable1 = 1 'yes motion
    then timer1 = 1 'timer activated ;resets to 1 if new motion sensed

    If timer1 becomes >=300 ' if timer gets to 300 with no new motion
    then variable1 = 0 ' no motion
    then timer1 = 0 'reset timer to 0 (stops it)

    If variable1 becomes=1
    turn my lamp on

    If variable1 becomes-0
    turn my lamp off

    How in the world do I do something simple like this in homeseer? I don't see timers. I assume I can create virtual devices for "variables". And I don't see a "becomes =" trigger.

    Thanks.

    #2
    Robert1,
    This is what events are for.
    - Set up an event to turn the light on. (My Light On)
    - Trigger by motion sensor on code. (Like A1 on)

    - Set up another to turn the light off. (My Light Off)
    - manual trigger

    You will need a script that each time the motion sensors sees moton it "recreates" the off event. This recreation is done by first removing the last delayed event and then creating a new delayed event. This way you will not get a bunch of events.

    I would use something like this each time the motion sensors since motion:

    sub main()
    hs.RemoveDelayedEvent "","MyLight Off"
    hs.delaytrigger 300,"MyLight Off"
    end sub
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Rupp, thanks so much. That works perfectly!

      Comment

      Working...
      X