I for the life of me cannot figure out how to do what you have done, I must be missing something BIG, and probably because I'm a rookie at macros. Can I convince you to post your macros so that I can study them and make it work for my application?
The only reason I have never posted the actual "timer macro(s)" is because I have a couple other devices running in it I have never mentioned.... I am not sure the actual list of devices triggered would be any less confusing.
I worked on the "macro" for few days before I realized, that a single macro can't do very much. So I broke down each operation into its own separate macro. I ended up with FOUR macros to create my timer. Two of the macros are conditional macro (if this is ON, then turn that ON, or if this off, turn that off).
I used fathom or "ghost" modules.
For AHP to know if a module is ON or OFF it must be a monitored module.... AHP remembers the status of the monitored modules. The house codes I used for my timer wasn't in the monitored house code, so I had to turn ON (and off) "ghost" modules that became the conditions in the conditional macros.
It is only complicated.... if you try to do it in a limited number of macros. Once you think about the simple separate steps involved, in the 3 or 4 macros, it gets easier.