I understand the frustration of learning some new system that is different than what you are familiar with. In fact, when I selected HG, I was picking it because it was the best option of what was available that fit all of my needs. It is not the best programming environment IMO, but at the time it was far superior to everything else that was available that met my needs. I am certainly not an expert, but based on those in this forum I suppose I'm probably close to that (though Gene is here, so I think I dropped quite a bit recently
).
I have a minor in computer science, but only program periodically as a "hobby". It's really just to get things working that I find no other solution for. The code I posted at GitHub is not all mine but I made sufficient modifications to it to make it worth archiving for others. In fact, my "Advanced Smart Lights" code is based on Gene's "Smart Lights" which he then updated to what is currently available (possibly spurred by my code, who knows).
The point is, I couldn't find something I wanted and so I learned just enough to get it working the way I wanted. All I was suggesting is that AHP is really a terrible language that takes tons of macros interwoven together to make even simple things work. If pseudo-code can be written to do a task then it can be implemented in other languages. You will have a very difficult time converting AHP macros to any other HA system because of how convoluted it is IMO. You could certainly prove me wrong and I'm fine with that, but I personally would recommend considering what you actually want to do rather than directly porting it to HG or any other system.