Need help on time / wait

Hi,
I just wanted to made a simple automation, like this:

  • trigger on sunset
  • do action 1
  • wait until 22:00
  • do action 2

but did not find a proper way to implement this, tried with:

  - wait_template: '{{ states.sensor.time.state <= ''22:00'' }}'

no success, then double checked in templates and got an error, so
was only able to check a fix time with == but no success when using <= or >=
what is goning wrong here (error msg: TemplateSyntaxError: expected token ‘end of print statement’, got ‘=’) ?

{{ states.sensor.time.state == '22:00' }}        # works (true/false)

{{ states.sensor.time.state <= '22:00' }}       # does not work 

Thanks - Dave

What about adding a delay: '00:20:00' between the 2 actions.

Thank you, that’s the simple solution a had in mind, but as the first trigger is mostly based on sunset (= not a fixed time) and the 2nd one should be at a fixed time it does not properly work for me. Thanks