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?
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