SONOFF releases HTTP API for SPM-Main power meter

SPM-Main is the main unit of Sonoff Smart Stackable Power Meter using RS485 to provide up to 128 relays. Besides support for the eWelink mobile app, we were promised an HTTP API at the time of the launch in September 2021.

ITEAD kept its promises and has now released the HTTP API for the SPM-Main smart power meter to allow IoT home automation users and developers to control SONOFF devices via existing home automation open-source platform or local HTTP client. It’s the same REST API used for SONOFF MINI & R3 smart switches, but it adds support for power monitoring as well.

Sonoff power meter DIY ModeThe API allows you to switch between eWelink and DIY modes as needed, and provides the following functions:

  • Device Status Broadcast – Returns the switch status of all channels with current, voltage, power, overload status, RS485 communication status, and more
  • Get the List of Sub-device – List of SPM-4Relay connected over RS485
  • ON/OFF Switch – Turn on/off channels of an SPM-4Relay as needed
  • Overload Protection – Enable/disable and configure overload protection
  • I Am Here – Check if subdevice can be reached
  • Set Device Time – Set date/time of SPM-Main
  • Historical Data of Sub-device – JSON with historical data of a subdevice per switch (voltage, current. power, etc…)
  • Set up Real-time Monitoring Related Information – Return real-time data (voltage, current, power) of a specific outlet on the selected subdevice (SPM-4Relay)
  • WiFi SSID and Password Setting – SPM-Main WiFi configuration (I suppose done over Ethernet…)
  • OTA Firmware – Link to firmware update file and SHA256 hash
  • Get Channel Operation Records – Reports when a specific outlet was on/off, got into overload mode, etc…
  • Get Device State – Reports firmware version, WiFi status, RS485 communication status, and so on.

You’ll find documentation for the API on the developer website, as well as a short tutorial on the SONOFF website.

SONOFF Smart Stackable Power Meter
SPM-4Relay (left) and SPM-Main (right)

Many people are already flashing their SONOFF devices with ESPHome or Tasmota open-source firmware, but in most cases, it requires people to open the device and sometimes even solder some wires,  which some people may feel uncomfortable doing, and the HTTP API removes the need to hack the hardware, as long as it’s implemented in your preferred home automation suite.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
0 Comments
oldest
newest
Boardcon Rockchip and Allwinner SoM and SBC products