Author Topic: Door code turns on lights only after sunset  (Read 1731 times)

Offline Efletcher

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Door code turns on lights only after sunset
« on: September 08, 2011, 12:54:38 am »
I'm not a programmer and this is driving me crazy.

How do I get my wifes front door code to turn on the house lights but only if it's between sunset and sunrise

HELP!!!

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3256
  • Karma: +191/-9
Re: Door code turns on lights only after sunset
« Reply #1 on: September 08, 2011, 01:51:05 am »
Hi Effletcher,

Assuming you've already got a scene that turns on the light no matter what time of day it is...

Go to the scene's Luup tab, and paste:

Code: [Select]
return luup.is_night()
Save.  Save.

Search on this forum for is_night for more related discussions.

More reference material here.

Offline Efletcher

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Door code turns on lights only after sunset
« Reply #2 on: September 18, 2011, 03:16:57 am »
THANKS!!!!!!

that worked