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

PathValueEffect
<id>/set0 / 1 / 2Off / On / Enabled
<id>/timer/setsecondsRun a doser for an explicit duration
<id>/timer/default/setsecondsChange default dose duration
<id>/level/set0–100Set tracked tank percentage
<id>/level/remaining/setvolumeSet tracked tank volume
<id>/reset_sensor_statsanyReset rolling sensor statistics
<id>/reset_dose_statsanyReset 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

  • 0 Off
  • 1 On
  • 2 Enabled / armed for automatic operation
  • 3 Disabled by a safety condition
  • 127 sensor not configured / not present
  • Binary conditions use SAFE/UNSAFE.

Read the complete API reference on GitHub.