This should be in #community-guides, not #configuration. Other’s cannot add modify the templates, and some of the calls you have will lead to unexpected results. Just starting off, you have an issue in the 1st and 3rd template. You’re filtering out light groups in the ‘on’, but not the total and ‘off’. Making the 3 numbers not add up to each other.
This will end up like that epic time thread where most of the templates are outdated when the template methods are ultimately updated and made easier. Thanks for moving it, now anyone can edit the post and add/change the templates to work. I still can because I’ll lock everyone else out from editing because I’m a moderator. Not sure why that happens, but it does.