What do you do when you have a massive electrical installation to control, monitor and protect? It looks like ITEAD has got you covered. One of their latest devices: Sonoff SPM comes with support for 128 channels rated 20A each, for a total of 2560 Amps. That’s a lot of channels to control and a lot of amps to send through each relay. Is Sonoff SPM still made for home automation enthusiasts or made for industrial application? Let’s give it a go.
Sonoff SPM – relay array
To use the Sonoff SPM system, you need 2 devices. A Sonoff SPM control unit and at least one (up to a possible 32) SPM relay. They are connected with a 2 core wire. The one included in the package is short, but you can extend it for up to 100m. That leaves a lot of room for configuration.
It’s not the smallest relay array I had in my hands. If you think the latest Sonoff 4CH R3 & 4CHPRO R3 were big, you may not like the footprint Sonoff SPM takes. It’s DIN-rail mountable and aims to reside in an electrical cabinet. Despite a similar look, Sonoff SPM can’t be used instead of RCD fuses. It comes with OCP, OVP implemented software-wise – way too slow to provide relevant protection. Thanks to the high (20A) rating of each channel, it can be installed in line with your existing fusebox. If you are tempted to add this to your automation, refer the installation to a professional.
Each channel monitors power use and the data is sent to the eWeLink app, with a local backup stored on a micro SD card to access in DIY mode.
Sonoff SPM Control unit
It’s nice to see a mix of WiFi (2.4GHz) and Ethernet on Sonoff products again. While the Sonoff SPM control unit isn’t PoE compatible, you will be able to choose the connection type for your device. The paring process uses Bluetooth, which reveals the information about, hidden inside, microcontroller. It’s ESP32 driven.
The unit has to be powered by mains and comes with a 2 terminal socket to connect a slave relay unit. The only button on the device is used to trigger pairing with relay units and to put the Sonoff SPM into Sonoff DIY mode. Each added slave unit is listed as a subdevice. and will show up separately (and as a subdevice) in the eWeLink app.
An SD card slot can take SDHC cards up to 32GB and it is used to store the power use data.
Inside
Sonoff SPM is made out of 2 PCB connected together with a cable linking header of the main board with the extension board hosting buttons and terminals for RS485.
ESP32 Front board Main board
Bluetooth already indicated the presence of the ESP32 to handle most of the work. In Sonoff tradition, the dev pads are exposed and available for tinkering with the most important ones broken down as a header: GND, TX, RX, 3V3 and pad: GPIO00
A new is the inclusion of the RTC indicated by the presence of the CR1220 battery connected to GD32F103 IC.
Sonoff SPM relay
These are 4 channel relays rated for 20A each. As you probably guessed, the familiar form factor means that the unit is also DIN-rail compatible. Each channel is also equipped with an independent power meter to measure the current consumption.
Devices can be chained together using the RS485 protocol. The first unit connects to the Sonoff SPM control unit, and to the next slave unit in series. The last slave unit is defined by toggling the slave switch into the ON position to communicate the end of the chain. It’s interesting to see the adoption of the RS485 protocol which is present in industrial applications – an indication of what is the designated customer for this product.
One thing to bear in mind is the RS485 requirement. ITEAD recommends 2 core RVVSP cables of 0.2 mm max and the max length of not more than 100m. It’s probably not a limiting factor for homes but industrial setups can easily reach these distances.
Inside
Inside the box, you will see massive relays rated for 20A to assure operation with mains voltage. The relays feel solid and terminals are made to accommodate large gauge wires. In the same manner, as with Sonoff 4CH and 4CHPRO, the power usage data is available thanks to 4 current clamps soldered to the PCB.
The relay connects to the low voltage board via 8 pin headers. All buttons and IC responsible for RS485 is also located on that smaller PCB. There are a plethora of exposed pads on the PCB, but it’s unlikely that anyone will be poking around this part of the device to hack it.
In action
Both SPM units have to be connected to mains in order to be detected. Please forgive my wiring schema in these pictures. My electrical box is sealed, so I was not able to fit the unit in place without calling out the electrician for a day. If you are planning on installing this at the house, consider the same. This unit is too important to mess it up.
I rigged the demo at home, which means I’m feeding mains from the same circuit to all 4 channels. In a proper installation, each relay would handle a separate circuit in your house – as my setup splits supplied circuit (16A) into 4 channels.
One of the things I noticed, is that while subdevice pairing is quick, it needs to be done again if you disconnect subdevices and power these off. The re-paired unit shows up as a new device completely wiping off custom names assigned to it.
SONOFF DIY is back
I thought it will never make the appearance again. I personally miss the Sonoff DIY control. It’s a great solution for anyone who wants local network integration without going nuclear with Tasmota. Sonoff SPM joins the small list of devices with a DIY control scheme ( BASICR3, RFR3, MINIR2 and D1).
To use DIY mode, the unit has to be set up in ethernet mode. Hold the pair button on the Sonoff SPM control unit for 5 seconds, navigate to the device’s IP and enter the WiFi credentials. Sonoff SPM will connect wirelessly (optional) and you will be able to issue commands via REST protocol.
Sonoff also made the provision for storing and accessing the history of power consumption. In the cloud mode, data is stored and displayed thanks to the eWeLink app, but if you switch to the DIY mode, the power consumption history can be accessed via HTTP calls as it’s stored on an SD card. It’s a nice touch, as it saves you from creating your own database solution to store and plot power measurements.
Just remember to query the device list first to obtain the deviceID for each Sonoff SPM relay unit connected to your control device. Everything else follows Sonoff DIY documentation.
Using DIY
Before you get started, take a note of the deviceID
as you will need this to control Sonoff SPM in the DIY mode. You can find it in the device settings in the eWeLink app.
To access and configure the DIY mode, pair it first with the eWeLink app, then connect the Sonoff SPM via Ethernet cable and hold the pairing button for 5 sec. Find the IP of the Sonoff using the Fing app or your router interface and configure the WiFi credentials by navigating to the configuration page (Sonoff SPM IP address). If you are not able to access the page, make sure you are paired with Sonoff first.
Node-RED
To control individual settings and obtain the data from relays, you will need a subdeviceID for each relay SPM you have in your network. You can do so by calling this flow:
Now that you have the subdeviceID you can send commands and receive data using the following REST structure:
http://[ip]:8081/zeroconf/switches // control switches
http://[ip]:8081/zeroconf/iAmHere // locate unit
http://[ip]:8081/zeroconf/time //set time
http://[ip]:8081/zeroconf/historicalData //get historical data (SD card required)
http://[ip]:8081/zeroconf/monitor // use real time power monitor
http://[ip]:8081/zeroconf/wifi // reconfigure WiFI
http://[ip]:8081/zeroconf/upgrade //flash OTA firmware
http://[ip]:8081/zeroconf/record // device operation record/stats
http://[ip]:8081/zeroconf/getState // get device/subdevice state
http://[ip]:8081/zeroconf/ops_mode // revert back to cloud control
REST post request must be made with a JSON body specifying the deviceID
and subdeviceID
followed by the data parsed to the request. If you are new to JSON, I have a 5 min guide to the structure in this article. Here is a sample of the JSON request to turn on all the switches in a subdevice:
For detailed information and samples, please see the documentation. If you want to use the NodeRED flow from my example, feel free to try it out:
ON and OFF
Whether you are using eWeLink Cloud controls, LAN or DIY – the device is easy to operate and responsive. Relays make satisfying clicky noise when toggled and additional buttons on the relay unit allow for quick manual control and troubleshooting.
When connected to the cloud, individual channels will be available in Alexa and Google Home apps (support is coming soon), so take your time and name the channels appropriately if you are planning on using voice controls. It would be nice to have a selector which enables/disables individual channels from cloud control so they don’t clog up the list (just like SwitchBot does it). It’s not a big issue if you have 4 relays, but as the list can be 128 positions long, you probably don’t want all of them to show up in Alexa and Google Home by default.
Final thoughts
I don’t know where Sonoff SPM will end up. Even for my 3D printing “farm”, I’m working on as we speak, is way too much. The fact is, I like the scalability of the unit, the inclusion of DIY mode and the fact that the relay comes with a power meter. If you have plans, then ITEAD has the controller unit available for $29.99 and the relay units for $59.99. Let me know what would you use it for in your automation in this Reddit thread.