Notification delay not working as expected

I’m trying to send a notification later in the day for when there is a trash pickup.
I’m watching the entity tomorrow_s_trash_pickup.
The moment there any change (usually at night 00:00) i trigger the action. But i have added a delay thinking the notification would be delayed. And that is not the case. I get the notification at midnight…
Maybe i’m overlooking something but there isn’t a way to set a fixed time for the notification to be send?

trigger:
  - platform: state
    entity_id:
      - sensor.tomorrow_s_trash_pickup
condition: []
action:
  - action: notify.notify
    metadata: {}
    data:
      message: A collection is scheduled tomorrow
      title: 'Waste Collection: {{ states(''sensor.next_trash_pickup'') }}'
      data:
        actions:
          - action: URI
            title: Open Recycle
            uri: /new-dash/0/#soppel
  - delay:
      hours: 10
      minutes: 0
      seconds: 0
      milliseconds: 0
mode: single

Hi, welcome to the forum!

You could change the trigger to fire at 10am and as a condition the sensor trash pickup.
Creating an automation with such a big delay is not the best way.

I’m not endorsing this method, but your code is backwards that is why it didn’t work.

trigger:
  - platform: state
    entity_id:
      - sensor.tomorrow_s_trash_pickup
condition: []
action:
  - delay:
      hours: 10
      minutes: 0
      seconds: 0
      milliseconds: 0
  - action: notify.notify
    metadata: {}
    data:
      message: A collection is scheduled tomorrow
      title: 'Waste Collection: {{ states(''sensor.next_trash_pickup'') }}'
      data:
        actions:
          - action: URI
            title: Open Recycle
            uri: /new-dash/0/#soppel
mode: single

But as Nick says trigger on 10:00 and check the state of the sensor

trigger:
  - platform: time
    at: "10:00:00"
condition:
  - condition: state
    entity_id: "sensor.tomorrow_s_trash_pickup"
    state: true # change to what the state of the sensor is
action:
  - action: notify.notify
    metadata: {}
    data:
      message: A collection is scheduled tomorrow
      title: "Waste Collection: {{ states('sensor.next_trash_pickup') }}"
      data:
        actions:
          - action: URI
            title: Open Recycle
            uri: /new-dash/0/#soppel
mode: single

Thanks for the reply. I changed the code so now i have

trigger:
  - platform: time
    at: "11:02:00"
condition:
  - condition: state
    entity_id: sensor.tomorrow_s_trash_pickup
    state: >
      {{ states('sensor.tomorrow_s_trash_pickup') not in ['unknown',
      'unavailable'] }}

The automation fails at the condition. When i test the state it return ‘true’ so i’ not sure what’s wrong.

Edit: nvm i changed the condition to template instead of state. And now the notification works perfectly!

I think you’ve got that template wrong.
Test it in the developer tools.