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.

Shutter Lock signal
#1
Hi.

I have a case where, as soon as anyone use the manual buttons for shutters i want to send a "1" to lock the automatic function in a shutter actuator

The objects is:

UP/DOWN 1bit (0/1)
STOP 1bit (0)

LOCK AUTOMATICS 1bit (1)

Is there a script that check an adress if it gets any kind of telegram even if it´s "1" or "0" and can send a "1" to a output..


Best regards
Reply
#2
Hi.

Here is a simple script for your function.

value = grp.getvalue('1/1/1') -- upp/down adress

if value >= 0 or value <= 1 then

grp.write('1/1/2', 1) -- lock automatics
end

sorry, delete the group adress in the first line.

value = grp.getvalue()

then put the script in up/down object.
Reply
#3
Since your UP/DOWN object is 1 bit and you don't care about the value there's no need for comparison.

Another point is that event.getvalue() should be used instead of grp.getvalue(). Since the return value for 1 bit objects is true/false then comparison with 0/1 will not work.

You just need one line in your script attached to UP/DOWN object, change 1/1/2 to your LOCK object address:
Code:
grp.write('1/1/2', true)
Reply
#4
(11.05.2019, 18:46)Rauschentofft Wrote: Hi.

Here is a simple script for your function.

value = grp.getvalue('1/1/1') -- upp/down adress

if value >= 0 or value <= 1 then

   grp.write('1/1/2', 1) -- lock automatics
end

sorry, delete the group adress in the first line.

value = grp.getvalue()

then put the script in up/down object.

Hi.
Thank you for the help...
I think i got it to work with some small modefy

value = grp.getvalue() -- upp/down adress
if value == upp or value == down then
  grp.write('10/1/2', true) -- lock automatics
end

Best regards
Anders

(13.05.2019, 06:17)admin Wrote: Since your UP/DOWN object is 1 bit and you don't care about the value there's no need for comparison.

Another point is that event.getvalue() should be used instead of grp.getvalue(). Since the return value for 1 bit objects is true/false then comparison with 0/1 will not work.

You just need one line in your script attached to UP/DOWN object, change 1/1/2 to your LOCK object address:
Code:
grp.write('1/1/2', true)

Is it so simple ??
Reply
#5
It works but it does the same thing as just having one line:
Code:
grp.write('10/1/2', true) -- lock automatics

Here's what your current script does:

value = grp.getvalue() - no address/name is passed to grp.getvalue(), so value is nil

if value == upp or value == down then - both upp and down are not defined so they are nil, so the actual comparison is if nil == nil or nil == nil then
Reply
#6
(13.05.2019, 06:45)AndersH Wrote:
(11.05.2019, 18:46)Rauschentofft Wrote: Hi.

Here is a simple script for your function.

value = grp.getvalue('1/1/1') -- upp/down adress

if value >= 0 or value <= 1 then

   grp.write('1/1/2', 1) -- lock automatics
end

sorry, delete the group adress in the first line.

value = grp.getvalue()

then put the script in up/down object.

Hi.
Thank you for the help...
I think i got it to work with some small modefy

value = grp.getvalue() -- upp/down adress
if value == upp or value == down then
  grp.write('10/1/2', true) -- lock automatics
end

Best regards
Anders

(13.05.2019, 06:17)admin Wrote: Since your UP/DOWN object is 1 bit and you don't care about the value there's no need for comparison.

Another point is that event.getvalue() should be used instead of grp.getvalue(). Since the return value for 1 bit objects is true/false then comparison with 0/1 will not work.

You just need one line in your script attached to UP/DOWN object, change 1/1/2 to your LOCK object address:
Code:
grp.write('1/1/2', true)

Is it so simple ??

Ha ha.... Yes it´s working with that simple line, amazing... Smile

I also have a light color control via a template that the customer want´s to stop in the same way, if you use the manual dimming button, it must be possible
in the same type of script line ?!

//Anders
Reply


Forum Jump: