API
AquaChemD exposes devices, readings and commands over HTTP and MQTT. Both are backed by the same dispatch logic.
HTTP
The base URL is http://<host>:<port>/api/. GET /api/devices returns the configured devices and their current state.
curl http://aquachemd-host:88/api/devices
Common commands
| Path | Value | Effect |
|---|---|---|
| <id>/set | 0 / 1 / 2 | Off / On / Enabled |
| <id>/timer/set | seconds | Run a doser for an explicit duration |
| <id>/timer/default/set | seconds | Change default dose duration |
| <id>/level/set | 0–100 | Set tracked tank percentage |
| <id>/level/remaining/set | volume | Set tracked tank volume |
| <id>/reset_sensor_stats | any | Reset rolling sensor statistics |
| <id>/reset_dose_stats | any | Reset a doser's running total |
Successful requests return HTTP 200; invalid devices, values or safety-rejected commands return HTTP 400 with a short reason.
MQTT
The default root topic is aquachemd/. State is published on connect, when values change and according to the configured timed-update behavior.
aquachemd/PH_1
aquachemd/PH_1/average
aquachemd/PH_1/state
aquachemd/PMP_1/state
aquachemd/PMP_1/timer/state
aquachemd/PMP_1/timer/duration
aquachemd/TNK_1
aquachemd/TNK_1/level/remaining
Commands use the same paths as HTTP, without the HTTP request wrapper. For example:
aquachemd/PMP_2/set 1
aquachemd/PMP_2/timer/set 20
aquachemd/TNK_1/level/set 50
State conventions
0Off1On2Enabled / armed for automatic operation3Disabled by a safety condition127sensor not configured / not present- Binary conditions use
SAFE/UNSAFE.