Condition to exclude a time frame

Are the following two conditions identical?

- condition: time
  after: '09:10'
  before: '05:50'

- condition: not
  conditions:
    - condition: time
      after: '05:50'
      before: '09:10'

I would have thought so but trying the first one didn’t give expected results. I therefore switched to the negated one which works as intended.

Lightbulb moment! Is it doing a logical AND in the first case, which, for the same day is not possible?

Andi in fact needed to do the following, right?

condition: or
conditions:
  - condition: time
    before: '05:50'
  - condition: time
    after: '09:10'

No, time condition windows (before and after) can span midnight. The docs explain it < Conditions - Home Assistant>.

1 Like

Indeed, thanks. Not sure what went wrong before as I successfully reverted to the initial condition.