BHWMDJ Posted December 22, 2018 Share Posted December 22, 2018 I have a button "D" on an 8 Button Key Pad LInk, that when on, will trigger a series of programs to run until it is turned off. Is it possible to write a program in ISY which will wait 10 days after the button is turned on and then turn it off? Thanks Link to comment
mwester Posted December 22, 2018 Share Posted December 22, 2018 (edited) Well, yes. In general. There are a lot of other considerations for a delay this long (many of which we can safely skip over when dealing with short delays) which make this more complex than the usual "wait" operations. So, in no particular order, here's a list of questions that might impact the answer: Is the goal just to turn the button itself off, or is it do stop operation of the programs that the button started as well? What is the impact (in terms of cost, inconvenience, possible property damage, etc) if the button is NOT turned off? Same, but if the button is turned off early? What's the acceptable delta for the delay (i.e. must it be plus or minus one day, one hour, one minute, or one second)? What bad things happen if the delta is outside the acceptable range? What external factors might affect the 10 day delay (e.g. power failure to the building, human operating a power switch elsewhere, etc)? What should be the correct behavior in the face of the various external factors (e.g. should the timer be restarted when the ISY reboots after a power failure, or should the timer be reset on the assumption that the button is also off and all programs are reset, or does some other action need to happen to alert someone that a "short cycle" may have happened)? This may sound excessive, but as an example of why this is important, I have a timer for my ice-melting cables on the roof, and a set of timers that monitor my septic lift pump. The former is a really simple timer program 'cause the downside is trivial -- the latter, however, has some very real consequences if it goes wrong, so that is actually a set of programs (and a bunch of relays and other hardware to act as a final backstop if the logic or ISY or Insteon fails)... Edited December 22, 2018 by mwester Link to comment
oberkc Posted December 22, 2018 Share Posted December 22, 2018 A simple method would simply be to initiate a pogram which increments a variable by one each day. When the variable reaches ten, do something. Whether or not this meets yo needs could depend on what you mean bt “10 days”. If you mean exactly 240 hours from the time you press the button, it might take a little more effort. If you simply mean to do something at a fixed time on the tenth day, this simple method might work. Link to comment
BHWMDJ Posted December 23, 2018 Author Share Posted December 23, 2018 This is set up in a cabin which I am at only 10 days at a time, every few months. When I get there. I push button D on my key pad link. The button lights up and enables the following programs to run: 1. turns thermastat terms to desired temperature 2. turns hot water circulator on. 3. turns instant hot water on 4. sets new lighting schedule for cabin at night. When I leave the cabin 10 days later I push the D button again and the button light turns off and it disables the above programs from running. The problem is that I forget to hit the D button when I leave sometimes. and then the programs continue to run. there is no danger in them running other than it costs a lot in electricity. There is no harm in it turning off earlier than 10 days if I leave earlier. I would like it to turn off 240 hours (or days) after the D button is pushed which would coincide with my departure 99% of the time. If the D button is on, and there is a power failure, I am not sure if the D button is reset to on or off when the power comes back on, It has never happened. I would assume that when the power came back on the D button would still be on. If so, can the timer just continue from where it left off? If not probably the best thing would just be to have it turn off the D button on rebooting. Hope this info helps Link to comment
oberkc Posted December 23, 2018 Share Posted December 23, 2018 Given what you describe, I think I would be happy to assume that I am leaving the cabin at approximately the same time each visit and turning off D button at the same time on the 10th day. Whether that is in the morning or evening or whatever, a simple approach would work. Given that you already have some programs working, I will also assume you have an understanding of programming with the ISY and are seeking an approach, rather than the exact steps and syntax for the specific programs. I would take the approach as I originally suggested. First, create a variable (probably would use a state variable here) that is to be used to count days since pressing the button. For these purposes, I will call it "daycount". Second, I would create a program which would increase the daycount variable by 1 each day. Third, I would create a program that would watch for status of D button. If D was ON, I would then enable the program created in the second step. If OFF, disable that program and reset the variable to zero. Finally, I would create a program which would, at a fixed time each day, check the variable value and, if = or greater than 10, turn off D button. 1 Link to comment
Recommended Posts