Author Topic: Stop PIR switching on lights during the day  (Read 463 times)

Offline JoeTomasone

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-0
Re: Stop PIR switching on lights during the day
« Reply #15 on: September 04, 2017, 02:32:53 am »
I do this with PLEG.   I have an input schedule called "Daytime" that starts at sunrise and ends at sunset.   Then I have a condition like this:

(FrontPorchSensorMotion or BackDoorSensorMotion) AND !Daytime

That's tied to an action that immediately turns on 4 lights outside, and 10 minutes later turns them off again. 




Offline John M.

  • Administrator
  • Sr. Member
  • *****
  • Posts: 462
  • Karma: +38/-3
    • getvera.com
Re: Stop PIR switching on lights during the day
« Reply #16 on: September 04, 2017, 03:27:49 pm »
I use this Luup code

Code: [Select]
if (luup.is_night()) then
     return true
else
     return false
end
John.M. ▾ Senior Customer Care Advocate
Vera Control, Ltd. ▾ Smarter Home Control  ▾ support@getvera.com ▾www.getvera.com ▾ +1 (866) 966-2272

HOURS OF OPERATION (Pacific Time Zone, UTC -8 )
Monday - Friday   12:00 am ? 06:00 pm
Saturday - Sunday   04:00 am ? 06:00 pm