We have moved at community.getvera.com

Author Topic: Window sensor trigger  (Read 1149 times)

Offline Javierrg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Window sensor trigger
« on: April 06, 2014, 07:24:19 am »
Hi, how can i do this?..... If my window sensor is open for more then X time turn the AC off.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Window sensor trigger
« Reply #1 on: April 06, 2014, 07:43:47 am »
It would be easy to do this with Program Logic Event Generator (PLEG) plugin. See PLEG Basics for an introduction.

You could also do it using Lua code in a scene with a delayed action. See Conditional Scene Execution.

Offline Javierrg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Re: Window sensor trigger
« Reply #2 on: April 07, 2014, 07:47:54 pm »
Cant get it to work :(... new to pleg sry
« Last Edit: April 07, 2014, 07:50:03 pm by Javierrg »

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Window sensor trigger
« Reply #3 on: April 07, 2014, 08:15:42 pm »
Cant get it to work :(... new to pleg sry
A little more explanation of your problem would be helpful...

You would want something along these lines:

Triggers
WindowOpen     Window sensor tripped

Conditions
TurnOffAC           WindowOpen and (WindowOpen; Now > 5:00)

Actions
TurnOffAC           AirCon turn off

Offline Javierrg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Re: Window sensor trigger
« Reply #4 on: April 07, 2014, 08:50:35 pm »
its not working with the timer, i set it to now > 10 ) it took like a minute to trigger
« Last Edit: April 07, 2014, 08:54:13 pm by Javierrg »

Offline SirMeili

  • Hero Member
  • *****
  • Posts: 1052
  • Karma: +43/-20
Re: Window sensor trigger
« Reply #5 on: April 07, 2014, 10:52:53 pm »
NOW only updates every minute. You put 10 seconds as your difference so that condition will evaluate as true somewhere between 10 seconds and about 1 minute and 9 seconds (roughly) after the window is opened.

Sent from my Nexus 7 using Tapatalk
VeraLite (Live); ISY 994i (Live); Vera 3 (Waiting to replace VeraLite); Vera Edge (Waiting for all the bugs to be fixed); Xuan StackBox (Testing and waiting for more plugins and for it to mature)
Countless z-wave and insteon devices :D

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Window sensor trigger
« Reply #6 on: April 08, 2014, 01:59:16 pm »
If you want a smaller interval or more precise time than using NOW, which has one minute resolution, than do the following:

Create an input timer call XYZZY, pick your own name.
Thus will be a self trigger timer.The off time will be interval with the desired interval. This will give you an accurate time in your logic.

however you need two conditions:

WindowOpen
Timeout            WindowOpen and (XYZZY; !XYZZY)

The action for WindowOpen will start the timer.
« Last Edit: April 08, 2014, 02:01:24 pm by RichardTSchaefer »