Read the status
const url = 'http://pwrman.local/api/v1/status';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://pwrman.local/api/v1/statusEverything the web interface shows, as one object.
Authorizations
Section titled “Authorizations”- None
- token
Responses
Section titled “Responses”The current status.
object
Device name.
Controller firmware version.
The flash slot the controller is running from.
The firmware is on trial after an update and not yet kept.
The RP2350’s unique ID, 16 hexadecimal digits. The same on every boot.
The Wi-Fi MAC address; null on a controller without Wi-Fi.
The wired Ethernet MAC address; null on a controller without it.
Seconds since the controller started.
Wi-Fi signal strength in dBm; 0 without a Wi-Fi connection.
Wired Ethernet, on controllers that have it: absent, no link,
or the link speed and address, such as 100M full, 192.168.1.40.
Power all ports deliver now, in watts.
Power promised to the connected devices, in watts.
The power budget, in watts.
Budget not yet promised, in watts.
Energy delivered through all ports, in kWh.
Whether the fan is running.
A blade is signaling an alert on the backplane.
Wi-Fi setup over Bluetooth.
Why the controller last started, such as power-on, watchdog timeout or firmware update.
The controller restarted while the ports stayed powered.
Input voltage; null on hardware that does not measure it.
The power every port is held to while the input voltage is low, in watts, or 0 when no cap applies. See Ports capped at 60 W.
Something needs attention.
What needs attention, in words; empty when nothing does.
Which brightness the port lights use now.
The port lights’ brightness now.
What the chassis light shows: bus_fault (input voltage out of
range), wifi_setup (Wi-Fi setup open), setup (first-time setup
open) or ok.
The blade firmware version this controller installs on its blades.
object
A newer release is known.
The newest known release.
The last check for a release; off without an update source.
Seconds since the last check finished.
Percent of the download.
The new firmware is installed and the controller restarts into it within a second.
What automatic updates
will do: off; none (no newer release); waiting (for
auto_wait_s more seconds); scheduled (for 03:00 local time);
retry (the last attempt failed and the next night tries again);
installing; postponed (until postponed_until); or skipped.
Unix time automatic installs are postponed until; 0 when they are not.
The version that does not install automatically.
The network as the controller uses it now, which can differ from the
settings. Addresses are null while the network is down.
object
The time server in use.
The controller knows the time.
The link to the MQTT broker.
Why a TLS link to the broker cannot connect.
One entry per port, in port order.
object
The port’s name.
absent (no blade), probe (checking the blade), idle (no
device), active (delivering power), throttled (held to a lower
power to stay within the budget), fault, disabled (switched
off), or updating (its blade firmware is being written).
Blade generation; 0 until the blade has been checked.
A device is connected.
The device has drawn less than charged_mw for charged_min minutes.
The power offer the device chose, 1–7, as the port listed them
when it chose; 0 for none. The list changes with the voltage cap,
so the same number can mean a different offer on another port.
contract says what kind of offer it is.
The kind of contract: fixed (a fixed voltage), pps
(Programmable Power Supply, the voltage and a current limit
set by the device), avs (SPR Adjustable Voltage Supply, the
voltage set by the device), or null without one.
Output voltage, in volts.
Output current, in amps.
Output power, in watts.
Energy delivered through this port, in kWh.
The power the device’s contract allows, in watts.
Priority; 0 is the most important.
The port’s power limit, in watts: the most it offers at any voltage, up to 5 A.
The highest voltage the port offers.
The port’s state at power-up.
Fault bits; 0 for none. Bit 5: CC line over-voltage. Bit 8: over-current. Bit 9: output over-voltage. Bit 10: VCONN over-current. Bit 11: port protector too hot. Bit 12: converter fault. Bit 13: converter too hot. Bit 14: receptacle too hot. Bit 15: blade failure. Bits 0–4, 6 and 7 come only from generation 2 blades.
Converter temperature, in °C; null without a reading.
Receptacle temperature, in °C; null without a reading.
The blade processor’s temperature, in °C; null without a reading.
While state is updating, the percent of the blade firmware written.
A blade update is waiting for the port to be free.
The blade’s firmware version; null when unknown.
The blade has stopped answering. The port stays powered, and the readings are its last answer.
Examples
{ "name": "pwrman", "fw": "0.16.1", "slot": "A", "trial": false, "board_id": "E6614C311B4A8D2F", "wifi_mac": "28:cd:c1:0e:4f:12", "eth_mac": "02:31:1b:4a:8d:2f", "uptime_s": 274620, "rssi": -58, "eth": "100M full, 192.168.1.40", "total_w": 110.42, "reserved_w": 202, "budget_w": 240, "headroom_w": 38, "energy_kwh": 17.85, "fan": "on", "fan_mode": "auto", "alert": false, "improv": "off", "boot": "power-on", "warm_start": false, "vin_v": 24.06, "ceiling_w": 0, "problem": false, "problems": "", "led_mode": "normal", "led_now": 48, "chassis_light": "ok", "blade_fw": "0.2.0", "update": { "available": false, "latest": "0.16.1", "check": "ok", "check_age_s": 5120, "installing": false, "progress": 0, "restarting": false, "auto": "none", "auto_wait_s": 0, "postponed_until": 0, "skipped": null }, "net": { "up": true, "ip": "192.168.1.40", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "dns": "192.168.1.1", "ntp": "time.cloudflare.com", "time_synced": true, "mqtt": "connected", "mqtt_problem": null }, "ports": [ { "name": "Laptop", "state": "active", "gen": 3, "attached": true, "charged": false, "pdo": 5, "contract": "fixed", "v": 20.021, "i": 2.712, "p": 54.3, "e": 6.211, "contract_w": 65, "prio": 0, "limit_w": 100, "max_v": 20, "boot": "on", "fault": 0, "t_conv": 54.9, "t_plug": 41.3, "t_mcu": 36.2, "progress": 0, "update_due": false, "fw": "0.2.0", "silent": false }, { "name": "Phone", "state": "active", "gen": 3, "attached": true, "charged": false, "pdo": 2, "contract": "fixed", "v": 9.004, "i": 2.18, "p": 19.63, "e": 1.402, "contract_w": 27, "prio": 1, "limit_w": 60, "max_v": 9, "boot": "on", "fault": 0, "t_conv": 41.2, "t_plug": 33, "t_mcu": 34.8, "progress": 0, "update_due": false, "fw": "0.2.0", "silent": false }, { "name": "Port 3", "state": "idle", "gen": 3, "attached": false, "charged": false, "pdo": 0, "contract": null, "v": 0, "i": 0, "p": 0, "e": 0, "contract_w": 0, "prio": 2, "limit_w": 100, "max_v": 20, "boot": "on", "fault": 0, "t_conv": 30.1, "t_plug": 29.4, "t_mcu": 31, "progress": 0, "update_due": false, "fw": "0.2.0", "silent": false }, { "name": "Port 4", "state": "idle", "gen": 3, "attached": false, "charged": false, "pdo": 0, "contract": null, "v": 0, "i": 0, "p": 0, "e": 0, "contract_w": 0, "prio": 3, "limit_w": 100, "max_v": 20, "boot": "on", "fault": 0, "t_conv": 29.8, "t_plug": 29, "t_mcu": 30.7, "progress": 0, "update_due": false, "fw": "0.2.0", "silent": false }, { "name": "Port 5", "state": "disabled", "gen": 3, "attached": false, "charged": false, "pdo": 0, "contract": null, "v": 0, "i": 0, "p": 0, "e": 0, "contract_w": 0, "prio": 4, "limit_w": 100, "max_v": 20, "boot": "last", "fault": 0, "t_conv": 28.9, "t_plug": 28.5, "t_mcu": 30.2, "progress": 0, "update_due": false, "fw": "0.2.0", "silent": false }, { "name": "Port 6", "state": "absent", "gen": 0, "attached": false, "charged": false, "pdo": 0, "contract": null, "v": 0, "i": 0, "p": 0, "e": 0, "contract_w": 0, "prio": 5, "limit_w": 100, "max_v": 20, "boot": "on", "fault": 0, "t_conv": null, "t_plug": null, "t_mcu": null, "progress": 0, "update_due": false, "fw": null, "silent": false } ]}Auth_read is on and the token is missing or wrong.
object
Why the request was refused, in words.
Example
{ "error": "bearer token required"}USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.