Sunrise Condition is true but should be false

Hey out there. I have an automation that sets the shutter to 60 percent when several conditions are met. Today the action was performed but it shouldn’t. The automation was triggered and the condition “time before sunrise” with an offset of 1800 sec resulted into true. See below:

## if/condition/1/conditions/1
Executed: 7. August 2022, 06:04:22
Result:
wanted_time_before: '2022-08-07T04:13:36.682126+00:00' result: true

My whole condition:

if:
  - type: is_open
    condition: device
    device_id: 6083cc10783baef454b5d29a7fd8317b
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_8f4c4d03_on_off
    domain: binary_sensor
  - condition: or
    conditions:
      - condition: sun
        after: sunset
        after_offset: '2700'
      - condition: sun
        before: sunrise
        before_offset: '1800'
then:
  - device_id: ad4b1aed4f6740adc5a7ad761afdb2a8
    domain: cover
    entity_id: cover.rolladen_vanessa
    type: set_position
    position: 60

What went wrong? I checked the timezone and also my location. Both is correct.

Have another look how these should be defined:

What you have is not correct. There are examples here:

https://www.home-assistant.io/docs/scripts/conditions/#sunsetsunrise-condition

Thank you Tom.

so I define the offset with

after_offset: "-01:00:00"

What offset do you want?

I want 45 min after sunset and 30 min before sunrise.

so it should be

before_offset: "-00:30:00"
after_offset: "00:45:00"

Yep that should do it.