Library to control outputs of NETIO 4 smart power sockets from NETIO products a.s.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sebastian bc032c3a3b Merge branch 'drone1' of imo/lua-netio into master 2 years ago
docs Updated documentation 3 years ago
examples Updated documentation 3 years ago
spec make linter happy 3 years ago
src make linter happy 3 years ago
.drone.yml updated .drone.yml for drone ci 1.x 2 years ago
.luacheckrc added .luackechrc 3 years ago
LICENSE LICENSE: added year and name 3 years ago README: fixed typo 3 years ago



lua-netio is a library to control outputs of NETIO 4x smart power sockets from NETIO products a.s.. These Ethernet- or WiFi-connected power sockets can be accessed using a varity of protocols and M2M-API methods, including HTTP(s) CGI, Telnet, XML, JSON and many more.

Currently implemented:


  • implement Telnet (Offical doc)
  • implement Telnet support for NETIO 230B (older model) (Offical doc)
  • add rockspec

I'm not planing to implement the XML API, because in my opinion the JSON API is enough, but if someone want to contribute, do it :)

Example Usage

local Netio = require('netio')
local netio1 ={
    url = '',
    port = 8080,
    user = 'write',
    pass= 'demo',
    api = 'json'

local resp, err = netio1:outputs_info(1)
print('Current state of Output1 is ' .. resp.State)
resp, err = netio1:outputs_toggle(1)
print('State after toggle of Output1 is ' .. resp[1].State)


Documentation was generated with LDoc and can be read here:



You need busted to run the tests.

busted spec/

Some tests might fail sporadically. That's because the demo instaces sporadically rejects the commands silently and just return the status JSON object. If you take a look into the NETIO's logfile, you see that the command is rejected, but not why.