brucecampbell Posted January 11, 2012 Share Posted January 11, 2012 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 More sharing options...
TexasBill Posted January 11, 2012 Share Posted January 11, 2012 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 More sharing options...
C4Programmer Posted January 11, 2012 Share Posted January 11, 2012 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 More sharing options...
brucecampbell Posted January 11, 2012 Author Share Posted January 11, 2012 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. Link to comment Share on other sites More sharing options...
wingzz Posted January 11, 2012 Share Posted January 11, 2012 I just set mine up to go on 30 min before night time and turn off 30 min after day time, set it up in scheduler Link to comment Share on other sites More sharing options...
Tokead Posted January 12, 2012 Share Posted January 12, 2012 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 More sharing options...
brucecampbell Posted January 12, 2012 Author Share Posted January 12, 2012 I was looking at buying from the US last year when the exchange rate was good, but shipping costs were more than the product itself.I guess I could look at a budget non-tracked form of shipping.......Cheers. Link to comment Share on other sites More sharing options...
ILoveC4 Posted January 28, 2012 Share Posted January 28, 2012 Do what wingzz said. I do this as well and it works great. Link to comment Share on other sites More sharing options...
plalande Posted February 25, 2012 Share Posted February 25, 2012 Hello,I'm trying to change the room temperature when I turn the room off IF the time if after 7pm but its not working the temperature always change even if the time is not after 7pm. I attached the code. Thanks in advace Link to comment Share on other sites More sharing options...
CFUG Posted February 25, 2012 Share Posted February 25, 2012 ^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 More sharing options...
Godzilla Posted February 25, 2012 Share Posted February 25, 2012 which means drag command(green arrow) and drop it on the question mark.......and the line should bump over so the green arrow is no longer in line with the question mark Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.