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: ""
  - platform: state
      - group.somebody_home
    from: not_home
    to: home
  - condition: sun
    after: sunset
    after_offset: "-01:00:00"
  - condition: time
    before: "00:30:00"
  - service: light.turn_on
    data: {}
      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: