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.

Js variables & Lua variables
#2
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
Reply


Messages In This Thread
Js variables & Lua variables - by Jonathan - 17.03.2017, 16:12
RE: Js variables & Lua variables - by Erwin van der Zwart - 17.03.2017, 17:19
RE: Js variables & Lua variables - by admin - 23.03.2017, 06:59

Forum Jump: