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.

Change in status - Tagged objects
#1
Hi,

I am also trying to write a script that will turn on the lights (object 1/1/1, value) if there is a change in object a, b, c or d (tagged "alarm"). However, this should only happen if object (2/2/2 has value 1). 
The idea of the script is that it should function as kind of alarm at night. We have sensors in all doors and windows, and if the alarm is on (2/2/2, 1), and there is a change in status for one of the sensors then the lights in the bedroom (1/1/1, 50) should turn it self on to 50%.

Any help would be appreciated [Image: smile.png]

Mr.D
Reply
#2
Hi Mr. D,

Try one of the 2 scripts below : (put one of them in a event based script linked to the tag 'alarm')

Code:
-- Without input value check
if grp.getvalue('2/2/2') == true then
  grp.write('1/1/1', 50) -- or 128
end
Code:
-- With input value check on event value
if grp.getvalue(event.dst) == true then
 if grp.getvalue('2/2/2') == true then
   grp.write('1/1/1', 50) -- or 128
 end
end

BR,

Erwin
Reply
#3
Hi Erwin,

The first script works best since the lights get turned on with any change in status from the tagged objects. The last script only turns the lights on when the change in status goes from value 0 to value 1. Your last script came in handy for a different script I have made.

Thanks for your help Smile

Mr.D
Reply


Forum Jump: