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.

Movement sensor with lux condition
#2
This will work fine. Paste this inside the sensor switch object, change those group addresses which are marked 'x/x/x'.


Code:
value = event.getvalue() -- Value of current object
LUX = grp.getvalue('x/x/x') -- change this to group address of your LUX sensor

if (value == false) then -- turns off the light
     grp.write('x/x/x', false) -- Change this to your light object group address
end

if (value == true  and LUX < 300) then -- condition to turn the light on when level of LUX is under 300.
     grp.write('x/x/x', true) -- Also change this to your light group address object
end

Also, if you are by any chance using Auro by Basalte, you don't need script at all, everything can be set-up in your ETS project.
Reply


Messages In This Thread
Movement sensor with lux condition - by Bobby - 11.06.2018, 19:15
RE: Movement sensor with lux condition - by Jayce - 12.06.2018, 09:00

Forum Jump: