Need help with automation(condition)

I have an automation that fires even though it does not meet the requirement condition from this time to that.

  • alias: test
    id: ‘1497102620535’
    trigger:
    • entity_id: binary_sensor.this_door
      from: ‘off’
      platform: state
      to: ‘on’
      condition:
      condition: time
      after: ‘21:00:00’
      before: ‘09:00:00’
      action:
    • alias: txt me
      data:
      event: DoorOpen
      service: ifttt.trigger
    • alias: call me
      data:
      event: ThisDoor
      service: ifttt.trigger
    • alias: call mom
      data:
      event: ThisDooor
      service: ifttt2.trigger```

it should only fire after 9pm and before 9am but this doesn’t seem to be the case.
Any help would be appreciated.

I haven’t tested this, but my assumption is that there is no wrap-around on the clock.
Therefore, there is no time that is both AFTER 21:00 and BEFORE 09:00
Try changing them to separate conditions with an “OR”.

condition:
  condition: or
  conditions:
    - condition: time
      after: '21:00:00'
    - condition: time
      before: '09:00:00'

Thank you that seems to have worked. I have been beating my head on that one for a while and just fyi for anyone else the examples in automation’s doesn’t show them separated like that.

Update: did not actually work as designed as now this automation wont fire after 9pm now.

update 2: issue found and fixed – somehow i got into the wrong timezone in the main config. fixed and working properly ty for your help.