Tags: 
User library

PyNetioConf is a python library for interacting with all NETIO devices, allowing for remote control using network protocol. PyNetioConf enables users to control these devices programmatically through Python, making it useful for automating power management in various network setups or IoT application.

Do you have any questions?

In general, PyNetioConf can be used in two ways. As a tool for developers managing more complicated tasks together with Python, or for standard users to remotely control NETIO devices.

 

Key Features of PyNetioConf:

  • Remote Power Control: PyNetioConf provides functionality to remotely turn on, turn off, or restart connected devices via NETIO's network-controlled power outlets.
  • Configuration setup: PyNetioConf allows users to configure their NETIO device features, such as (network/Wi-Fi, Schedule, API, Users & permissions…etc)
  • FW upgrade – PyNetioConf library allows performing firmware upgrades on NETIO devices 
  • Status Monitoring: PyNetioConf can retrieve the status of outlets, FW version, APIs status, get value from electrical characteristic measurements.
  • Certificate upload: PyNetioConf can be used to upload certificates and connect to IoT cloud providers such as AWS IoT

Common Use Cases:

  • Pre-configuration for set of NETIO devices
  • FW upgrade for multiple NETIO devices at the same time 
  • Uploading Certificate AWS
  • Device troubleshooting

 

Supported devices: 

All NETIO devices from FW version 3.2.6 

  • PowerBOX 3Px
  • PowerBOX 4Kx
  • PowerPDU 8KS
  • PowerPDU 8QS
  • PowerPDU 4KS
  • PowerPDU 4PS
  • PowerDIN 4PZ 
  • PowerCable 2KZ
  • PowerCable 2PZ

 


 

Basic Example in PyNetioConf:

Here’s an example to demonstrate how PyNetioConf might be used to control a NETIO device:

PyNetioConf may require configuration of your NETIO device to ensure it allows remote control and monitoring over the network. Typically, this involves setting a static IP or configuring the device’s communication protocol as needed.

from PyNetioConf import NetioManager

nm = NetioManager()

device = nm.init_device("192.168.1.111", "demo", "demo")

You can now control and configure the device using its class methods

# To set output 1 as OFF

device.set_output(1, False)

# To set output 1 as ON

device.set_output(1, True)

# To read out output states

device.get_output_states()

# to get JSON API state

device.get_json_api_state()

 

Additional commands from PyNetioConf library

device.change_password()

device.set_mqttflex_state()

device.supported_features

device.ping()

device.get_measurement()

device.get_xml(

device.change_user_password()           

device.set_on_premise(

device.update_firmware(

device.register_to_cloud()              

device.get_modbus_state()

device.host

device.export_config()

device.set_output(

device.upload_mqtt_ca_certificate(

device.rename_device()

device.get_mqttflex_state()

device.hostname

device.fw_version

device.set_output_schedule(

device.upload_mqtt_client_certificate( 

device.rename_output()

device.get_output_data(

device.import_config(

device.get_active_protocols()

device.set_outputs_unified( =

device.upload_mqtt_client_key(

device.reset_output()

device.get_output_states()

device.logger

device.get_cloud_state()

device.set_urlapi_state(

device.use_https

device.session_id

device.get_outputs_data()

device.login(

device.get_current_user()

device.set_wifi_settings(

device.user_permissions

device.set_cloud_state(

device.get_supported_protocols()

device.logout()

device.get_features()

device.set_wifi_static_address(

device.username

device.set_json_api_state(

device.get_version()

device.netio_manager

device.set_xml_api_state(

device.sn_number

device.ws

device.get_version_detailed()

device.get_wifi_settings()

device.output_count

 

To upgrade NETIO FW via PyNetioConf

from PyNetioConf import NetioManager

 

# To connect to devices we create an instance of NetioManager, which will manage

# sessions and devices, and ensure a singular connection to a device from the script

nm = NetioManager()

 

# To get a device object from NetioManager we use the init_device method

DEVICE_IP = "192.168.1.17"

USERNAME = "admin"

PASSWORD = "admin"

FIRMWARE_PATH = "/path/to/firmware/file.package"

 

netio_device = nm.init_device(DEVICE_IP, USERNAME, PASSWORD)

 

# Now that we have the device connected we ensure that we get responses from the device

print(netio_device.get_output_states())

# And just to be sure, let's print out the device version

print(netio_device.get_version_detailed())

 

# Now that we know the device is connected and alive, we can upgrade the firmware

# Note this operation can take considerable time, even over 5 minutes in some cases

with open(FIRMWARE_PATH, "rb") as fw_file:

    netio_device.update_firmware(fw_file)

 

Documentation:

Full documentation including examples is available on NETIO GitHub repositary https://github.com/netioproducts/PyNetioConf

FAQ:

Is PyNetioConf working on different operating system Linux/ MAC/Windows?

Yes – on Mac, Linux – Python interpreter is installed by default. Windows users shall install native Python from python.org

 

What is minimum NETIO device fw version supporting PyNetio?

Netio Device shall run on fw 3.2.6.+
 

Ask for a price or technical parameters

For device testing use name/password demo/demo