HomeHome AutomationA seriously connected relay! Netio 4PZ

A seriously connected relay! Netio 4PZ

Jack of all trades from Netio

Netio 4PZ could be called a jack of all trades, as it brings multiple functions to a single device. I’m sure some of you will be quick to point out that it doesn’t have PoE or it doesn’t make your morning toasts. You might have come across relay arrays from Sonoff 4CH and 4CHPRO (review), but despite holding the same number of relays, this Netiop gadget is nothing like them. I’m sure you are as eager as me to poke inside and see what could we do with it.

Netio 4PZ

It’s not the first time I play with Netio products. Two of their connected cords power my PC and the washing machine. Thanks to their ability to measure the current, and interact with relays inside I made washing machine notifications and a powerful dashboard for my PC. Netio strikes again with a very interesting, DIN-rail mounted, relay board Netio 4PZ. If you ever wanted to raise your relay game to a PRO level, read on!

I actually had a very good Skype call about products (and love for Czech cuisine and Prague) with Netio’s CEO Jan Rehak. It was great to hear first hand about the goals and challenges that Netio takes on. I was pleased to hear that all Netio products had a major firmware update introducing more protocols to previously specialised devices. Now PowerCables have a full selection of protocols, just like the new Netio 4PZ: XML, JSON, URL, Telnet, Modbus/TCP, MQTT, Netio Push, SNMP.

The feature list goes on and on, which is seriously impressive for such a small box. Netio products come with industrial-grade quality (which will be unfortunately reflected in price) and a plethora of connectivity options. This time is no different and Netio 4PZ comes with an array of features on its specs list.

Main Features:

  • 2 “dry” contacts (NO/NC configuration) 16A/230V (total)
  • 2 relays with power meter per each channel 2A/230V 2A/48V DC
  • Zero-Current switching
  • Digital input and S1 counter
  • RJ45 for Ethernet connectivity
  • WiFi 2.4GHz
  • NFC*
  • WebServer, Cloud and 7 connectivity protocols

*present, but more as a WIP feature

It’s an interesting board for a couple of reasons. Netio 4PZ mixes decoupled relays with more traditional ones we all know from other boards. On top of that, power meter functions are available per channel for each non decoupled relay.

The decoupled relays are rated 10A each, with 8A inductive current rating (explains the 16A total current limit). the other pair actually has 16A rated relays, which makes me wonder why the device is rated at 2A per channel for these. 2 amps may not seem like much at first, until you take in consideration Zero Current Switching, which in turn protects the relays from burnout caused by the rush current of inductive loads.

Digital inputs serve a dual purpose. Can be used to monitor additional relays as well as use S1 counters to measure electricity consumption above 16A.

To complement the relays, Netio 4PZ comes with built-in WiFi 2.4GHz, RJ45 (sadly no PoE) and NFC to streamline the setup process. If you never used Netio products before, their software is well documented and provides the information for each protocol used.

Netio app & Netio cloud

The Netio Mobile 2 app is very basic. It lacks functionality and attention but the web interface is well developed with professional interfaces and all data options you could ask for. Only recently Netio products came with Cloud and Mobile app support. Cloud is provided free of charge for 3 years, but if you don’t want to pay after that, the protocols listed above will make the device integration very easy.

On the inside

The device is surprisingly easy to open. At the heart of the Netio 4PZ lays ESP32 WROOM-32 module which handles the IoT and communication. My board is an early revision and has a small wire fixing a PCB design (It’s a pre-run of 70 units, fixed in the next revision).

It’s pretty cool that board comes with exposed dev pads. There are 10 pins on the control board and an additional 1 x 6 and 1 x 8 pads exposed on the relay board with 12V, 3.3V power lines. The relay logic is handled by STM32F microcontroller.

ESP32 board is very hackable, but with an insane list of supported protocols, there is hardly a reason to reinvent the wheel, as Netio 4PZ can be integrated with pretty munch anything you wish.

NFC

It’s still work in progress, I had a conversation with the NETIO CEO about the implementations and they are open to ideas about how NFC could be used. NFC setup is fully integrated in headless power cables, for now, time will tell if this device will gain extra NFC features to play with. The hardware is there so who knows.

NodeRED hook up?

Netio 4PZ makes it extremely easy to connect. Pick the connection of your choice and the documentation is there to lay out the options. Since MQTT is already supported I’ll connect it via MQTT and show you how to receive information about the meters and control all 4 relays.

Netio 4PZ comes with a specific flavour of MQTT: Flex – it’s actually quite powerful as it lets you create your own message structure and how MQTT reports back. M2M API settings have a MQTT-Flex configuration, that uses JSON (more about JSON) to set all the properties. Full instructions are listed here, but I will give you a quick rundown.

MQTT JSON contains 3 parts. Configuration to connect to MQTT broker (your home automation server), a list of subscribed topics and a list of topics that Netio 4PZ will publish to. You can grab my config file and test flow from the download link below.

{
     "config":{
},
      "subscribe":[],
      "publish":[]
 }

Config

Simply use the template with your data to connect to the home server and start sending and receiving infomration from your server and the device.

"config":{
        "broker":{
            "url":"broker.hivemq.com",
            "protocol":"mqtt",
            "port":1883,
            "ssl":false,
            "type":"generic",
            "username":"freedom",
            "password":"peace|LOVE|empathy4ALL"
        },

Subscribe

In this object, Netio 4PZ will read the list of all topics that it should subscribe to, and will “listen” to commands to change the outputs or provide you feedback.

 "subscribe":[{
               "topic":"netio/name/output/1/action",
               "qos":0,
               "target":"OUTPUTS/1/ACTION",
               "action":"${payload}"
           },
{
               "topic":"netio/name/output/2/action",
               "qos":0,
               "target":"OUTPUTS/2/ACTION",
               "action":"${payload}"
           }
]

The sample above has 2 subscriptions. It will listen to messages posted to each topic, and apply results to appropriate hardware config (“target“). Information read from each topic is stored as payload (“action“) and follows the key:

  • 0 – OFF
  • 1 – ON
  • 2 – SHORT OFF
  • 3 – SHORT ON
  • 4 – TOGGLE
  • 5 – NO ACTION.

Publish

To send the updates from the device, you have to specify what information you wish to publish and how often. Here is a sample configuration:

"publish": [
		{
			"events": [
				{
					"source": "OUTPUTS/1/STATE",
					"type": "change"
				},
				{
					"source": "OUTPUTS/2/STATE",
					"type": "change"
				},
				{
					"source": "OUTPUTS/3/STATE",
					"type": "change"
				},
				{
					"source": "OUTPUTS/4/STATE",
					"type": "change"
				},
				{
					"source": "INPUTS/1/STATE",
					"type": "change"
				},
				{
					"source": "INPUTS/2/STATE",
					"type": "change"
				},
				{
					"type": "timer",
					"period": 60
				}
			],
			"payload": "${INOUT_STATUS}",
			"qos": 0,
			"retain": false,
			"topic": "devices/netio4pz/status"
		}
	]

This will publish everything "payload": "${INOUT_STATUS}" about Netio 4PZ to the topic devices/netio4pz/status in the event of {"source": "OUTPUTS/1/STATE", "type": "change"} (change of state of the output 1) or every 60 seconds {"type": "timer", "period": 60}.

Complete instructions are available on this page.

Now that we know how, let’s make a basic dashboard to display the stats and options to control the device via NodeRED Dashboard.

Example Response
{"GlobalMeasure":{"Voltage":242,"TotalCurrent":42,"TotalLoad":7,"TotalEnergy":5,"OverallPowerFactor":0.66,"Frequency":50.17,"Phase":-35.35,"EnergyStart":"2021-01-14T21:08:04+00:00"},"Outputs":[{"ID":1,"Name":"Power output 1","State":1,"Action":6,"Delay":5000,"Current":42,"PowerFactor":0.66,"Phase":-35.35,"Energy":5,"ReverseEnergy":0,"Load":7},{"ID":2,"Name":"Power output 2","State":1,"Action":6,"Delay":5000,"Current":0,"PowerFactor":1,"Phase":0,"Energy":0,"ReverseEnergy":0,"Load":0},{"ID":3,"Name":"Free Contact 3","State":1,"Action":6,"Delay":5000},{"ID":4,"Name":"Free Contact 4","State":1,"Action":6,"Delay":5000}],"Inputs":[{"ID":1,"Name":"Input 1","State":0,"S0Counter":5},{"ID":2,"Name":"Input 2","State":0,"S0Counter":2}]}

Status & Inputs

As I defined the topic devices/netio4pz/status – and set the events to post on power change and every 60 sec, I can get that information into NodeRED with a simple MQTT node. Set the message type to JSON and you will see the data neatly organised.

The same goes for inputs, any changes on that side, will be posted to input MQTT In node link to the topic: netio/netio4pz/input/1/state.

Outputs

Directing outputs is very simple. As Netio 4PZ uses numbers to control relays, I can quickly pass these as msg.payload to the individual outputs. Each output has defined topic, therefore sending updates takes only single MQTT out node.

Dashboard

To see the data from the metered outputs (1 & 2) I need a nice widget. I used gauges to display the current load and text nodes from dashboard to show other metrics. I picked all available in each output, but you can also get device totals if you want to work with these.

Available metrics are:

Load (W)Energy (Wh)Current (mA)
True Power FactorPhase shiftVoltage
Grid frequencyTotal Current Total Load
Total Power FactorEnergy start Total Energy

I organised the data and I have added some switches so you can play about if you want to.

What’s next?

I have two 3D printers (Ender3 and Ender3 v2) which could use remote control and auto power-off function since they’ll end up in my garage. I’m still looking into running multiple printers off a single Octoprint instance, but I know for sure, a relay board like this would be perfect to drive both Enders!

Printers are rated for 380W so I will be able to take the advantage of the mobile notifications with the cost of the print feature per printer as Netio 4PZ’s channels with power measurements are rated for 460W.

What’s even more interesting, I can now supply the power to the Raspberry PI running Octoprint through the same relay, powering the board when needed. I’ll be writing more about it soon! Something tells me I will build a dedicated enclosure for both printers and hook it up.

Final thoughts

I don’t think there is another relay box like this out there. I talked about Sonoff 4CH and 4CHPRO R3 edition before, but these relays don’t mix the relay types and don’t come with RJ45. Sure they can be flashed to get MQTT and REST support but this is where Netio products shine – all that advanced connectivity is already baked into each product. Let me know what do you think about this board in this Reddit thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

Nora – Google Assistant in NodeRED

0
Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Tuya SDK for beginners: Intro to Tuya Cloud API

0
Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

Sonoff R3 DIY mode & why it sucks

0
Long awaited Sonoff R3 DIY mode is even worse than I expected.

Things they don’t tell you about IKEA Trådfri

0
There are things you should know about IKEA Tradfri before you make your purchase

Smart Home

Is Sonoff NSPanel the future we all wanted?

0
First look at Sonoff NSPanel - a touch screen display for your light switch! Is this the future of automation?

Getting started with Sonoff ZIGBEE 3.0 USB DONGLE PLUS

0
Testing Sonoff ZIGBEE 3.0 USB DONGLE PLUS against CC2531 and zzh (electrolama) - is it the best upgrade to your Zigbee network?

Can touch this: M5Stack Core2

0
M5Stack Core2 brings touch interface to the table, new UIFlow options which make programming super easy

Aqara Roller Shade Driver E1 & Zigbee2MQTT

0
Taking Aqara E1 apart, adding it to Zigbee2MQTT and NodeRED. This time with sunset/sunrise and temp controls

Testing Imou Ranger 2C 2MP & 4MP

0
Imou Ranger 2C comes in 2 flavours 1080P and 2K so let's compare them side by side and see which one is for you