Hey guys i’ve just started getting into Home assistant and need some help with an automation. I have 4 lights in my living room i want to turn on 30-40 minutes before sunset. I set a sunset automation up and it starts up but when i put in a offset the lights don’t turn on. Not sure i’m doing it right.
If there isn’t an offset option with the sunset/sunrise options, you might not be able to do an offset.
If that’s the case and what you’re trying to do is have something happen when it actually gets dark, you could look at the Azimuth the Sun integration provides and have it trigger when the sun is below the horizon. The other option is to look at the Sun2 integration:
IT has dawn and dusk options that already figure all that out.
The first automation you have posted only triggers when an occupancy sensor turns on… that’s it. If you need it to trigger based on sunset, you need to add a trigger for that. An automation can multiple triggers, so if you want both occupancy and sunset to trigger it, use them both… just make sure to mirror them in the conditions block as follows: