Author Topic: Can't turn light off using timer  (Read 109 times)

Offline highlydefined

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Can't turn light off using timer
« on: February 15, 2019, 11:02:32 am »
My kids never switch off the bathroom light so I want to make a simple PLEG argument to turn the light off a specified time after it has been turned on.  For testing purposes I'm using 10 seconds but it's not working, the light simply stays on.  I've attached my Status Report, if anyone can, er, shine a light on it I would be grateful.

Offline tamorgen

  • Full Member
  • ***
  • Posts: 130
  • Karma: +2/-0
Re: Can't turn light off using timer
« Reply #1 on: February 15, 2019, 02:39:34 pm »
Try using the now operator.  I would start with a minute or more, unless your kids relieve themselves very quickly.   ;)

c1BathroomCountdown
Condition:
tBathroomLightOn; NOW > 1:00

For action, you don't need to use the repeat, just do the SetTarget to 0 for your Bathroom light [22] switch.

Action: c1BathroomCountdown
Device Actions:
Immediate
Device Action Arguments
Bathroom light [22]  SetTarget newTargetValue=0

Hope this helps.

Offline highlydefined

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Can't turn light off using timer
« Reply #2 on: February 17, 2019, 11:05:04 am »
That makes sense - I'll give it a whirl, thanks!