I live in Sweden which has very dramatic changes in light levels over the year.
Normally I would trigger an automation at 19:00 (I have a time helper called ‘evening’) but I need this to trigger earlier if sunset has started. I use this to set lighting scenes in the house.
I’d like to avoid repeating the same logic for every automation trigger. I have some basic knowledge of template sensors but I don’t know how to compare times (or get the current sunsetStart
time.
Something like:
if sunsetStart > 19:00 then return 19:00 else return sunsetStart
Can someone please point me in the right direction?