Time condition not working

Hi,

For some reason, the following automation is never triggered. However, when I take out the time condition, I receive notifications. Does anyone know why the time condition is never met?

- alias: Commute delay evening - Jeroen
  trigger:
    platform: numeric_state
    entity_id: sensor.home_to_work
    above: 10
  condition:
    - condition: time
      after: '17:45:00'
      before: '18:00:00'
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
    - condition: state
      entity_id: switch.alert_delays__jeroen
      state: 'on'
    - condition: state
      entity_id: device_tracker.jeroensiphone
      state: 'not_home'
  action:
    service: notify.notify
    data_template:
      message: >
        Commute delay of {{ trigger.to_state.state|round }} minutes, which is highter than usual.
      target:
        - +00000000000

I think you need a few extra lines, like this:

condition:
  condition: and   
  conditions:
    - condition: time
      after: '17:45:00'

This might also be useful for error checking:
hass --script check_config

Hi, tried that, but no change.

The time condition still doesn’t get triggered.

Can you explain what you want your automation to do?

@jorisvansoest and is default, so that lines are not necessary.

That sensor returns the time it takes me to get home from work. I want a notification if it’s higher than 10 minutes, between 17:45 and 18:00 (this is the time I usually leave at work). It is not supposed to send a message when I’m already home. There is also an mqtt powered switch which allows me to disable the alerts (for example, when I’m on holiday).

Like I explained, the notification part works. It’s only the schedule part that never seems to trigger.