My automation only runs when switched on - not if already on over the change in time period

Had a spare few mins at my computer today, so put together how you could do this in a single automation. There maybe slightly better ways, but wanted it to be fully automation UI compatible for you. As such, you can select view in YAML, paste this in and then go back to view in Visual Editor. You will obviously need to change device_ids/entity ids etc.

EDITED: Sorry slight logic issue and used light.turn_on service as it reads much cleaner in yaml to help understand what is happening.

alias: Lounge Light Brightness By Time
description: |-
  If light turned on between 19:00 and 06:00, only turn on at 30%
  If light turned on at other time turn on at 100%
  If light on at 19:00, dim to 30%
  If light on at 06:00, set to 100%
trigger:
  - platform: device
    type: turned_on
    device_id: 95c4891f8fbafcfb898b84c72125c92d
    entity_id: light.lounge_main_light
    domain: light
    id: LightOn
  - platform: time
    at: "19:00:00"
    id: Night
  - platform: time
    at: "06:00:00"
    id: Morning
condition: []
action:
  - if:
      - condition: trigger
        id: LightOn
    then:
      - if:
          - condition: time
            after: "19:00:00"
            before: "06:00:00"
        then:
          - service: light.turn_on
            data:
              brightness_pct: 30
            target:
              entity_id: light.lounge_main_light
        else:
          - service: light.turn_on
            data:
              brightness_pct: 100
            target:
              entity_id: light.lounge_main_light
  - if:
      - condition: and
        conditions:
          - condition: trigger
            id: Night
          - condition: state
            entity_id: light.lounge_main_light
            state: "on"
    then:
      - service: light.turn_on
        data:
          brightness_pct: 30
        target:
          entity_id: light.lounge_main_light
  - if:
      - condition: and
        conditions:
          - condition: trigger
            id: Morning
          - condition: state
            entity_id: light.lounge_main_light
            state: "on"
    then:
      - service: light.turn_on
        data:
          brightness_pct: 100
        target:
          entity_id: light.lounge_main_light
mode: single