WTH CAN'T we add an offset for the time condition, but we CAN add an offset to the trigger?

When creating an automation, I added a trigger for a specific time, for example Sun Setting, but with an offset of -2 hours for my lights.
However, I can’t do the same thing for the conditions, so when I want to check if the time is 1 hour before sunset, I simply can’t and have to create a helper to achieve the same thing.

It makes things very complicated :wink:

Condition in the automation:

Trigger for the automation:

Use the sun condition, you can offset that.

1 Like

Oh wow I did not know that existed!

However, this is only for this scenario, there are other ways this could be useful, for example we have more sensors then only sunrise and sunset, for example dusk.

my usecase:

      - condition: time
        before: '23:00'
        after: input_datetime.alarmclock
        offset: -00:30:00

changing the alarm clock frequently, makes using the hard coded alternative

      - condition: time
        before: '23:00'
        after: '06:00'

rather annoyingly inaccurate, especially given the fact this is used in an energy saving automation, where the actions need to be as close to the alarm clock minus that offset as possible.

Heck, I now see this is a WTH, and not a FR… will open that if not yet existing, see FR. add offset to time condition

1 Like