Lua is a simple programming language. It is often used for user scripts, e.g. in computer games. Lua supports a limited set of variables, such as boolean values (true/false), numbers, strings and tables (heterogeneous associative arrays).
In the context of NETIO products
NETIO 4x devices can run custom Lua scripts. Netio devices use a customized Lua version with some small modifications. For more information about Lua in NETIO, see: https://wiki.netio-products.com/index.php?title=Netio_LUA
A Lua script can be used to program custom rules to control the behavior of the electrical sockets and to communicate over the LAN.
- A Lua script can run either continuously, or whenever triggered by a certain event (button pressed, output state changed, URL request received)
- A Lua script can switch individual sockets on or off
- A Lua script can send e-mails
- A Lua script can receive and send “ping” messages (ICMP requests/replies) – see M2M Active Client
- A Lua script can download xml/json files over http and parse them – see M2M Active Client
A user Lua script, or several scripts, run directly in the NETIO 4x smart sockets device. User scripts are written in a web interface. Examples of ready-made scripts can be found in NETIO AN (Application Notes).
- AN04 Remote power socket control by URL (http GET handled in Lua script)
- AN03 Switching OFF a 230V power socket when current exceeds limit, email alerts
- AN02 Intro to Lua scripts, trigger conditions, log file
- AN01 Getting started with NETIO 4x and Lua scripts
>> For a description of Lua scripts, see: NETIO Lua scripts