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.

Get value from KNX and make script in LM
#1
Hi,

I have a away button on a touchpanel that sends a binary value (1 - away, 0 - home). (10/0/1)

And I want to create a event script that when I get the value 1 from my KNX it will set a new value on my ventilation via Bacnet. 

I've already have a event script on my ventilation, as my picture is showing. 

How does I create a event script on 10/0/1 that will set new value on 29/0/6?

Attached Files Thumbnail(s)
   
Reply
#2
Event script attached to 10/0/1:
Code:
value = event.getvalue()
grp.checkwrite('29/0/6', value)
Reply
#3
(29.09.2023, 07:33)admin Wrote: Event script attached to 10/0/1:
Code:
value = event.getvalue()
grp.checkwrite('29/0/6', value)

I've should have mentioned that 29/0/6 is a 1 byte value. So 0 - Stop, 1 - Low, 2 - Home, 3 - High. 
So I when the value from my touchpanel is 0, I want it to set the value to 2 (Home), and with 1 to 3 (High).
Reply
#4
I have tried this, but it doesn't work:

value = event.getvalue()

if value == 1 then
grp.checkwrite('29/0/6', 4)
end

if value == 0 then
grp.checkwrite('29/0/6', 3)
end

log(res, err)

The log is:
* arg: 1
* nil
* arg: 2
* nil
Reply
#5
Try with false and true instead of 0 and 1, remove also the log(res,err) as you don’t declare the variables anywhere, as they don’t exist here, the logically return ‘nil’

PS: log(value) will tell you the content of the variable and makes it easier to determine where you should compare it with in your conditions…
Reply
#6
(01.10.2023, 08:13)Erwin van der Zwart Wrote: Try with false and true instead of 0 and 1, remove also the log(res,err) as you don’t declare the variables anywhere, as they don’t exist here, the logically return ‘nil’

PS: log(value) will tell you the content of the variable and makes it easier to determine where you should compare it with in your conditions…

That was the case. Thanks a lot!
Reply


Forum Jump: