Help needed setting up a routine to turn Lights ON/OFF every 30 minutes

Hi All

I need some help setting up lights ON/OFF every 30 minutes. This is what I have done but it is not triggering:

Steps are:
Trigger:
When Sun elevation is below 3.5 degrees
or when everybody leaves home for more than 5 minutes
or/and trigger Lounge Light every 30 minutes

Condition:
Everybody is away
Time is between 17:00 and 22:00

Action:
Delay: random time between 6 and 12 minutes
Toggle lounge light input boolean
Delay: random time between 6 and 12 minutes
Toggle lounge light input boolean

  alias: 2113 - Lounge Light ON/OFF @ Sunset when NO ONE is at Home or everyone leaves home
  description: 
  trigger:
  - below: '3.50'
    entity_id: sun.sun
    platform: numeric_state
    value_template: '{{ state_attr(''sun.sun'', ''elevation'') }}'
  - entity_id: binary_sensor.somebody
    for: 00:05:00
    from: 'on'
    platform: state
    to: 'off'
  - minutes: /30
    platform: time_pattern
  condition:
  - condition: state
    entity_id: binary_sensor.somebody
    state: 'off'
  - after: '17:00:00'
    before: '22:00:00'
    condition: time
  action:
  - delay: 00:{{ '{:02}'.format(range(6,12) | random | int) }}:00
  - data: {}
    entity_id: input_boolean.light_lounge
    service: input_boolean.toggle
  - delay: 00:{{ '{:02}'.format(range(6,12) | random | int) }}:00
  - data: {}
    entity_id: input_boolean.light_lounge
    service: input_boolean.toggle