We have moved at community.getvera.com

Author Topic: Scene nested schedule  (Read 1386 times)

Offline greggstrickland

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Scene nested schedule
« on: November 11, 2014, 11:57:39 pm »
I want to create a scene to ensure that my doors are locked every night.  I have a basic scene now that runs at sunset and locks the doors.  The problem is that if someone unlocks the doors after sunset then it wont run again until the next night.

Is it possible to set up an interval schedule (say every hour), but only from sunset to sunrise (not during the daytime)?

Ideally I would like to get notified if it has to lock the door... but right now I believe it e-mails every time it is run regardless of the action.. just the fact that the scene ran.

Is that something possible with the current scene creation?

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Scene nested schedule
« Reply #1 on: November 12, 2014, 07:21:02 am »
You will either have to use luup code within the scene or use the pleg plug-in to do this. The scene editor does not have the ability to check between times.

- Garrett


Offline aa6vh

  • Hero Member
  • *****
  • Posts: 642
  • Karma: +15/-0
Re: Scene nested schedule
« Reply #2 on: November 12, 2014, 10:37:02 am »
You could use the luup.is_night() call to abort the scene during the daytime, and just schedule the scene for every hour. See "Conditional Scene Execution" for details on how to do this (its very simple): http://forum.micasaverde.com/index.php/topic,18679.0.html

However be aware that there is a reported bug in UI6/UI7 that has a memory leak with regularly scheduled scenes like this. I understand the UI5 does not have that problem. So what Garret says about using PLEG might be a better solution.

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Scene nested schedule
« Reply #3 on: November 13, 2014, 08:14:52 pm »
You also do not want to send a lock command if it's already locked ....
This will run your batteries down faster!

Offline aa6vh

  • Hero Member
  • *****
  • Posts: 642
  • Karma: +15/-0
Re: Scene nested schedule
« Reply #4 on: November 14, 2014, 10:14:16 am »
You also do not want to send a lock command if it's already locked ....
This will run your batteries down faster!

Only true on certain models of locks. My Schlage ignores lock commands if already locked.

I do not beleive that Yale or Kwikset locks react either.

Offline greggstrickland

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Scene nested schedule
« Reply #5 on: November 15, 2014, 08:59:53 pm »
Thank you all.  My battery is going down fast, but mostly because I keep playing with it  :)

Another question.  I would like it to notify me only if it has to lock the door, but currently the only option is to notify every time the scene is run.  Is there code that would do this?

Thanks again

Offline aa6vh

  • Hero Member
  • *****
  • Posts: 642
  • Karma: +15/-0
Re: Scene nested schedule
« Reply #6 on: November 16, 2014, 01:20:11 pm »
Thank you all.  My battery is going down fast, but mostly because I keep playing with it  :)

I would also suggest checking on the polling interval on your lock. UI6 had it defaulted to every 2 minutes, which will drain the battery very quickly. I set mine to never poll, but if you are concerned about knowing the current state, then every couple or three hours seem reasonable.

Quote
Another question.  I would like it to notify me only if it has to lock the door, but currently the only option is to notify every time the scene is run.  Is there code that would do this?

Answered in your duplicate post.