This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Scheduled script
#6
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
Code:
cmdblinds = grp.getvalue('objA')
if cmdblinds then
-- open blinds
else
-- close blinds
end
script2
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.
Reply


Messages In This Thread
Scheduled script - by kostal.borek - 24.07.2017, 07:10
RE: Scheduled script - by admin - 24.07.2017, 07:16
RE: Scheduled script - by kostal.borek - 26.07.2017, 11:59
RE: Scheduled script - by mlaudren - 26.07.2017, 18:09
RE: Scheduled script - by kostal.borek - 27.07.2017, 10:57
RE: Scheduled script - by mlaudren - 27.07.2017, 22:11
RE: Scheduled script - by kostal.borek - 28.07.2017, 09:12
RE: Scheduled script - by Erwin van der Zwart - 31.07.2017, 14:43
RE: Scheduled script - by mlaudren - 31.07.2017, 15:34

Forum Jump: