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:

  1. Open the web interface of your NETIO device.
  2. Go to Settings > M2M API Protocols > JSON API.
  3. Enable the JSON API and create an account with read-write access.
  4. 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:

Host

The hostname or IP address of your NETIO device.

Port

The port of the JSON API web server on the device.

Username

The username of the device account with read-write access to the JSON API.

Password

The password of the device account.

Uses an SSL certificate

Connect to the device using HTTPS.

Verify SSL certificate

Verify the SSL certificate of the device when using HTTPS.

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

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. 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

Configuration Variables

host string Required

The IP address of your Netio plug, e.g., http://192.168.1.32.

port integer Required, default: 1234

The port to communicate with the switch.

username string Required, default: admin

The username for your plug.

password string Required

The password for your plug.

outlets list (Optional)

List of all outlets. Consisting of a number and a name [No.]: [Name].

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}