Im trying to add a 2 hour delay into the scripts but this seems to have stopped my switch from toggling properly. Am i right in thinking that the switch wont change state until the script has completed? Any ideas for a work around for this? Iād like to be able to toggle the switch within this 2 hour delay and have the switches state change and the delay restart.
This will give you the correct state feedback for the switch. However what happens when you toggle the switch during the 2 hour delay is unpredictable.
If the switch is on (script.heating running) and you switch it off, all that happens is that the script.cooling is started. script.heating will still be running.
A way around this would be to turn of the other script as the first service call in each of the scripts. Likewise you could move the input boolean switching to the scripts next service call too if you wanted: