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.

toggle
#7
(22.02.2019, 22:09)gtsamis Wrote: The event script should run on proximity sensor GA.

Does the feedback object works correctly? Are you trying to toggle it too fast?

Try changing the code as below in order to give it some time to update the feedback object

Code:
--Get proximity value
value=event.getvalue()

-- 'Light Feedback' is the address/name of the actual state of the load
lightFB = grp.read('Light Feedback')
os.sleep(0.5)

-- 'Light OnOff' is the address/name of the actual load  
if value then  
lightFB = grp.getvalue('Light Feedback')
grp.write('Light OnOff', not lightFB)
end


If it doesn't work give me a call

BR 
George
thanks George!
Reply


Messages In This Thread
toggle - by balatis - 20.02.2019, 20:20
RE: toggle - by admin - 22.02.2019, 10:07
RE: toggle - by balatis - 22.02.2019, 14:19
RE: toggle - by gtsamis - 22.02.2019, 19:44
RE: toggle - by balatis - 22.02.2019, 21:32
RE: toggle - by gtsamis - 22.02.2019, 22:09
RE: toggle - by balatis - 23.02.2019, 14:02

Forum Jump: