Condition: If it is between 1 hour before sunset and 0030 (Combining sun and time condition)

Hi guys, I am trying to turn my lights on when I come home. I only want the lights to come on when it is after sunset (with an offset of -1 hour) and before 0030 at night. I am trying to combine the sun and time condition but I cant get it to work. I have tried if the trigger and action work on their own and they do. So the problem lies within the condition.

This is how it looks now:

alias: Test
description: ""
trigger:
  - platform: state
    entity_id:
      - group.somebody_home
    from: not_home
    to: home
condition:
  - condition: sun
    after: sunset
    after_offset: "-01:00:00"
  - condition: time
    before: "00:30:00"
action:
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.gk_lampen
mode: single

What am I doing wrong? Thank you in advance!

Conditions only work on the current day, ie midnight to midnight.

There is no time in any one day that is both before 0030 and after sunset on the same day.

I think if you or your conditions it will work. Like the first example here

Thanks for the quick response and the solution! It works now :grinning: