Automation help - brightness based on time, 10 zigbee lights

Hi is there a way to make this automation short?
I’ve got 10 zigbee lights and would like to control the brightness based on time.
So for instance when someone puts on the light and it’s between 8 and 9pm, it must light to 90%. Between 9 and 10pm 80 procent and so on…

Ive started with this but it’s getting too long when I add more lights and conditions. There must be a shorter way to do this right?

  - platform: device
    type: turned_on
    device_id: 9950468ce73d892d4a5d744ec004e1ca
    entity_id: 96b1d25613fee70406f89c509c7b05b5
    domain: light
condition: []
action:
  - if:
      - condition: time
        after: "19:00:00"
        before: "20:00:00"
    then:
      - if:
          - condition: device
            type: is_on
            device_id: f8eb2048b807abbdcf850a847f1a8158
            entity_id: 6739e6fc62201939c5146e1e3edb7d65
            domain: light
        then:
          - service: light.turn_on
            data:
              color_temp: 500
              brightness_pct: 50
            target:
              device_id: f8eb2048b807abbdcf850a847f1a8158

First, don’t use device ids - they make things longer and harder to follow.

Why and how to avoid device_ids in automations and scripts.

Thanks for the suggestion. I’ve changed it to entity id so it’s readable now. I’ve got the same question though. There must be a shorter way to do this? Because I only included 2 lights. there are more… and also I want to define more moments in time

alias: Light brightness based on time
description: ""
trigger:
  - platform: state
    entity_id:
      - light.haleersteverdiepinglamp
      - light.halbeganegrondlamp
    to: "on"
condition: []
action:
  - if:
      - condition: time
        after: "19:00:00"
        before: "20:00:00"
    then:
      - if:
          - condition: state
            entity_id: light.haleersteverdiepinglamp
            state: "on"
        then:
          - service: light.turn_on
            data:
              color_temp: 500
              brightness_pct: 50
            target:
              entity_id: light.haleersteverdiepinglamp
      - if:
          - condition: state
            entity_id: light.halbeganegrondlamp
            state: "on"
        then:
          - service: light.turn_on
            data:
              color_temp: 500
              brightness_pct: 50
            target:
              entity_id:
                - light.halbeganegrondlamp
  - if:
      - condition: time
        after: "20:00:00"
        before: "21:00:00"
    then:
      - if:
          - condition: state
            entity_id: light.haleersteverdiepinglamp
            state: "on"
        then:
          - service: light.turn_on
            data:
              color_temp: 500
              brightness_pct: 35
            target:
              entity_id: light.haleersteverdiepinglamp
      - if:
          - condition: state
            entity_id: light.halbeganegrondlamp
            state: "on"
        then:
          - service: light.turn_on
            data:
              color_temp: 500
              brightness_pct: 35
            target:
              entity_id: light.halbeganegrondlamp

So for instance what I’m trying to achieve

Light 1 OR light 2 … etc goes on: 6 pm: brightness 10%
Light 1 OR light 2… etc goes on: 7 pm: brightness 20%
Etc…so the brightness depends on which light goes on and on what time