Author Topic: A question about setting times.  (Read 1679 times)

Offline Ironzey

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +2/-0
A question about setting times.
« on: November 03, 2013, 05:18:16 pm »
I'm trying to figure out how to turn on my porch lights when my garage door is opened. Here is the problem I'm running into.

My porch lights turn on at sunset and stay on until 9pm.
From 9pm to sunrise I would like the porch light to turn on when the door is opened.  I would like the light to stay on for 5 minutes after the door is closed.

I have tried setting up a scene to turn on the porch light for 5 minutes that is triggered by the garage door sensor.  The problem I'm running into is it happens during the day, which I don't want.

How do I exclude times from a scene?  Another way to ask is.  Is there a way to do a from, to time when talking about scenes?


Offline Z-Waver

  • Master Member
  • *******
  • Posts: 4437
  • Karma: +247/-120
Re: A question about setting times.
« Reply #1 on: November 03, 2013, 05:31:48 pm »
You are getting into an area that is too complex for a regular scene. You would need to use your own custom LUUP code, but this will be difficult if you are not familiar with programming in LUA. A simpler alternative to custom LUUP code is to use the Program Logic Event Generator(PLEG) plugin which allows more complex conditional logic than a basic scene to control a device.

Using PLEG to turn on lights only under very specific conditions has been covered many times in these forums.

Offline Ironzey

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +2/-0
Re: A question about setting times.
« Reply #2 on: November 03, 2013, 05:38:15 pm »
Oh well, I was was hoping to avoid it but it looks like I'm going to have to dive into PLEG.

Thanks 
« Last Edit: November 03, 2013, 05:39:49 pm by Ironzey »

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +482/-12
Re: A question about setting times.
« Reply #3 on: November 03, 2013, 06:07:30 pm »
Quote
I was was hoping to avoid it...
You will not regret learning how to use PLEG. It turns Vera from a toy into a tool.

Offline Ironzey

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +2/-0
Re: A question about setting times.
« Reply #4 on: November 03, 2013, 07:37:06 pm »
(http://img.photobucket.com/albums/v93/Ironzey/PLEGquestion1.png)

Where do I find inclusive times in my case, between 2100 and Sunrise?

Also, are we allowed to use IMG code?  What I posted doesn't seem to work.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +482/-12
Re: A question about setting times.
« Reply #5 on: November 03, 2013, 07:59:57 pm »
For an inclusive time, set Stop Type to Day of Week with required time.

You can post a png file by attaching it.

Offline Ironzey

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +2/-0
Re: A question about setting times.
« Reply #6 on: November 03, 2013, 08:45:37 pm »
OK, thanks. Looks like I've got a a lot of reading to do.  :'(

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +482/-12
Re: A question about setting times.
« Reply #7 on: November 03, 2013, 09:06:38 pm »
OK, thanks. Looks like I've got a a lot of reading to do.  :'(
Just set up a PLEG with a few VariableSwitch devices - or a MultiSwitch - and try a few simple conditions. Once you get the feel for how it works you'll be amazed what you can get it to do for you.

Offline Ironzey

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +2/-0
Re: A question about setting times.
« Reply #8 on: November 03, 2013, 09:20:12 pm »
I just don't really get the interface in PLEG.

Are there any tutorials besides
http://rts-services.com/Vera/Plugin/PLEG/

Is there a step by step setup explanation? I'm not looking for exactly what I want to do but something that explains a little better what the different options are.

Once again, Thanks.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3891
  • Karma: +482/-12
Re: A question about setting times.
« Reply #9 on: November 04, 2013, 03:14:17 am »
Not that I'm aware of although I believe there is one being written for a French HA forum. The RTS documentation on PLEG and PLC explains the principles of how it works and what options are available. Searching the forum will almost certainly get you examples of how others used PLEG to implement whatever function you are looking to do.