Automation - condition:time not sticking?

hi there,

i have 2 automation’s, one for ad daytime and one for add night. the scene’s are working, but when I trie to set them on condition:time it will not work.

I tried to put the condition time before and after the action.
i have no clue what im doing wrong? Probably its a wrong dot or space… but its frustrating.

- alias: zet lampen trap aan overdag
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_trap_occupancy
    to: 'on'
  action:
    - scene: scene.lampen_trap_overdag
  id: 082bea95981e4eda835ecf2ce7b528fe
  #
- alias: zet lampen trap aan nacht
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_trap_occupancy
    to: 'on'
  action:
    - scene: scene.lampen_trap_nacht

Which condition, I don’t see a condition.

helle sjee, this the code add the moment that’s working, I will edit the condition:time for example so you can see it, but its not working for me, give me a minute

- alias: zet lampen trap aan overdag
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_trap_occupancy
    to: 'on'
    condition: time
      after: '07:00:00'
      before: '21:29:00'
    action:
    - scene: scene.lampen_trap_overdag
  id: 082bea95981e4eda835ecf2ce7b528fe```

edit: i see I forgot the - infront of action but its there

Take a look at the examples in the docs It needs to be someting like this;

condition:
  condition: time
  after: '07:00:00'
  before: '21:29:00'

something like this then?

- alias: zet lampen trap aan overdag
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_trap_occupancy
    to: 'on'
  condition:
    condition: time
    after: '07:00:00'
    before: '21:29:00'
  action:
    - scene: scene.lampen_trap_overdag
  id: 082bea95981e4eda835ecf2ce7b528fe
  #
- alias: zet lampen trap aan nacht
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_trap_occupancy
    to: 'on'
  condition:
    condition: time
    after: '21:30:00'
    before: '06:59:00'
  action:
    - scene: scene.lampen_trap_nacht```

Yep, but I think your action doesn’t work like that, you need something like this.

action:
  - service: scene.turn_on
    entity_id: scene.lampen_trap_overdag

witte the service its not working

ok, as long as it works :joy: