LollerAgent Posted December 11, 2019 Share Posted December 11, 2019 Is there a way to use time as a conditional with programing? Example: I have a "Hello" button on a keypad. If this button gets pressed between 9am-4pm, I want to enable "Housekeeper" mode. Otherwise, I just want to execute my normal "Hello" macro. Is there anyway to do this? Quote Link to comment Share on other sites More sharing options...
eggzlot Posted December 11, 2019 Share Posted December 11, 2019 16 minutes ago, LollerAgent said: Is there a way to use time as a conditional with programing? Example: I have a "Hello" button on a keypad. If this button gets pressed between 9am-4pm, I want to enable "Housekeeper" mode. Otherwise, I just want to execute my normal "Hello" macro. Is there anyway to do this? i do that with variables and the scheduler agent. Every day at 9am I would have a variable called XYZ become true, and at 4pm that variable is False. Then with your button you program IF variable XYZ is true... IF variable XYZ is false... drro and alanchow 1 1 Quote Link to comment Share on other sites More sharing options...
LollerAgent Posted December 11, 2019 Author Share Posted December 11, 2019 6 minutes ago, eggzlot said: i do that with variables and the scheduler agent. Every day at 9am I would have a variable called XYZ become true, and at 4pm that variable is False. Then with your button you program IF variable XYZ is true... IF variable XYZ is false... Makes sense, thanks! Quote Link to comment Share on other sites More sharing options...
eggzlot Posted December 11, 2019 Share Posted December 11, 2019 7 minutes ago, LollerAgent said: Makes sense, thanks! yep no problem i have 1-2 keypad buttons in my house using the same concept (just different times) but yeah just use the scheduler to change a variable state and then program off that variable state. 99% of the programming I have done in C4 (not my dealer) is based on T/F variable logic. I keep it simple :-) Mostly because I do not understand the other types of variables! msgreenf 1 Quote Link to comment Share on other sites More sharing options...
OceanDad Posted December 11, 2019 Share Posted December 11, 2019 Would this be the best way to change the brightness of a lighting scene depending on time of day ? In other words, execute a dim bathroom light scene in the middle of the night vs the rest of the day ? Set up 2 different ALS scenes, and trigger one or the other based on time of day. Quote Link to comment Share on other sites More sharing options...
msgreenf Posted December 11, 2019 Share Posted December 11, 2019 Would this be the best way to change the brightness of a lighting scene depending on time of day ? In other words, execute a dim bathroom light scene in the middle of the night vs the rest of the day ? Set up 2 different ALS scenes, and trigger one or the other based on time of day.Yes Quote Link to comment Share on other sites More sharing options...
Thepritch88 Posted December 12, 2019 Share Posted December 12, 2019 I think you could do this easier and without the need for a variable. If your in the programming tab and scroll down the device actions pane on the right hand side, find the scheduler at the bottom and you can add a conditional for time at the top of script, that would save you a whole bunch of other programming, setting of variables etc Quote Link to comment Share on other sites More sharing options...
ILoveC4 Posted December 12, 2019 Share Posted December 12, 2019 7 hours ago, Thepritch88 said: I think you could do this easier and without the need for a variable. If your in the programming tab and scroll down the device actions pane on the right hand side, find the scheduler at the bottom and you can add a conditional for time at the top of script, that would save you a whole bunch of other programming, setting of variables etc Yeah, the only benefit to a variable is it makes it a lot easier to adjust the times or triggers (something other than time) that cause the behavior to change. Quote Link to comment Share on other sites More sharing options...
Thepritch88 Posted December 12, 2019 Share Posted December 12, 2019 That is a good point, I hadn’t thought of that. On the topic of changing/editing programming though, the new way of replacing a line of code with another by holding shift makes this so much easier, it’s saved me so much time since they introduced that feature, I also love that you can select the whole script for copying and pasting now instead of just one line Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.