Negative offsets and after_offset

Okay, this might be a stupid question, but I’m gonna ask anyway :slight_smile:

What is the difference between:

 - condition: sun
        after: sunset
        after_offset: "-00:45:00"

and

 - condition: sun
        before: sunset
        before_offset: "00:45:00"

Why do all examples seem to use the negative after_offset syntax, instead of the more intuitive before_offset syntax?

1 Like

The first one is the period of time 45 mins before sunset going towards the next day.
The second one is the period of time from the beginning of the day till 45 minutes after sunset.

The condition is true during the time period…not the moment it happens.

1 Like