Shorten condition statement

I have a working automation which at this point in time is easy to handle as I only use 3 sensors for that specific automation, though I would like to make it more scaleable. I managed to convert my action trigger and the brightness setting to templates, however I am miserably failing to do the same on the condition part of my automation:

So could someone please point me into the right direction, ie. how to bring together the three conditions looking at the numeric states of three sensors into one template statement:

- id: '1'
  alias: Treppenhaus Licht an bei Bewegung
  trigger:
    platform: template
    value_template: '{{ is_state(''binary_sensor.presence_5'', ''on'') or is_state(''binary_sensor.presence_7'',
      ''on'') or is_state(''binary_sensor.presence_10'', ''on'') }}'
  condition:
  - condition: or
    conditions:
    - after: sunset
      after_offset: -00:30:00
      before: sunrise
      before_offset: +00:30:00
      condition: sun
    - below: '70'
      condition: numeric_state
      entity_id: sensor.lightlevel_6
    - below: '70'
      condition: numeric_state
      entity_id: sensor.lightlevel_8
    - below: '70'
      condition: numeric_state
      entity_id: sensor.lightlevel_9
  action:
  - data_template:
      brightness: '{% if now().hour > 1 %}120{% elif now().hour < 8 %}120{% else %}255{%
        endif %}'
      transition: '{% if now().hour > 1 %}30{% elif now().hour < 8 %}30{% else %}1{%
        endif %}'
    entity_id: light.treppenhaus_alle
    service: light.turn_on

THANK YOU SO MUCH ALREADY NOW! I hope soon to be contributing back to the community as I just recently started using Home Assistant and already became addicted :slight_smile:

  - condition: template
    value_template: "{{ (states('sensor.lightlevel_6')|float < 70) or (states('sensor.lightlevel_8')|float < 70) or (states('sensor.lightlevel_9')|float < 70) }}"

Ahhh. I was so close, just not close enough. Thank you Tom!!!

If your light sensors don’t have decimal places you can use |int instead of |float to slightly reduce resources required:

(states('sensor.lightlevel_6')|int

Thank you. Will try that right now to see if that works too. Thanks again to both of you for your help!