04.03.2017, 17:59
Hi,
You can make the connection between Crestron and LM using example of the site.
http://openrb.com/example-lm2-as-tcp-ser...-requests/.
You need to come up with a data transfer protocol between the Creston and LM. I have used in this message format - “function_groupadress_value”:
- “function”- name function (switch, temp, dimm)
- Groupadress - Group address bus KNX
- Value - the value for the group address
This message must be disassembling in LM.
Detail of script code
--function_ groupadress_value
dim_check = string.split(data, '_')
--диммирование освещении
if (dim_check[1] == 'dimm' || dim_check[1] == 'temp'|| dim_check[1] == 'switch') then
value = tonumber(dim_check[3])
grp.write(dim_check[2], value)
end
The response from the LMA in Crestron is forming similarly to the example online.
http://openrb.com/example-lm2-as-tcp-ser...-requests/.
Event-based program
Event-based script will monitor the object ‘1/1/1’, if it is switched on, “Lamp is ON” is sent to all TCP clients currently connected to Logic Machine 2 TCP server, if lamp is switched off – “Lamp is OFF”.
Source code
1. value = knxdatatype.decode(event.datahex, dt.bool)
2. udpsend('Lamp is' .. (value and 'ON' or 'OFF'))
Crestron connects with the LMA through the unit "TCP/IP client". You must specify the correct port and IP-address of the LM.
I think there will not be problems with sending commands and parsing response from LM.
You can make the connection between Crestron and LM using example of the site.
http://openrb.com/example-lm2-as-tcp-ser...-requests/.
You need to come up with a data transfer protocol between the Creston and LM. I have used in this message format - “function_groupadress_value”:
- “function”- name function (switch, temp, dimm)
- Groupadress - Group address bus KNX
- Value - the value for the group address
This message must be disassembling in LM.
Detail of script code
--function_ groupadress_value
dim_check = string.split(data, '_')
--диммирование освещении
if (dim_check[1] == 'dimm' || dim_check[1] == 'temp'|| dim_check[1] == 'switch') then
value = tonumber(dim_check[3])
grp.write(dim_check[2], value)
end
The response from the LMA in Crestron is forming similarly to the example online.
http://openrb.com/example-lm2-as-tcp-ser...-requests/.
Event-based program
Event-based script will monitor the object ‘1/1/1’, if it is switched on, “Lamp is ON” is sent to all TCP clients currently connected to Logic Machine 2 TCP server, if lamp is switched off – “Lamp is OFF”.
Source code
1. value = knxdatatype.decode(event.datahex, dt.bool)
2. udpsend('Lamp is' .. (value and 'ON' or 'OFF'))
Crestron connects with the LMA through the unit "TCP/IP client". You must specify the correct port and IP-address of the LM.
I think there will not be problems with sending commands and parsing response from LM.