17.03.2017, 17:19
(This post was last modified: 17.03.2017, 17:38 by Erwin van der Zwart.)
Hi,
This is a sample how to write var into JS as client side LUA and yes you need ; if you have more lines.
You can't write back like this as the data is just a result from the server with option to have additional LUA data in it. The data is static so if you want new data you have to request it from the server again.
Sending back JS to LUA must be done by http post with arguments or json form data to the .lp file and handle the posted data in LUA on server also from .lp file. You can include your user libs to the .lp and have full bidirectional communication by get/post data between server and client.
You can use all LUA functions inside the .lp including sockets and ports and that allows you to do http/udp/tcp/bacnet/modbus/enocean requests from your clients javascript engine. Offcourse your .lp file must handle all the requests and translate it to LUA requests or JSON posts back to the client.
There is also a option to use the websocket connection by adding the localbus.js and that allows you to read and write to the knx engine. This way you can have live events without polling or posting all the time.
BR,
Erwin
This is a sample how to write var into JS as client side LUA and yes you need ; if you have more lines.
You can't write back like this as the data is just a result from the server with option to have additional LUA data in it. The data is static so if you want new data you have to request it from the server again.
Sending back JS to LUA must be done by http post with arguments or json form data to the .lp file and handle the posted data in LUA on server also from .lp file. You can include your user libs to the .lp and have full bidirectional communication by get/post data between server and client.
You can use all LUA functions inside the .lp including sockets and ports and that allows you to do http/udp/tcp/bacnet/modbus/enocean requests from your clients javascript engine. Offcourse your .lp file must handle all the requests and translate it to LUA requests or JSON posts back to the client.
There is also a option to use the websocket connection by adding the localbus.js and that allows you to read and write to the knx engine. This way you can have live events without polling or posting all the time.
BR,
Erwin