wired64 Posted May 7, 2013 Posted May 7, 2013 Folks, I am relatively new to programming with the ISY and Insteon, so I may not be using the correct terminology. I am working on proper term use and, from what I've seen on this board, I'm not likely to get flamed for using the wrong terms, but I'll say up-front that my issue may need some interpretation . I've setup a number of 6 button switches to control a few different scene's in the house. These are working great and I've been able to do everything I would expect, including having the A-D button LEDs turn-on/off and having control of multiple different modules that manage different loads. Now to my problem... I have 3 different scenes setup on one of the 6 button switches. These scenes and the general functions are shown below: landscape lights - turn on landscape lights - turn off rope lights - turn off patio lights party - turn on landscape lights - turn on rope lights to 40% - turn on patio lights to 40% cleanup - turn on landscape lights - turn on rope lights to 100% - turn on patio lights to 100% Turning these scenes on and off and switching scenes all works fine. Now, I have a motion sensitive security light that I want to effectively do just the opposite plus a bit more... This device is controlled by an on/off 2477S switch Essentially, I want to do the following (adding activate/deactivate to the scenes because the security light needs to do different things depending on the action being taken): Landscape - when activated - security light is on - when deactivated - security light is on Party - when activated - security light is off - when deactivated - security light is on Cleanup - when activated - security light is on - when deactivated - security light is on I do have some programs I use, but these are generally used for X10 devices at the moment. I don't see that there is a way I can detect a "state change" for a scene in the programming. I don't see that there is a way I could add a variable into a scene so that I can basically tell the ISY - I'm in party mode now - turn the security light off until I'm no longer in party mode. I may be able to do something like checking the status of the rope light and when it's at some explicit % (say 43%), then turn the security light off until the status of the rope light changes to some other value. This would generally then require a loop that would check every 10 minutes or so to see if the party scene is active, or not - doesn't seem to be a particularly efficient or elegant answer. Any other ideas on how I might be able to approach the problem? Thanks for any suggestions you might be able to offer! Cheers, SK
oberkc Posted May 7, 2013 Posted May 7, 2013 I do have some programs I use, but these are generally used for X10 devices at the moment. I believe the solution to this problem will require a program. Scenes will not be sufficiently powerful. I don't see that there is a way I can detect a "state change" for a scene in the programming. You don't see one because there is none. There is no such thing as scene "state", or "status" with insteon or with the ISY-994. I don't see that there is a way I could add a variable into a scene so that I can basically tell the ISY - I'm in party mode now Variables cannot be part of scenes. It takes a program to change the value of a variable. I may be able to do something like checking the status of the rope light and when it's at some explicit % (say 43%), then turn the security light off until the status of the rope light changes to some other value. This observation begins to suggest a reason why there is no such thing as scene status. Is your party scene on only when rope lights are at EXACTLY 43%, and not 42 or 44? What if the rope lights are at 43, but patio is at 71% (or any random value)? This observation also reaches the same conclusion that most of the rest of us have reached...one could use a surrogate device as indication of scene status. The question you need to ask yourself is how you want the security lights to behave when the combination of rope/landscape/patio lights are at a combination of levels other than the descrete values of the three scenes? Do you want the security lights off? At what levels must the rope and patio lights get to before the scene ceases being "party" and becomes "cleanup"? 70%? 90% 100%? Instead, would you rather have the security light turn off as rope/patio lights are in some state of brightness between the party scene and cleanup scene (unlikely, I assume). Questions like this need to be answered for all three scenes in order to come up with proper program conditions. One thing that I am unclear on, but may offer a solution, is whether there is any device within your three scenes that act as "controllers"? Are the keypad buttons part of these scenes as controllers, or do you use a program to turn on the scene, triggered by the keypad buttons? If the former, you could use one of the keypad buttons as an indication that the scene has been turned on or off. Are there other ways (besides manually) that these scenes could be turned on or off, such as through a program? If so, this may limit our programming options to "status" if we choose to use a keypad button as scene status? I notice that, in general, the security light is on. Only stated exception is when party scene is on. Are there other exceptions, such as daytime/nightime, motion? What do you think about restating your view of the world in a different way, such as: security lights are ALWAYS ON, except when party scene is on? Does restating your goals in this way suggest a solution? In the end, you will need a program. The conditions of the program will be based on answers to many of the questions, above, and to other questions yet asked.
Xathros Posted May 9, 2013 Posted May 9, 2013 wired64- Since you are using Keypads to control your scenes, you can use the "Control" and "Status" of your KPL buttons to fire programs that manages the security light. Here is my thoughts: Assuming 3 KPLs (KPL-1,KPL-2 & KPL-3) and assuming the Party scene is Button C on each of those. If Control KPL-1-C is Switched On or Control KPL-2-C is Switched On or Control KPL-3-C is Switched On Then Set Security Light Off If Status KPL-1-C is Off Then Set Security Light On -Xathros
wired64 Posted May 14, 2013 Author Posted May 14, 2013 oberkc - Thanks for the reply... I came to the conclusion that a loop that checks for status of a rope light % is not the right answer - it's just technically "chunky". You're restatement of - the security light is always on except when in party mode is the correct "factored" version of the definition I am stating. I currently do have the light switch setup as a controller for the scene. It basically does the job - and it works quickly, but may not be the best option. Having said that, in the back of my mind, I'm wondering if I can setup a scene for the on/off buttons as well - if so, I could setup a scene that ensures the security lights are on for any scene except for party. I may play with this a bit to see if I can get it to work. If not, I will likely take the 6 button switch out as a controller and simply have the ISY react to the status of the buttons. Xathros - One of my unstated goals is to have the lights on various controllers give me the state of various environments. There will be three areas where "party" can be turned on and these are far enough apart that I'd like to know that the area is already in "party mode". If I can't achieve this with scene's/controllers and responders, then I believe I will be able to do this with programming. Basically, I can say when KPL-1-C is switched on, check a state variable. If it's not on, set it to on and also set KPL-2-c and KPL-3-C to on. Then I can setup "party mode" as appropriate. I think the control + state variable will allow me to setup the program... I was just hoping that I could use the scene feature to do what I was looking for. Don't know how long it will take for the controller to drive things as opposed to having the scene do the work. I can tell you that with the scene doing the work, my wife doesn't get impatient and start pressing other buttons . Hoping that if I do have to use programming that the response time is sufficiently low that we're not looking at delays before something happens... I'll see! Thanks for the responses! I've not made a change to these programs as yet and may not until early June simply due to a busy schedule and some business trips where I absolutely do not want to be dealing with lights not working as expected while I'm away . I'm sure I'll be able to setup what I need with the Insteon scenes, or with the ISY programs, but it's clear to me that I cannot use both of those in an integrated approach that makes sense... Though I may be able to use scenes that are activated by the ISY programs... We'll see!
oberkc Posted May 14, 2013 Posted May 14, 2013 You're restatement of - the security light is always on except when in party mode is the correct "factored" version of the definition I am stating. Given this, I wonder some forum of logic (in pseudocode) such as the following would work: If status party scene is ON* (see note) then turn secrurity lights OFF else turn security lights ON *NOTE as discussed, there is no such thing as scene status, so you will have to replace this with the proper device status, whether you want to use combination status of rope and patio lights, or a controller from the party scene controller or something else. Also, I have missed it if you have any element of time (sunset? sunrise?), but one could add this condition relatively easy.
Xathros Posted May 14, 2013 Posted May 14, 2013 wired64- I still think what I posted is the answer you are looking for. Your KPL-C buttons should all be controllers of the Party scene. That way they stay in sync and show that the scene is On/off. No need for a state variable as the KPL Button LED's are serving that function. I am only looking at one of them to determine scene status since thats all we need If one of them is off, all 3 should be off and the Party scene is NOT on. I do look for Control Switched On events from all 3 to turn off the security light when the party scene is initiated. I suppose I could have done the same by looking at the status of any one of the three KPL buttons and that would cover the possibility of the scene being activated by admin console or mobilinc etc. -Xathros
wired64 Posted September 3, 2013 Author Posted September 3, 2013 OK - I've implemented a solution that makes sense to me and is reasonably efficient to implement. I'm not sure if this is optimal, but I'll post in the hope to help anyone else working on this type of issue. Essentially, what I want is a set of scene's and programs that would enable multiple buttons to change what I might call the "states" of the outside lights. There are five different states: - Landscape state - Party state - Cleanup state - Patio lit state - Off state Some of these states require the security light to be on or off... What I ended up doing was the following: - I ended up making the following setups for the keypad A-D buttons - Each button was changed to be non-toggle - on (i.e. when the button is pressed, it only sends an "on" - A-D were made to be mutually exclusive through the use of scenes The way I implemented was: 1) Set the A-D buttons to be non-toggle (on only) 2) I setup a state variable that would indicate the 5 different states 3) I set a program for each of the A-D and the Off buttons that had the following programs setup (note, for a-d - the check is for an "on", for the off button it's an "off" - just sayin): if control keypad1 [a] is switched on or control keypad2 [a] is switched on then $OState=1 (the OState variable is one of 5 values 0 -4) I then have a program that has if $OState=1, set a scene to on. Finally, in that final scene, I set each of the keypad and other switches appropriately. The key for my thinking and processing is that scene is only ever turned "on". Most scenes will, as far as I understand, be turned on, or off. If you only set the scenes to turn on, it makes the management of which KPL buttons are turned on or off significantly easier. Since we look at the KPL as a toggle with one of five states (off, or one of the four settings), this works wonders and it's easy to implement. If others are interested, I can post more code, but I'm not sure how to copy and paste the code into a text based editor (simply have not looked into it - it's possible that a backup of the programming would provide me with that text info)... Gotta go, my battery is about to die ...
Recommended Posts