Also remember that HAs sun integration was bugged from using the elevation value on the user setting page.
The elevation in the sun algorithm is the elevation from the actual surface and not from the sea level.
But sunrise and sunset is based on the latitude, longitude and elevation in the user settings.
The problem is that the elevation is used wrongly, so if you have like 500m in elevation in the settings, because your position is that high over the sea level, then the sunrise and sunset will be off by a lot.
There is a thread on the forum about it.
I think OP is in the Netherlands and highest point is 322.7 m above sea level (average 30m).
so just change the trigger to sun elevation and and adjust the level to whatever they want to that corresponds to a level of sunlight that they want light to be switched off based on what the sensor.sun_solar_elevation is at.
I am assuming the OP wants the light to turn off when it gets light rather than just to be alerted when it’s sunrise by the light being turned off.
Templates are new te me. I am seaching how to start with Home Assistant. It takes some time to become familiar with the most important features of this large program. For sure Templates will be a nice tool. I’ll take lookt at it now.
Thanks for Your help.
The kernel of my question has been resolved in adding the right offset to sunrise/sunset. The lights outside and the roller shutters are now working fine. Next step is reading how to do this in a better way.
The purpose the templates I provided you was to simply confirm that the times reported by your system (current time and sunrise) were correct. I wasn’t suggesting that you use templates in your automation’s trigger.
Because if either of the two times is incorrect, the Time Trigger and Sun Trigger will never work properly for you and force you to use offsets to fix them.
If either time is incorrect, you need to check the timezone you have set in Settings → System → General.