Automation conditions

Hi
Trying to setup a automation based on multiple conditions.
I want to, if the clock are after 13 and it is a workday if the lightsensor are set to on to turn on the lights.
If the lightsensor are off nothing should happend but if the conditions above are fullfilled and the lightsensor turns on, the light will do the same
is it possible?

  - alias: 'skoldag'
trigger:
  - platform: state
    entity_id: group.skoldag
    to: 'home'
condition:
  - condition: time
    after: '13:00:00'
  - condition: state
    entity_id: 'binary_sensor.workday'
    state: 'on'
  - condition: state
    entity_id: 'binary_sensor.lightsensor'
    to : 'on'
action:
  service: scene.turn_on
  entity_id: scene.uppe_on

At a quick glance, your last condition should be state: โ€˜onโ€™ not to: โ€˜onโ€™

Like this?

alias: 'skoldag'
trigger:
  # Prefix the first line of each trigger configuration
  # with a '-' to enter multiple
- platform: state
  entity_id: group.skoldag
  to: 'home'
condition:
- condition: and
  conditions:
- condition: time
  after: '13:00:00'
- condition: state
  entity_id: 'binary_sensor.arbetsdag'
  state: 'on'
- condition: state
  entity_id: 'binary_sensor.ljusensor'
  to : 'on'
action:
  service: scene.turn_on
  entity_id: scene.uppe_on

yeah but your last one still has to: 'on' , change that to state: 'on'

also, conditions are automatically โ€˜andโ€™ so you dont need that and statement, simply list then all

alias: 'skoldag'
trigger:
  # Prefix the first line of each trigger configuration
  # with a '-' to enter multiple
- platform: state
  entity_id: group.skoldag
  to: 'home'
condition:
  - condition: time
    after: '13:00:00'
  - condition: state
    entity_id: 'binary_sensor.arbetsdag'
    state: 'on'
  - condition: state
    entity_id: 'binary_sensor.ljusensor'
    state : 'on'
action:
  service: scene.turn_on
  entity_id: scene.uppe_on

It may help if you can think of it like the difference between the trigger and the condition.

The trigger only happens when something changes state from something to something else.

The condition then checks what the actual state of the entity is at that moment in time and decides if the automation can continue. Itโ€™s not looking for a change in state but just what the state is now.

Thanks! hope it works now :slightly_smiling_face: