I have set up an automation on the dishwasher door state, if it opens it checks when the operation state sensor was last changed, if within 90 minutes (which means it’s still steaming hot) then there’s a reminder through the Google speaker. Unfortunately the 90 minutes condition always renders true since a week ago, even though the last state change was many hours ago. What am I missing? Here is the code.
alias: Dishwasher Door Reminder
description: ""
triggers:
- trigger: state
entity_id:
- sensor.dishwasher_door
from: closed
for:
hours: 0
minutes: 0
seconds: 10
to: open
conditions:
- condition: template
value_template: >-
{{ states.sensor.dishwasher_operation_state.last_changed > (now() -
timedelta(minutes=90)) }}
actions:
- action: media_player.volume_set
metadata: {}
data:
volume_level: 0.45
target:
entity_id: media_player.kitchen_speaker
- repeat:
while:
- condition: state
entity_id: sensor.dishwasher_door
state: open
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.kitchen_speaker
message: Don't forget to close the dishwasher
target:
entity_id: tts.google_translate_en_com
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
mode: single
It’s crazy, I added the as_local to the condition, then it fixed the problem. Now I removed it but now it still doesn’t render true “did not pass”. It’s exactly as it was, I’m puzzled
Something struck my mind: I know it happened a long time ago so I assumed it was fixed by now, but there was a time when testing template conditions in the automation editor did not work properly. Is it only the test button in the automation editor giving crazy results or is it really going wrong on execution? The automation trace should be able to tell.
The actual execution gave a positive on the condition while the condition should not have been met. In de test it also said condition passed. Help me understand what I could get from the trace, especially if there’s no actual errors? I am not that familiar with home assistant yet and am trying to understand how to extract more information from the trace