Trying to get the automation below to work, basically, I want to set the condition such that the automation only triggers if the dishwasher contact has been closed for between 2 hours and 2 hours and 15 mins. The below doesn’t seem to work.
alias: Dishwasher finished
description: ""
trigger:
- type: opened
platform: device
device_id: 59c0901a2ab618afd1d999f8a6bd92bd
entity_id: binary_sensor.dishwasher_contact
domain: binary_sensor
condition:
- condition: and
conditions:
- condition: template
value_template: >-
{{ now().timestamp() -
states.binary_sensor.dishwasher_contact.last_changed.timestamp() >=
1}}
- condition: template
value_template: >-
{{ now().timestamp() -
states.binary_sensor.dishwasher_contact.last_changed.timestamp() <=
8400 }}
action:
- service: notify.alexa_media
data:
target: media_player.everywhere
data:
type: announce
message: The dishwasher cycle has completed
- delay:
hours: 0
minutes: 20
seconds: 0
milliseconds: 0
- service: notify.alexa_media
data:
message: This is a reminder, the dishwasher has finished, and can be emptied
target: media_player.everywhere
data:
type: announce
mode: single
Basically, I know my dishwasher cycle runs for between 2 hours to 2 hours 15 mins when it is done it automatically opens the door, so when the dishwasher door opens if it’s been closed for the previously mentioned amount of time, consider the cycle finished and send a notification.
I might have to get a smart plug as that may be a better way currently.
New to HASS so the language is a bit confusing currently
If you’re not doing that and that’s an error message from an automation run, paste the full automation YAML.
You can trigger it by opening the dishwasher. Your automation trace should then show you the condition preventing the notifications being sent (assuming not in the 2:00 to 2:15 hour range).
You can test it in the template editor to some extent by faking up the trigger variable, like this (with one of my sensors):
I have a dumb dishwasher but I found a way to make it smart. I use contact sensor on dishwasher knob and smart plug for power.
I created dropdown helper. In this helper I defined dishwasher statuses. Using automations I managed to change status of a dishwasher, when it is ready, finished, running or off based on smart plug power and knob position. I created automation for fingerbot to turn on dishwasher when certain conditions are met ie. turn it on after 10 pm if status is ready.
When you do this, try to keep it simple aka KISS, keep it simple and stupid.