Netio
The Netio integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to control and monitor NETIO smart power sockets, power strips, and power distribution units (PDUs). The device outputs are exposed as switchSwitches are things that have two states you can select between, such as turning on or off a socket. [Learn more] entities in Home Assistant.
The integration communicates with the device locally using the JSON version of the NETIO machine-to-machine (M2M) API, which is available on all current NETIO devices (such as PowerCable, PowerBox, PowerPDU, and PowerDIN) as well as on the older Netio4 family.
Prerequisites
The JSON M2M API must be enabled on the device before setting up the integration:
- Open the web interface of your NETIO device.
- Go to Settings > M2M API Protocols > JSON API.
- Enable the JSON API and create an account with read-write access.
- Take note of the username and password of this account; they are required when setting up the integration. Note that these credentials are separate from the credentials used to sign in to the web interface.
Configuration
To add the Netio device to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Netio.
-
Follow the instructions on screen to complete the setup.
Provided entities
The integration provides a switch entity for every output of the device, allowing you to switch the output on and off. The entities are named after the output names configured on the device.
Data updates
The integration polls the device every 30 seconds.
Remove the integration
This integration follows standard integration removal.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.
The JSON API account can afterwards be removed from the device web interface.
Legacy YAML configuration (deprecated)
The previous version of this integration used the Telnet-based (KSHELL) M2M API and was configured through YAML. This configuration method is deprecated and will be removed in Home Assistant 2027.3.0. Set up the integration through the UI as described above instead.
Note that the older Koukaam NETIO-230x devices do not provide the JSON API and are only supported through the deprecated YAML configuration.
Deprecated YAML configuration
# Example configuration.yaml entry
switch:
- platform: netio
host: 192.168.1.43
username: YOUR_USERNAME
password: YOUR_PASSWORD
outlets:
1: Free
2: TV
4: Lamp
To get pushed updates from the Netio devices, one can add this Lua code in the device interface as an action triggered on “Netio” “System variables updated” with an ‘Always’ schedule:
-- this will send socket and consumption status updates via CGI
-- to given address. Associate with 'System variables update' event
-- to get consumption updates when they show up
local address='ha:8123'
local path = '/api/netio/<host>'
local output = {}
for i = 1, 4 do for _, what in pairs({'state', 'consumption',
'cumulatedConsumption', 'consumptionStart'}) do
local varname = string.format('output%d_%s', i, what)
table.insert(output,
varname..'='..tostring(devices.system[varname]):gsub(" ","|"))
end end
local qs = table.concat(output, '&')
local url = string.format('http://%s%s?%s', address, path, qs)
devices.system.CustomCGI{url=url}