I have a script that is being run whenever a z-wave event occurs on a thermostat. The script monitors the actual temperature and heat setpoint of the thermostat and if necessary turns on the boiler to provide heat. As this will be happening for at least ten thermostats, I have devised a system that maintains a count of the number of thermostats calling for heat. If this count is greater than zero the boiler is turned on otherwise off.
I think I need to run this trigger script synchronously - it should be very quick to run. As I understand it this will be achieved by running it as an embedded script. To avoid replicating the script across ten thermostats I could run it as a file. However, if I do this it runs in its own thread and in theory you could get confusing updates to the common count of radiators calling for heat if the script was fired at similar times and multiple threads were running.
This background info (as way of explanation) is a long way round asking whether it is possible to run an include statement in an embedded script so that I don't have to replicate the majority of the script code