Help with condition, automation

Hello.
I want a condition who turn on the light if the clock has past the time (18:00)
the problem is if the sensor is already activated when the time comes nothing happens…
I have indent/outdent? “from” because i thought that would do the trick…
Automation:

- alias: Nere_on 18
  hide_entity: false
  trigger:
    platform: state
    entity_id: binary_sensor.ljusensor
#    from: 'off'
    to: 'on'
  condition:
    condition: time
    after: '18:00:00'
    before: '22:00:00'
  action:
    service: scene.turn_on
    entity_id: scene.nere_on

// Marcus

So, you’re saying, in addition to turning on the scene when the binary_sensor turns on between 18:00 and 22:00, you also want it to turn on at 18:00 if the binary_sensor is on at that time. Is that right?

If so:

- alias: Nere_on 18
  hide_entity: false
  trigger:
    - platform: state
      entity_id: binary_sensor.ljusensor
      to: 'on'
    - platform: time
      at: '18:00:00'
  condition:
    - condition: time
      after: '18:00:00'
      before: '22:00:00'
    - condition: state
      entity_id: binary_sensor.ljusensor
      state: 'on'
  action:
    service: scene.turn_on
    entity_id: scene.nere_on

yes exactly
ahhh you made the code, thanks alot !!
I didnt see it first :slight_smile: