jfh Posted June 27, 2015 Share Posted June 27, 2015 I am trying to program a keypad button to toggle a light - turn on if off; off if on. Seems pretty simple, but I can't get it to work.The light in question is a Lutron Castea dimmer controlled through the Lutron bridge.The code acts as if the first STOP doesn't exist. If the light is off, it turns on, but then immediately turns off. And if the light is on, it does nothing. I also presume I don't need the turn light on/off as shown in the code, but the code works the same way without them.? If Hallway>Back Hall is off-> Turn on the Hallway -> Back Hall-> Set Level on the Hallway -> Back Hall to 100-> STOP? If Hallway>Back Hall is on-> Set Level on the Hallway -> Back Hall to 0-> Turn on the Hallway -> Back Hall-> STOPWhat am I missing?Also - how do I get the action arrows to indent under the conditional statements? I presume it doesn't matter, but I like the aesthetics better (I'm using HE 2.7.1) Link to comment Share on other sites More sharing options...
Matt Posted June 27, 2015 Share Posted June 27, 2015 I am not familiar with the Lutron driver but isn't there a command to do just a 'toggle' under the light load? In your example, nest the command under the conditional. You're using repeated commands, but should work once you nest the commands. Also - how do I get the action arrows to indent under the conditional statements? Drag the commands to the Conditional. I hope this helps.Matt Link to comment Share on other sites More sharing options...
msgreenf Posted June 27, 2015 Share Posted June 27, 2015 The first thing you are missing is the indent under the if. To get it to indent drag the lines below on top of the if and it was indent. The second thing is you don't want to do the turn on and set the level in 2 separate lines. You can do them in one. Just pick the light level and that is all you need. Sent from my iPhone using Tapatalk Link to comment Share on other sites More sharing options...
jfh Posted June 27, 2015 Author Share Posted June 27, 2015 Thanks guys! The lack of nesting was the problem. Now that I know how to do that, I'm good.I figured I didn't need to explicitly turn the light on/off and originally just set the levels and that's what I'm back to.I had hoped that using the toggle light load command would work, but it doesn't which is why I went the conditional route in the first place.As a longtime systems programmer just used to writing code, this drag and drop approach will take some getting used to. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.