yelkenli Posted November 22, 2017 Share Posted November 22, 2017 I have a motion detector that controls lights with a simple script: when sensor senses motion, if time is between x and y hours, activate lighting scene. I would also like to have the motion detector send me a push notification as follows: when motion sensor senses motion, if 'Out-of-House' is true, send push notification. My problems are several fold: I am not able to get action statements to nest. usually, these are indented under an if statement. I can drag the action statement to the if statement, get a yellow highlight, and get either a down arrow or right arrow. However, no indent. Second, the support technicians don't support Composer (the one I talked to), and was unsure if multiple conditional statements are allowed in scripts. I would expect something like this: When sensor senses motion if time is between x and y hours activate lighting scene. if 'Out-of-House' is true send push notification. Ignoring the inability to nest, would this operate such that it evaluates the first if statement and takes action if appropriate, and then go to the next if statement and take action if appropriate? Or is it illegal to have multiple if statements? Any ideas on the nesting issue? are there keyboard commands, like holding the option key, etc, that would make the nest? Any recommendations are appreciated. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted November 22, 2017 Share Posted November 22, 2017 Right arrow should be nesting... Yes, you can have multiple ifs. They can be nested or not. If not nested, then they will happen one after the other unless you use a stop statement or else (os2.10 only). Quote Link to comment Share on other sites More sharing options...
yelkenli Posted November 22, 2017 Author Share Posted November 22, 2017 I am on OS 2.9.1. Does the stop statement apply to 2.10 only, or the multiple ifs? Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted November 22, 2017 Share Posted November 22, 2017 On 2.9.1 you can use the stop statement nested under an if then whatever you code after the if will essentially be an else... Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted November 22, 2017 Share Posted November 22, 2017 So for someone on 2.9.1, the following applies: Right arrow should be nesting... Yes, you can have multiple ifs. They can be nested or not. If not nested, then they will happen one after the other unless you use a stop statement in which case if the execution gets to the stop statement (due to the relevant condition being true) then no further lines of code will be executed. Quote Link to comment Share on other sites More sharing options...
WhyPhy Posted January 27, 2021 Share Posted January 27, 2021 For anyone else struggling getting Commands to nest below Conditionals, there is a trick to doing this. You have to drag the Command Statement (Green Arrow) to the Blue Question Mark *ICON*. You must drag to the ICON itself and not the text beside the icon. (If you drag the Command Statement to the text beside the Blue Question Mark Icon, you will not get the "right arrow overlay" nest option. Dragging Commands to the Conditional text gives only the option to reorder the Command above/below the Conditional. This is very bad UI design by Control4 in Composer.) Quote Link to comment Share on other sites More sharing options...
Cyknight Posted January 27, 2021 Share Posted January 27, 2021 3 years later huh? And if it did it ALL THE TIME no matter where you dragged it, how would one create a combination of nested lines and not nested lines and move them around if needed? msgreenf 1 Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted January 28, 2021 Share Posted January 28, 2021 6 hours ago, WhyPhy said: For anyone else struggling getting Commands to nest below Conditionals, there is a trick to doing this. You have to drag the Command Statement (Green Arrow) to the Blue Question Mark *ICON*. You must drag to the ICON itself and not the text beside the icon. (If you drag the Command Statement to the text beside the Blue Question Mark Icon, you will not get the "right arrow overlay" nest option. Dragging Commands to the Conditional text gives only the option to reorder the Command above/below the Conditional. This is very bad UI design by Control4 in Composer.) So... this works exactly as designed and as documented in the user manual... Quote Link to comment Share on other sites More sharing options...
WhyPhy Posted January 29, 2021 Share Posted January 29, 2021 I'm surprised by the snarky replies. This question has been asked multiple times in multiple threads. None of those threads returned in my search provided this information, so I decided to document it for the next person searching for the solution. I don't see why this is deserving of contempt. As far as how this feature could be better implemented, literally any other approach would likely be better. Dragging an object to an unmarked UI target at the far left side to get that object to nest under the target (and toward the right) goes against pretty much every basic rule of UI design. A simple alternative solution would be to have indent/outdent UI buttons appear beside a command when it's selected. Another option would be to nest the command when it's dropped directly on top of the target, but also show a horizontal divider target between the rows when dragging slightly above or slightly below an existing row (the way row re-ordering is displayed in pretty much every spreadsheet.) Also, it's somewhat ironic that this is the same screen that pops up an "Expression Builder" warning, and also that the expression builder has a dedicated UI element just for re-enable the pop-up warning after it's been disabled. The "drag left to nest right" function is less obvious than the Expression Builder. Quote Link to comment Share on other sites More sharing options...
Cyknight Posted January 29, 2021 Share Posted January 29, 2021 30 minutes ago, WhyPhy said: None of those threads returned in my search provided this information, Yet I know I've stated it several times, and so have others. Maybe try indenting the search criteria 30 minutes ago, WhyPhy said: unmarked UI target ? not clear enough for you I guess 33 minutes ago, WhyPhy said: Another option would be to nest the command when it's dropped directly on top of the target But, this is exactly what you do. The target is the IF, not the condition/detail of the IF . 32 minutes ago, WhyPhy said: A simple alternative solution would be to have indent/outdent UI buttons appear beside a command when it's selected Would fail the moment you're doing multiple IF statements in a line 34 minutes ago, WhyPhy said: As far as how this feature could be better implemented, literally any other approach would likely be better Time to apply for a job then. Quote Link to comment Share on other sites More sharing options...
WhyPhy Posted January 29, 2021 Share Posted January 29, 2021 You don't seem to be interested in a constructive discussion about how this functionality could possibly be improved, but rather defending the existing confusing functionality that you and others have apparently had to explain numerous times. Unfortunately, Google has not yet adjusted their algorithm to prioritize results based on your documentation of this functionality. The other 4 top Google results, which are all on this forum, are still awaiting inclusion of this insight. I fear I should not further my participation. Quote Link to comment Share on other sites More sharing options...
mstafford388 Posted January 29, 2021 Share Posted January 29, 2021 21 minutes ago, WhyPhy said: You don't seem to be interested in a constructive discussion about how this functionality could possibly be improved, but rather defending the existing confusing functionality that you and others have apparently had to explain numerous times. Unfortunately, Google has not yet adjusted their algorithm to prioritize results based on your documentation of this functionality. The other 4 top Google results, which are all on this forum, are still awaiting inclusion of this insight. I fear I should not further my participation. I spent a few years meeting with hundreds of dealers and thousands of programmers and not once had this complaint, and I was the guy programmers would complain to so if it was going to come up it would have. Sure, guys forgot to nest on the if statement, but nobody every complained about how that process happened. Not a knock on you or your opinion on the matter, just saying as a whole people don't seem to think it's an issue, so change is highly unlikely. South Africa C4 user and HRT 2 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.