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.

Presence sensor - Reset timer/delay
#3
Thanks for your help Erwin,
However, I get an error from line 66 when trying to run your script. I might have done something wrong... I am completely new to lua programming.

I am also wondering if using a combination of an event-based script and a resident script could do the job.
I created the following two scripts before I saw your reply. The two scripts seem to work as intended, but this might be a poor use of resources in terms of memory etc compared to your script?

The logic is enabling and disabling the resident script...

Event-based script:
value = event.getvalue()
if value == true then
grp.write('Lights', 1)
script.disable('Sensor')
end
if value == false then
script.enable('Sensor')
end

Resident script:
os.sleep(300)
value1 = grp.getvalue('motion sensor')
if value1 == false then
grp.write('Lights', 0)
end
script.disable('Sensor')

What you think?

BR
Mr. D
Reply


Messages In This Thread
Presence sensor - Reset timer/delay - by Mr.D - 14.04.2017, 21:18
RE: Presence sensor - Reset timer/delay - by Mr.D - 15.04.2017, 19:36

Forum Jump: