Sun offset trigger does not work correctly

Hi folks

I have this automation:

alias: Markise Abends einfahren
description: ''
trigger:
  - platform: sun
    event: sunset
    offset: '-1:00:00'
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: cover.markise
        attribute: current_position
        state: '0'
action:
  - device_id: 6490b91c16facd09ac935223dbfa93d3
    domain: cover
    entity_id: cover.markise
    type: set_position
mode: single

The trigger triggers only at the nirmal sunset time and ignores the offset

Please help

If you remove the offset, does it trigger at sunset or 1 hour after sunset?

If it triggers 1 hour after sunset, there may be a problem with the configuration of your system clock (the timezone and/or DST for your location is incorrect).

Timezone is correct

So when you remove the offset it triggers exactly at sunset?

If it does trigger at sunset without the offset option, then it means both timezone and DST offset are correct and the problem may be due to the format of the offset value.

Try this instead (note the leading zero):

trigger:
  - platform: sun
    event: sunset
    offset: '-01:00:00'

If it still fails to trigger one hour before sunset, check the automation’s trace.

Oh, I see…

The HomeAssistant seems not to consider the Central European Summertime.

OK, that’s what I suspected; it’s not a problem with offset but with how the system clock’s time is handled.

Copy-paste the following into the Template Editor and confirm it reports the correct timezone information, timezone name, and DST offset.

{{ now().tzinfo }}
{{ now().tzname() }}
{{ now().dst() }}

Everything seems to be correct

Europe/Berlin
CEST
1:00:00

Did you manage to fix this?

I’ve exactly the same problem and we’re in the same timezone:

Europe/Amsterdam
CEST
1:00:00

Since we changed to DST, my automation triggers 1h15m before sunset, instead of the usual 15m.