Author Topic: Trigger only between certain times  (Read 153 times)

Offline ceskelund

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Trigger only between certain times
« on: July 09, 2018, 11:35:50 am »
I have been working with PLEG a short time and have been able to do most of what I need by reading the posts by other members - thanks so much for all the input. 

However, one specific process eludes me.  I want to be able to set my house alarm when the house "goes to sleep" but only between the hours of 10:00 pm and 5:00 am the next day.  So far, I am using three lights in the kitchen to determine when we are going to bed.  If they are all off, I want the alarm to set - however, since they can be off during the day, I only want to trigger the alarm from 10:00 pm to 5:00 am.  Also, if someone gets up in the middle of the night and turns off the alarm to go in the garage fridge for a late night snack, I want to reset the alarm after the lights are turned off again (signifying that person has returned to bed).

Any direction is much appreciated.

Offline ceskelund

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Re: Trigger only between certain times
« Reply #1 on: July 09, 2018, 02:26:15 pm »
I have done a little more  playing with the schedules and this is what I came up with.  I think this will set the alarm anytime between 10pm and 5am the next day when either the cabinet light, kitchen light, or sink light are turned off.  Any thoughts?

Trigger
tSinkLighOff      SinkLight turned off
tCabinetLightOff           CabinetLight turned off
tKitchenLightOff            KitchenLight turned off

Schedule      On Type      On Time      Off Type   Off Time
sBedTime      Interval            20:00:00           Interval   05:00:00

Condition
cBedTime      sBedTime AND tSinkLightOff AND tCabinetLightOff AND tKitchenLightOff

Then use the satisfied condition of cBetTime as a trigger for a vera scene to set my alarm
« Last Edit: July 09, 2018, 03:11:37 pm by ceskelund »

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1109
  • Karma: +9/-4
  • Black Cat Control Systems
Re: Trigger only between certain times
« Reply #2 on: July 09, 2018, 06:59:23 pm »
For times that span midnight use the NOT (!) operator with the opposite schedule.


ie to set 2200 to 0300 use NOT (0300 to 2200)



Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline ceskelund

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
Re: Trigger only between certain times
« Reply #3 on: July 10, 2018, 10:31:32 am »
Thanks for the input - I'll make that change.

Also, the Interval timer did not seem to work for me - it never changed to true so I switched to a Day of Week timer and selected every day and that seems to switch from true to false as expected.  After re-reading the PLEG Basics (several times) I now understand the difference - when Interval is set to 22:00:00, that means it will flip to true every 22 hours, not at 22:00.

Thanks