I have an ISY 99 with various insteon switches and outlets. I've gotten simple programs to work, but am not having much luck with more ambitious projects. There are two basic things I'd like to do:
1. Include multiple options depending on different conditions. I don't know if this is possible, or if you need to write a seperate program for each option, but here is what I'd like to do: I have an evening program that evaluates conditions, and then turns lights on. Depending on conditions, I would like it do different things. For example: The program is activated when the door switch (connected via EZIO) is activate, AND its after sunset AND the lights are not already on. So far so good. But, if the thermostat is still in daytime mode, I'd like to kick it into evening mode. And if the some of the lights are already on, I would like to run a limited version of the program (just hallway lights). I could do seperate programs for each of these actions, but I'd be duplicating a lot of code, and it's not a very elegant solution. Is this sort of thing possible?
2. Run a series of events without re-evaluating the initial conditions. So, taking the evening program: It activates when the door is opened and the lights are all off. So far so good. Then it slowly adjusts the lighting from "bright so I don't trip on stuff in the hall" to a more mellow, evening lighting. When it re-evaluates the initial conditions, now the lights are on, so the program stops. OK, I found a "hack" way around this. I set the program to turn one of the lights to an odd value - e.g. living room to exactly 97%, and then include this value as an "OR" under the original conditions. Since its very unlikely that I would accidently set the living room lights to exactly 97% when I'm home, it works ok. But is not very elegant. I was thinking of trying to use a variable to solve this but am having some difficulty. My thought was (this is just the logic, not code)
IF (door open, lights off, after sunset, etc)
OR IF (Variable "ImHome" = 1)
THEN:
Set Variable "ImHome" = 1
Set initial light
WAIT
Change lighting
WAIT
Change lighting again
Set Variable "ImHome" = 0
Seems logical to me, but doesn't work.
Any comments welcome!