in the meanwhile, please let me think along a bit further on your suggestion the template might be True somehow. I could only imagine that if the sensor would switch somehow during fraction of a second.
I’d need to add a for: 00:01:00 or so to the template but thats not possible is it?
sure I do check the log and as I did it now, indeed both quoted and unquoted false lead to the timeout, and abortion of the script.
This is a first though, and I am completely puzzled how this can be.
because unexplained things happen… And as said the sensor seems not to be too stable (it is a Zwave switch with a small spread in the value. Ive added a small light to the switch, so I can test with that and not the iMac. But, in the event the light would be off, it switches between 0 and 1.1. That is a possibility for the template to go True, and continue the script.
Hence my thought preventing such a small change with a for:
In that case I would be 100% sure the template would be correct.
Logs below
2019-08-26 17:34:00 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Running script
2019-08-26 17:34:00 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Executing step call service
2019-08-26 17:34:07 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Executing step wait template
2019-08-26 17:39:08 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Timeout reached, abort script.
with quotes
2019-08-26 17:50:00 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Running script
2019-08-26 17:50:00 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Executing step call service
2019-08-26 17:50:10 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Executing step wait template
2019-08-26 17:55:11 INFO (MainThread) [homeassistant.helpers.script] Script Prompt iMac: Timeout reached, abort script.
So you’re saying the issue is this part of the template: states('sensor.dorm_actueel')|float < 1
Sometimes the sensor goes below 1 (while both device_tracker’s are not_home) and causes the template to become true? Is that right?
Whatever the reason, I think we’ve concluded that there’s nothing wrong with the continue_on_timeout feature, would you agree? Maybe you should close your PR, since there’s nothing wrong with the doc page.
Getting back to the main issue of the topic, it seems you need to do some filtering on the entities going into your wait_template. Maybe create a binary_sensor / input_boolean that only goes true when you want it to, and use that in the wait_template.
Ive managed to rewrite the flow of events, so i get useful feedback in all phases but one: If the wait_template times out, and the script is aborted, it does so silently.
Id really need a notification upon that event. Would you know of a way to realize that?
As I’m sure you’re aware, HA’s scripting component is very basic and is really not up to the task here. The best I could suggest is to not abort (so continue_on_timeout: true), and then add something that checks the state of the binary_sensor. Unfortunately not very easy to to if-then-else in HA scripts.