Is your DUSK trigger from a timer or a sensor? What and where is is flag 2 ever set? While I think I follow the logic of what you're trying to do, I'm not clear yet what you're trying to do.
DUSK is a timer.
What I'm doing is turning on an outside light at dusk for 2 hours. However, sometimes I don't want want it to turn off after 2 hours. To do this I put in a command on a wireless pad that turns on a phantom unit, which triggers a macro that sets flag number 2. So at the end of the two hours the light is either turned off or stays on depending on the setting of flag #2.
Thanks to your help, I think what I have now is working. This is what I have:
Macro #1 (Triggered by DUSK timer)
Turn on K2
Delay 2 hours
Turn on P2 (Phantom)
Delay 1 second
Turn off P2 (Phantom)
Clear Flag #2
Macro #2 (Triggered by P2 on)
Conditional on Flag #2 being off
Turn off K2
As I said, I think this works, but it hasn't been fully tested.
Sometimes I think a programming background is a handicap to programing in AHP
I have found that to be true, but I'm slowly getting the hang of this.
I've been doing this less than a week and I have 15 Macros, 6 Timers, 2 Phantom modules, and 3 Flags.
It was a bit frustrating at first, but now it's getting to be fun. My DS10A now sounds the chime if my garage door is left open more than an hour (and every hour after that). I think I'll swap the chime for a wave file in my next experiment.
Ken
===