REST API
Every sensor readable, every target settable, every action triggerable over HTTP on your local network. No cloud round-trip, no rate limits, no API keys to rotate. Designed for Node-RED, Home Assistant, n8n, curl, or whatever you already use.
Looking for the friendly version? Integrations — Home Assistant, ESPHome, MQTT, Node-RED, Grafana →
On your network: http://budmaster.local/api · or http://<controller-ip>/api
All endpoints return application/json. All timestamps in UTC ISO-8601. All temperatures in °C, all VPD in kPa.
Authentication
All write endpoints (POST, PUT, DELETE) require an X-API-Token header. Generate a token from the dashboard under Settings → API Tokens. Read endpoints (GET) are open on your local network by default — enable auth-on-read under Settings if you want to lock it down further.
# Authenticate a write request curl -X POST http://budmaster.local/api/mode \ -H "X-API-Token: bmg_xxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"mode":"auto_co2"}'
Sensors
Current readings from all connected sensors. Cached ~1 second.
Time-series data for all sensors. hours parameter accepts 1, 24, 168, 720 (30d).
Per-sensor calibration offsets (temp, humidity, leaf-temp offset, CO₂ ambient reference).
Update calibration offsets. Body: {"aht20_temp_offset": -0.3, "leaf_temp_offset": 2.0}
Environment
Composite — current VPD, DLI progress, environment score (0-100), bud-rot risk flag, active stage, plan week.
Environment score with factor breakdown (VPD / temp / RH / CO₂ / DLI / pH).
Today's DLI running total + projection for lights-off time.
Mode
Current operating mode (manual, auto, auto_co2, fan_manual).
Switch modes. Body: {"mode":"auto_co2"}.
Mute alerts for N hours. Body: {"hours": 8}.
Outputs (fans, lights)
Current speeds for extract, intake, circulation fans.
Set fan speeds (manual mode only). Body: {"extract": 60, "intake": 40} (0-100).
Light schedule, current dim level, DLI auto-dim state.
Set schedule or override dim. Body: {"on_hour":6, "off_hour":18, "dim":85}.
CO₂
Current CO₂ ppm, target ppm, cumulative daily dose, cost estimate.
Set target. Body: {"target_ppm": 1200, "cost_per_kg": 4.50}.
Grow plans
List saved plans (up to 4 slots × 16 weeks each).
Active plan with current week + progress.
Start a plan. Body: {"slot": 1, "week_start": 0}.
Stop the active plan, revert to stage presets.
Soil
Latest reading: temp, moisture %, EC mS/cm, pH, N, P, K mg/kg.
Soil time-series.
Smart plugs
Configured plugs with state + last ping. 4 channels (humidifier, dehumidifier, heater, cooler).
Manual override (manual mode only). Body: {"on": true}.
Reachability test — pings the plug, returns round-trip time.
System
Firmware version, uptime, heap, Wi-Fi/Ethernet status, MAC address.
Export full configuration as JSON (schedules, plans, plugs, calibration, thresholds).
Restore from a JSON backup. Body: backup JSON.
Initiate OTA from a signed .bin file. Body: multipart with firmware field.
Soft reboot.
Interactive Swagger-style docs — runs on the controller itself. Point a browser at http://budmaster.local/api/docs.
Quick examples
Read current VPD + auto-switch mode if it's drifting:
# Bash + jq vpd=$(curl -s http://budmaster.local/api/environment | jq -r .vpd) if (( $(echo "$vpd > 1.5" | bc -l) )); then curl -X POST http://budmaster.local/api/mode \ -H "X-API-Token: $TOKEN" \ -d '{"mode":"auto"}' fi
Home Assistant — expose a template sensor:
# configuration.yaml rest: - resource: http://budmaster.local/api/environment scan_interval: 30 sensor: - name: "Grow VPD" value_template: "{{ value_json.vpd }}" unit_of_measurement: "kPa" - name: "Grow score" value_template: "{{ value_json.score }}"
Node-RED flow — alert on bud-rot risk:
// Inject node → HTTP request → Switch // URL: http://budmaster.local/api/environment // Msg.payload.bud_rot_risk === true → trigger your notification node
If you're integrating BudMaster into a serious grow setup — commercial, lab, or a complex home-lab — email hi@budmastergrow.com and we'll help with the integration directly. This is a 20-minute conversation, not a support ticket. Free for batch-1 customers.