Jump to content
C4 Forums | Control4

Help with 'If Time Is Night Time' please


Recommended Posts

I currently have all my motion sensors turn on lights only if time 'is night time'

I have found this to be not quite perfect, I want to have the lights on earlier than 'night time'

I'm wanting some input on the best practice to do this:

Here is my current plan, please let me know if there is a better way.

I will have a boolean variable 'IsDark'

This will be set true/false based on two scheduled events: The two events will be triggered daily at ~30 mins after sunrise and ~30 mins before sunset.

Then where ever I have coded 'If time is Night Time', I will change to be based on the variable.

Any comments/input would be great before I go changing a mass of code.

Thanks.

Link to comment
Share on other sites


I currently have all my motion sensors turn on lights only if time 'is night time'

I have found this to be not quite perfect, I want to have the lights on earlier than 'night time'

I'm wanting some input on the best practice to do this:

Here is my current plan, please let me know if there is a better way.

I will have a boolean variable 'IsDark'

This will be set true/false based on two scheduled events: The two events will be triggered daily at ~30 mins after sunrise and ~30 mins before sunset.

Then where ever I have coded 'If time is Night Time', I will change to be based on the variable.

Any comments/input would be great before I go changing a mass of code.

Thanks.

There is a motion detector that has light sensing capabilities - I amhaving that installed so that depending on the actual light in the room I can have the lights trigger. There are dark rainy days...

Bill

Link to comment
Share on other sites

Your logic is sound. Many areas get light and dark before and after actual sunset times. On the west coast, it often stays lighter after sunset due to reflections off of the ocean. Variables are the way to go. Alternatively their are several devices which report light levels to deal with interior locations. Card Access has a light sensor in their motion sensors, and I know the Old 7" screen has a light sensor built into it. I dont recall if the new one does. You could go as far as getting a photo diode and wire it into a contact input on a controller to provide localized light sensing, but they are as configurable as the first two suggestions...

Link to comment
Share on other sites

Yes, thanks.

I've always wanted to get some of the CA gear, but in NZD they are pretty expensive, so just trying work with what I have got.

Look on eBay and ship to NZ. I picked up a used one for $50 that runs on two AA batteries. I've seen new for less than $150

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

^Nest the "Set the..." commands under the "If..." command.

Looks like you are running CPro so you must be on a an older OS. I can't comment on the rest of your code because I don't remember but if the Next command is the same as 2.2 Hold Until Next Event then everything should work OK.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.