I have an automation to TTS when the washing machine is done.
And if we have not opened the door after five minutes it TTS again with a slightly different message, and then it repeats this until we have taken care of it.
The issue is that sometimes it skips the first message, and the five minute delay and goes directly to the repeating message.
Not really an issue but it’s strange. I just want to know what could cause this.
{{ states(''sensor.washing_machine_tts'') }} == "The 60 degree wash is done"
or similar
alias: Washing machine done
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_program_progress
above: '99'
- platform: state
entity_id: sensor.washing_machine_operation_state
from: Run
to: Finished
- platform: state
entity_id: sensor.washing_machine_operation_state
from: Run
to: Ready
condition: []
action:
# this is the part that is sometimes skipped
- service: tts.cloud_say
data:
entity_id: media_player.hela_huset
message: '{{ states(''sensor.washing_machine_tts'') }}'
language: sv-SE
- repeat:
while:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.washing_machine_door
state: 'off'
- condition: state
entity_id: sensor.washing_machine_program_progress
state: '100'
sequence:
# and this delay is also skipped
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.washing_machine_door
state: 'off'
- condition: state
entity_id: sensor.washing_machine_program_progress
state: '100'
sequence:
# giving me this message as the first
- service: tts.cloud_say
data:
entity_id: media_player.hela_huset
message: >-
"{{ states('sensor.washing_machine_tts') }} and the door is still closed."
language: sv-SE
- service: homeassistant.update_entity
target:
entity_id: sensor.washing_machine_json
default: []
mode: single
And I know this is not an issue with the first TTS got “lost”, I hear the washing machine beep as it’s done and hear the door unlock and I get the second message.
I don’t have a trace of it.
It last happened a few days ago and I just remembered it now.
Next time it happens I will try and remember to look at the trace.
Stopped because only a single execution is allowed …
It implies the automation was triggered while it was already running. It is configured to operate in mode: single so only one running instance is allowed.
While it was executing its action, the state of sensor.washing_machine_operation_state changed and triggered the automation. The trace shows the “from” state was “Run” so it triggered one of the two State Triggers (because they both use from: Run). However, the automation is already busy and, because it’s operating in single mode, ignores the trigger. By ignoring the state-change, the automation probably failed to work the way you expected it would.
Changing the mode from single to queued or parallel will allow it to execute more than one instance. However, you’ll have to study the action’s logic determine if it makes sense to do that. It contains a repeat so simply allowing the automation to clone its action (parallel) or enqueue another instance of it (queued) might not be the right thing to do.
The reason there is multiple triggers is because sometimes one of them just stops.
Or it skips the “Finished” state.
I’ll probably move it over to Node red then, I’ll probably have more control of the automation there.
I’m not sure what you mean by “stops”. Perhaps you are referring to the delay statement? The running instance contains a 5-minute delay during which any triggering of the three triggers will (because of single mode) produce the error message you received and prevent a second instance from being executed.
Sorry, no.
Since it’s based on the cloud, the API or something in between makes the values freeze.
Sometimes it’s just one value that freezes, sometimes it’s all.
So basing the trigger on as many variables as possible makes it more likely to fire.
based on the cloud, the API or something in between makes the values freeze.
then I don’t see how your intention to switch to Node-Red will mitigate it. Nevertheless, I wish you luck anyway. Please post the flow when it’s done so others can see how to resolve the issue.
Single mode blocks until the automation is no longer busy. However, it cannot be unblocked by a reset message. Will you be using that additional feature to resolve the issue you are experiencing?