carealtor Posted February 5, 2019 Posted February 5, 2019 I want to be able to start and stop a program by pressing any of several insteon keypad buttons around the house. I've read other threads about why it's not allowed to use a scene as a condition in program. Logically this stance makes sense and I agree with it. So what would be the proper way to do this? Obviously (I think) the keypad buttons would be grouped together in a scene so they would turn on and off in unison. Would I just pick one of the buttons (device) and use that in the program condition? I've tried this, and it seems to work in my limited testing so far, but it's not very elegant, IMHO. Maybe I'm overthinking this. I'm on 5.0.14.
Michel Kohanim Posted February 5, 2019 Posted February 5, 2019 @carealtor, If Control 'button x' is switched on Then Run whatever program With kind regards, Michel 1
kclenden Posted February 5, 2019 Posted February 5, 2019 I think you'd want to expand on Michel's program since you want to start and stop based on different button pushes around the house, so maybe: If ( 'A-Keypad / Button A' is switched On Or 'B-Keypad / Button A' is switched On Or 'C-Keypad / Button A' is switched On ) And ( 'A-Keypad / Button A' is not switched Off Or 'B-Keypad / Button A' is not switched Off Or 'C-Keypad / Button A' is not switched Off ) Then Run Program 'Turn Device On' Else Run Program 'Turn Device Off' You'd still want to group the keypad buttons into a scene with each being a controller so that the LED on all of them stays in sync. The only real problem with this approach is that if you add or remove a button from the scene, you need to update the program by adding or removing that button. If that is a problem, I suppose you could use STATUS instead of CONTROL and then only look at one button you know will always be part of the scene. So something like this if you know 'A-Keypad / Button A' will always be part of the scene: If 'A-Keypad / Button A' Status is On And 'A-Keypad / Button A' Status is not Off Then Run Program 'Turn Device On' Else Run Program 'Turn Device Off' 1
lilyoyo1 Posted February 5, 2019 Posted February 5, 2019 Are you trying to enable/disable programs? If so you'll follow the advice above and under then say disable program and the or else would be to enable the program.
oberkc Posted February 5, 2019 Posted February 5, 2019 7 hours ago, carealtor said: I want to be able to start and stop a program Not sure what this means. Do you want run THEN (start) or ELSE (stop) in a program? Do you want to initiate a program path that has a wait state (or loop) that you want to later stop? Enable or disable programs as suggested by lilyoyo1? 7 hours ago, carealtor said: Obviously (I think) the keypad buttons would be grouped together in a scene so they would turn on and off in unison. That is how I would do it 7 hours ago, carealtor said: Would I just pick one of the buttons (device) and use that in the program condition? I tend to pick a couple of the buttons in the scene as the canary. Keep in mind that (with all due respect to Mr Kohanin) I think you will need to use "status" rather than "control" in this case, just in case you use one of the scene buttons that is not specifically called out in your program. Of course, if your program condition includes ALL your buttons in the scene, "control" conditions could work: if ( control buttonA I s on or control buttonb is on or.....rest of buttons ) and ( control buttonA is not off control buttonB is not off or....rest of buttons ) then start program (whatever that means) else stop program (whatever that means)
carealtor Posted February 6, 2019 Author Posted February 6, 2019 (edited) 1 hour ago, lilyoyo1 said: Are you trying to enable/disable programs? If so you'll follow the advice above and under then say disable program and the or else would be to enable the program. 1 hour ago, oberkc said: Not sure what this means. Do you want run THEN (start) or ELSE (stop) in a program? Do you want to initiate a program path that has a wait state (or loop) that you want to later stop? Enable or disable programs as suggested by lilyoyo1? Yeah, "Start / Stop a program" does sound weird, and not really accurate. Really it is just run Then or Else branches of a program. So no, not enable/disable a program. Rather, "on" would run the "then" which would be (for example) a series of NR calls to turn some things on, and "off" would run the "else" which would be a series of NR calls to turn things off. Thanks for all the advice from all. I'm going to group the buttons in a scene and use the Status from one of the buttons and that should work well in my situation. Edited February 6, 2019 by carealtor
oberkc Posted February 6, 2019 Posted February 6, 2019 36 minutes ago, carealtor said: Thanks for all the advice from all. I'm going to group the buttons in a scene and use the Status from one of the buttons and that should work well in my situation. It should work great. The only problem I see is if there are communication problems. If not, it'll work great. Make sure you use "status" for the button you choose. 1
Recommended Posts