Sunset automation don't work

Hi folks, can someone help me with a sunset automation?
I would like to turn on some light when the sun goes down, this is my automation (sorry for italian languages):

lights turn on not at sunset but when sun is gone, aproximaly 1 hour later.
Have i to set an offset (like 1 hour before)?
Thanks in advance


Hi @wrappa

Are your settings correct in Settings > System > General?

Hi templeton_nash, yes, time and location are correctly set

Thanks @wrappa

Is your Home location correct in Settings > Areas and Zones > Zones?

yes it’s correct.
The day before yesterday i have tried to put a trigger like “when sun is at dusk” but in that case lights never turn on…

What is shown when you enter sun.sun in the “Developer Tools → STATES” entry?
This is my current result:

The times shown are in UTC time, so you currently have to add two hours to get the local time in Italy.
Please note the difference between next_dawn and next_rising and between next_dusk and next_setting.
Are your results as expected, or are these one hour early as well?

Thanks for reply, here is mine:

timing seems right, but i can see dawn and dusk, but not sunset.
If i check the sunset time on my dashboard it’s ok.

If i set lights to turn on @ dusk they will turn on too late (dusk is already dark), maybe i have to use the “setting” value, but how?

Sunset is called next_setting in the attributes.

You can add an offset to the automation trigger. See Sun trigger with info about An optional time offset.
This can be done in the GUI:

Thanks for your help, now i’ve tried to restart and reload yalm;
Tonight i’ll check if something is change, otherwise will set offset.

Restarting home assistano The light turned on at sunset!
Tks everybody