What’s up community!
I have this automation that does not seem to be working as expected. I’m not finding anything jumping out of me in the traces for it either.
The automation is supposed to turn the lights on at Sunset and then off at sunrise only between February 8th through the 15th. It is not turning them on to begin with.
Your delay is completely wrong. A delay expects either a number (interpreted as seconds), a timestring, a dict containing individual time attributes (hours, minutes, seconds), etc.
Your template however is doing a comparison which will evaluate to true or false. When this is fed into the delay, it will be cast to a number and thus interpreted as either 1 or 0 seconds.
Your lights will turn on and then pretty much immediately turn off again, possibly so quickly that you will never see them turn on in the first place.
sun.sunrise is not real… which leads me to guess this is the product of a bullshit engine, so… sensor.time may or may not exist on your system, it must be added manually to your configuration. It’s not actually necessary to accomplish what you want, but you can find the configuration details at Time & Date integration
Prolonged delays are generally a bad practice. Use two triggers and branched logic or just use separate automations for on and off.
The following example turns on the light at sunset and turns it off 30 minutes later (adjust the time to suit your needs) for dates between February 8 and February 15