Sunrise-related logic


(A newbie here)

I am quite new with OpenHAB2 - playing with it for a few days now.
Currently working for a few years with Vera and PLEG, and trying to define my logic with OpenHAB2 over Pi.

In my old controller, I have a lot of logic based on sunrise / sunset times.
For example:

  • When sleeping with a window shutter open - close it 45 minutes before sunrise.
  • Set a Light / dark hours switch - from 1 hour after sunrise to 1 hour before sunset.

How would you recommend implementing it with OpenHAB2?

  • Create an Astro binding Thing with an offset for every required schedule?
  • Create 1 Astro binding thing for the earliest before-sunrise / before-sunset required timing, and use timers (or expire binding) to trigger events based on other offsets? (for example: an astro binding with an offset of 1 hour before sunrise, and when it is triggered, a timer will used to trigger the 45 minutes before sunrise logic)
  • Something else?

Thanks in advance.

That one