no need.
you have the scheduler link to an object: objA
then you have a script which control the curtain: sc1 link to objA
And a second one for the weather computation : sc2 attach to a tag: weatherSensor
Your rain sensor object, wind, ... any weather related object is tagged as weatherSensor
So, you'll have something like this:
sc1 will be called with the scheduler.
If it's raining, sc2 will be called and will disable sc1. once the rain is gone, sc2 will be called again to reactivate sc1 and run it.
In sc1, you just need to verify if blind should be open or close regarding the value of objA.
it will give code something like this:
script1
script2
I'm sure it can be optimized, but this will do the trick.
you have the scheduler link to an object: objA
then you have a script which control the curtain: sc1 link to objA
And a second one for the weather computation : sc2 attach to a tag: weatherSensor
Your rain sensor object, wind, ... any weather related object is tagged as weatherSensor
So, you'll have something like this:
sc1 will be called with the scheduler.
If it's raining, sc2 will be called and will disable sc1. once the rain is gone, sc2 will be called again to reactivate sc1 and run it.
In sc1, you just need to verify if blind should be open or close regarding the value of objA.
it will give code something like this:
script1
Code:
cmdblinds = grp.getvalue('objA')
if cmdblinds then
-- open blinds
else
-- close blinds
end
Code:
rain = grp.getvalue('rainStatus')
wind = grp.getvalue('windStatus')
--...
if rain or wind or ... then
--disable ctl
script.disable('script1')
-- close blinds?
else
--enable script
status = script.status('script1')
if not status then
script.enable('script1')
grp.write('objA',grp.getvalue('objA')) -- update the object to start script 1
end
end
I'm sure it can be optimized, but this will do the trick.