Skip to main content

Netio

Python bindings and a command line tool for NETIO Products power sockets.

Works with firmware 5.x (JSON API 2.6) and with older 3.x and 4.x devices. Needs Python 3.11 or newer.

pip install Netio --upgrade

Log in to your device and switch on the JSON API. Allow write access if you want to switch outputs and not just read them.

Configure Interface

API

from Netio import Netio

n = Netio('http://powerpdu-8qs.netio-products.com/netio.json', auth_rw=('netio', 'netio'))

Pass auth_rw for a user that may switch outputs, or auth_r for one that may only read — switching with auth_r raises AuthError before anything is sent to the device. timeout=10 sets how long to wait for a reply.

Outputs

>>> n.set_output(1, n.ACTION.ON)   # ON OFF TOGGLE SHORT_ON SHORT_OFF NOCHANGE IGNORED
>>> n.set_outputs({1: n.ACTION.ON, 2: n.ACTION.OFF})
>>> n.get_output(1)
Device.OUTPUT(ID=1, Name='Dream Machine', State=1, Action=<ACTION.IGNORED: 6>, Delay=5000, Current=0, PowerFactor=1.0, Phase=0.0, Energy=43078, EnergyNR=154263, ReverseEnergy=646, ReverseEnergyNR=66452, Load=0)

Outputs are counted from 1. get_outputs() returns them all, and get_output raises UnknownOutputId for a number the device does not have.

Not every device measures power. The PowerCable 2PZ and the PowerPDU 4PS report only ID, Name, State, Action and Delay, and leave the rest None. It can also differ per output: on the 8QS above only output 1 measures.

Inputs

Some models, such as the PowerDIN 4PZ, have digital inputs. They work like outputs but are read only: get_inputs(), get_input(id), NumInputs.

>>> n.get_input(1)
Device.INPUT(ID=1, Name='Input 1', State=0, S0Counter=0, TemperatureC=None, TemperatureF=None, Humidity=None)

State is 0 for an open contact and 1 for a closed one. Temperature and humidity need a sensor: the device sends 999 when none is connected, and this package reports that as None.

HTTPS

Pass the device's certificate as verify, or verify=False to skip the check. Reaching the device by IP address always needs verify=False, because the certificate will not match the address.

n = Netio('https://netio.local/netio.json', auth_rw=('admin', 'password'), verify='/path/to/cert.pem')

To get a certificate: set the hostname and domain under Settings->Network Configuration, then Generate new certificate under Settings->Security Settings, and download it from your browser.

CLI

Netio [-u USER] [-p PASSWORD] [-c CFG] [-C] [--no-cert-warning] [-v] DEVICE COMMAND
Command Aliases Does
get GET G g print output state
set SET S s switch outputs
info INFO I i print everything the device reports about itself
inputs INPUTS DI di print input state

Netio DEVICE COMMAND --help describes each one.

GET and INPUTS

Both print a table of everything, or of the ids you name. None is a value the device does not report.

$ NETIO_PASSWORD=netio Netio -u netio http://powerpdu-8qs.netio-products.com/netio.json GET
id      State   Action  Delay   Current PFactor Load    Energy  Name
1       1       IGNORED 5000    0       1.0     0       43078   Dream Machine
2       1       IGNORED 5000    None    None    None    None    Power output 2

$ NETIO_PASSWORD=netio Netio -u netio http://powerdin-4pz.netio-products.com:22888/netio.json DI 1
id      State   S0Counter       TempC   TempF   Humidity        Name
1       0       0               None    None    None            Input 1

--no-header drops the header row, --delimiter ';' changes the separator, and --action-int prints the action as a number. Asking for the inputs of a device that has none exits 1 with a message.

SET

Takes pairs of output number and action, or ALL in place of a number. Exits non zero when the request does not succeed.

$ NETIO_PASSWORD=secretPass Netio -u write http://netio.local SET 1 ON 2 OFF
$ NETIO_PASSWORD=secretPass Netio -u write http://netio.local SET ALL TOGGLE

Warning: switching all outputs at once leaves no delay between them. With heavy loads that can spike the current and trip your breakers.

INFO

Which sections appear depends on the model: no GlobalMeasure on devices that do not measure power, no Inputs on devices without them. Inputs, PAB, Watchdogs and Rules are lists, so their items are numbered.

$ Netio -u netio -p netio http://powerpdu-8qs.netio-products.com/netio.json INFO
Agent
   Model         8QS
   DeviceName    PowerPDU-EB
   SerialNumber  24A42C3992EB
   Version       5.3.1
   NumOutputs    8
   NumInputs     1
   ...
Inputs
   [1]
      ID            1
      Name          Input 1
      State         1
      S0Counter     1246811
      ...

Credentials

Passing the password on the command line lets anyone on the system see it. Use NETIO_USER and NETIO_PASSWORD instead, or a config file given with --config or NETIO_CONFIG — see netio.example.ini.

Each value is looked up in this order: command line argument, environment variable, the config file section for that device, its DEFAULT section, built in default.

Trying it out

NETIO offers public demo devices, so you do not need your own hardware. These 6 were up when last checked (2026-08-12), all on firmware 5.3.1, and accept netio/netio or demo/demo. They are real devices other people are also using, and no sensor is connected to any of their inputs.

Device URL Inputs
PowerPDU 8QS http://powerpdu-8qs.netio-products.com/netio.json 1
PowerDIN 4PZ http://powerdin-4pz.netio-products.com:22888/netio.json 2
PowerCable 2KZ http://powercable-2kz.netio-products.com:22888/netio.json 1
PowerCable 2PZ http://powercable-2pz.netio-products.com/netio.json none
PowerPDU 4PS http://powerpdu-4ps.netio-products.com:22888/netio.json none
PowerBOX 4KX http://powerbox-4kx.netio-products.com/netio.json none

Development

poetry install
poetry run pytest          # offline tests, no network needed
poetry run pytest -m live  # tests against the demo devices above

The live tests switch output 1 of each demo device over and then put it back.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netio-2.0.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netio-2.0.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file netio-2.0.0.tar.gz.

File metadata

  • Download URL: netio-2.0.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for netio-2.0.0.tar.gz
Algorithm Hash digest
SHA256 788c08b96a8c1ab8e8bc23be74db824934204e3c65ef6904a67797a6dc3ef445
MD5 54f2e2797340d55a9871abc3b1fee421
BLAKE2b-256 164474aea6bb179e6bd0d5e1f120068f62259d97f6ee5604c171d6c841c7bf54

See more details on using hashes here.

Provenance

The following attestation bundles were made for netio-2.0.0.tar.gz:

Publisher: publish.yml on netioproducts/PyNetio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netio-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: netio-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for netio-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bf99e549b1e10f363061d0160f2d7102272a1a94b60d43dbc7958c0f5a8f7e1
MD5 12d2d15a1daac2c4bbe5ade22cddc10f
BLAKE2b-256 2db2d2a33ba08ad566c6a8c972c07fbe23466e931a99b593c37700f984a32b24

See more details on using hashes here.

Provenance

The following attestation bundles were made for netio-2.0.0-py3-none-any.whl:

Publisher: publish.yml on netioproducts/PyNetio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.1

2 files

This release

2.0.0 This release

2 files

1.0.13

2 files

1.0.12

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

3 files

1.0.7

1 file

1.0.6

2 files

1.0.4

2 files

1.0.3

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page