vvtech Posted December 22, 2019 Share Posted December 22, 2019 Hi All, I'm trying to setup a custom door bell for Christmas time. I can't find an else statement to trigger the normal door bell. Right now it still plays both in December. Is there a better way to do this? Quote Link to comment Share on other sites More sharing options...
ecschnei Posted December 22, 2019 Share Posted December 22, 2019 If "not equal sign" December then play "normal" door bell The equal sign with a slash through it....... Sent from my SM-G965U using Tapatalk msgreenf 1 Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 22, 2019 Author Share Posted December 22, 2019 @ecschneiAwesome! Thank you. I could find one with slash through it, but one with exclamation seemed to work Is this what it should look like? Quote Link to comment Share on other sites More sharing options...
msgreenf Posted December 22, 2019 Share Posted December 22, 2019 Yes. You can also put an end of side your first if. That makes it more efficient ecschnei 1 Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 22, 2019 Author Share Posted December 22, 2019 Thanks. Is break same as end? I don't see end in programming control. Quote Link to comment Share on other sites More sharing options...
eggzlot Posted December 23, 2019 Share Posted December 23, 2019 You obviously got it working. I have a few things tied into “holiday mode” such as themed doorbell sounds, exterior lighting, interior lighting (Xmas tree), etc. So I have a holiday variable so I can turn the house into holiday mode. So when the doorbell rings, if holiday mode is True it plays holiday themed sounds, if holiday mode is false its the regular doorbell. This way your are not tied into a month. My wife loves the holidays and makes me keep Xmas going until the 12th day of Xmas. So cutting off that stuff on Dec 31st wouldn’t work here! I have a custom button so I can turn these events on / off all together and can do it after Thanksgiving and make it last past Jan 1. Nothing is at all wrong with your programming but it will only work for Dec 1 > Dec 31. A holiday mode can be a bit more flexible - you just need to remember to turn it on. But then you can tie in your Xmas Tree, exterior lighting and anything else (along with the themed doorbell music) Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 23, 2019 Author Share Posted December 23, 2019 Hi Eggzlot, Sounds like a great idea. I understand the concept, but I'm still a novice in c4 programming. I would love to see an example on how you're calling the variable from some of the programming modules. How does the custom button triggers the actions. Thanks. Quote Link to comment Share on other sites More sharing options...
eggzlot Posted December 24, 2019 Share Posted December 24, 2019 2 hours ago, vvtech said: Hi Eggzlot, Sounds like a great idea. I understand the concept, but I'm still a novice in c4 programming. I would love to see an example on how you're calling the variable from some of the programming modules. How does the custom button triggers the actions. Thanks. This explains a True/False variable: https://www.control4.com/documentation/Composer_HE_User_Guide/Using_Custom_Variables_Agent_Boolean1.htm It goes into detail on how to find the variable agent and how to use the Boolean Variable (True/False). It even gives a front door scenario. If someone is at the front door or if someone is not at the front door. So you would use the same idea if its holiday or not holiday. So first step, go to the agents in composer and select Variable and create a Boolean (True/False) variable called Holiday mode. Set it to true (because it is the holidays right now) In your programming - I am not sure what doorbell you have but on the trigger of the action (button press, whatever it is called) you would do the following: On the upper left pane scroll down to variables and pick the new on you created and go to the conditionals IF holiday mode is true Play Holiday Door Bell (or whatever the file is called, again not sure how you are playing the sound through what service) IF holiday mode is false Play Standard Door Bell (or whatever the file is called) Notice the indents on the second line, that nesting is required. Now you can have several ways to to create buttons to go back and forth between holiday mode and regular mode. Your dealer can add an experience button. Or you can create a custom button: https://www.control4.com/documentation/Composer_HE_User_Guide/Program_Using_a_Custom_Buttons_Agent.htm when you create the custom button call it Holiday Mode or whatever and the action of the button would be to toggle the True/False variable you created in the first step. You can see if the toggle is working because if you go to Agents > Variables > Holiday Mode (in monitoring tab in Composer HE) you can see the current state of the variable. Press the custom button again and go back to Agents > variables > Holiday Mode and the state should know be the opposite. Get the doorbell working first. Then you can do the same thing with exterior lights/outlets with Christmas lights, program a Wemo to turn your Xmas tree on/off (really easy to do if your alarm is hooked up into C4), etc. Hope that is helpful. vvtech and Don Cohen 2 Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 24, 2019 Author Share Posted December 24, 2019 Excellent! Thank you Eggzlot. This makes sense, I'll give it a shot and I greatly appreciated. Quote Link to comment Share on other sites More sharing options...
eggzlot Posted December 24, 2019 Share Posted December 24, 2019 13 minutes ago, vvtech said: Excellent! Thank you Eggzlot. This makes sense, I'll give it a shot and I greatly appreciated. No problem easier if you post your code if you are having issues. Your hardware is different than mine or the next guys so give it a whirl. Post results and can help from there Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 24, 2019 Author Share Posted December 24, 2019 That works perfectly. I setup custom button to set variable to true/false and set the variables at the door bell. This gave me an idea for vacation mode. I've been wanting to do different lights etc for vacation and this logic works great for that as well. Thanks again for great idea. Quote Link to comment Share on other sites More sharing options...
eggzlot Posted December 24, 2019 Share Posted December 24, 2019 great now you can go crazy! If you have any outlet switches (Wemo, TP Link, etc) you can set it up with a Christmas tree. I have it so at Sunset if Christmas mode is true, turn on Wemo outlet so the Xmas tree goes on. When I press my "goodnight" button, it will turn off the Wemo. I also have it set to my alarm system, so if holiday mode is true and alarm is set to away (We are leaving) it will turn the tree off if its on. and when we arrive home and "Disarm" the alarm it will also turn the tree back on if its after sunset. Then like I said you can go into exterior lighting, we have a few shrubs we light up and those exterior outlets are wired to a c4 switch inside so I can program on/off based on the holiday mode. vvtech 1 Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 24, 2019 Author Share Posted December 24, 2019 Yeah I'm going crazy already. Thanks again. Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 24, 2019 Author Share Posted December 24, 2019 I noticed that the Break command doesn't exit out of the If <statement>. How do I end the if statement so that it doesn't continue with the rest of the commands following a variable set to true? Quote Link to comment Share on other sites More sharing options...
lippavisual Posted December 24, 2019 Share Posted December 24, 2019 Stop or end. Quote Link to comment Share on other sites More sharing options...
vvtech Posted December 24, 2019 Author Share Posted December 24, 2019 I found Stop. Thx. Quote Link to comment Share on other sites More sharing options...
Cyknight Posted December 24, 2019 Share Posted December 24, 2019 ? You need neither break or stop for the above code. 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.