Using 'time of day' binary sensors to evaluate actions in a service template

Hello all, fairly new to Home Assistant and I have a SmartThings multipurpose sensor (controlled through hub using SmartThings Integration) controlling 2 Hue lights using its hub and integration. I’m trying to setup 1 automation to turn on the lights in the bathroom to a specific scene when the sensor is closed, depending on the time of day.

To do that, I setup binary sensors defining different time ranges throughout the day based on my own schedule and have referenced them below along with my automation config. I’m using scripts to cut down on the code in my automation and so I can re-use certain scenes elsewhere.

I ran the template itself through the template creator and it spits out the script it should run based on the time of day. I can get the sensor to trigger simpler automations and when triggering this automation from the UI, it runs the correct script depending on it’s time of day. I feel it’s how I have the service_template setup but can’t seem to figure that out. Thanks in advance for any help provided!


HA - config

Just realized in all my troubleshooting, I missed the initial condition that would prevent this automation from running outside the defined time. and for some reason the way I was editing this added a bunch of extra quotes which exacerbated my problem. here’s the cleaned up version if anyone is interested.