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.

Write value to another LM without KNX IP
#1
Hi,
I have point in my LM (LM-1) which is a 255 byte string type point. When I change value of this point, I want to write to another 255 byte string type point which is located in another LM (LM-2). I cannot use KNX IP futures or something (Because there are same KNX addresses in another LM's) 
I need a script which write value to another LM contains IP address of LM and KNX Point address. 

Thanks,
Reply
#2
You can either setup KNX/IP filteting so only one required group address is passed (which is not used on the bus). Or you can send via HTTP requests: http://openrb.com/docs/remote-new.htm
Reply
#3
We cannot use filtering. We already used filtering for another purposes. I would like to try http request. But this http request must be trigger by event script. Can i write this http request line in to event script ?
Reply
#4
Yes, by using Luasocket HTTP: http://w3.impa.br/~diego/software/luasoc...ml#request
Reply
#5
Hi ,
If you write one script regarding to example written below, it will be better.
Source object : LM4 , 192.168.1.80 , 1/1/1 , value : 'Hello World This is may message'
Destination object : LM4 192.168.1.82 , 3/2/2 (username:remote , password:remote )

Regards
Reply
#6
This is very trivial. Next time please try using provided examples in the documentation.

Code:
http = require('socket.http')
url = require('socket.url')
http.TIMEOUT = 5

value = event.getvalue()
req = 'http://remote:remote@192.168.1.12/scada-remote?m=json&r=grp&fn=write&alias=3/2/2&value='
http.request(req .. url.escape(value))
Reply
#7
It worked for the objects those are not binary.. Thanks a lot. For binary points, true and false values are not send with this method. Do you have any suggestion.
Regards,
Reply
#8
Hi,

Add this below value = event.getvalue()
Code:
if type(value) == "boolean" then
  value = tostring(value)
end

BR,

Erwin
Reply
#9
(20.09.2017, 15:25)Erwin van der Zwart Wrote: Thank you.

Hi,

Add this below value = event.getvalue()
Code:
if type(value) == "boolean" then
  value = tostring(value)
end

BR,

Erwin
Reply


Forum Jump: