BUDMASTERGROW
Home/REST API

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 →

Base URL

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.

Jump to

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

GET/api/sensors

Current readings from all connected sensors. Cached ~1 second.

GET/api/sensors/history?hours=24

Time-series data for all sensors. hours parameter accepts 1, 24, 168, 720 (30d).

GET/api/sensors/calibration

Per-sensor calibration offsets (temp, humidity, leaf-temp offset, CO₂ ambient reference).

POST/api/sensors/calibration

Update calibration offsets. Body: {"aht20_temp_offset": -0.3, "leaf_temp_offset": 2.0}

Environment

GET/api/environment

Composite — current VPD, DLI progress, environment score (0-100), bud-rot risk flag, active stage, plan week.

GET/api/environment/score

Environment score with factor breakdown (VPD / temp / RH / CO₂ / DLI / pH).

GET/api/environment/dli

Today's DLI running total + projection for lights-off time.

Mode

GET/api/mode

Current operating mode (manual, auto, auto_co2, fan_manual).

POST/api/mode

Switch modes. Body: {"mode":"auto_co2"}.

POST/api/silence

Mute alerts for N hours. Body: {"hours": 8}.

Outputs (fans, lights)

GET/api/fans

Current speeds for extract, intake, circulation fans.

POST/api/fans

Set fan speeds (manual mode only). Body: {"extract": 60, "intake": 40} (0-100).

GET/api/light

Light schedule, current dim level, DLI auto-dim state.

POST/api/light

Set schedule or override dim. Body: {"on_hour":6, "off_hour":18, "dim":85}.

CO₂

GET/api/co2

Current CO₂ ppm, target ppm, cumulative daily dose, cost estimate.

POST/api/co2

Set target. Body: {"target_ppm": 1200, "cost_per_kg": 4.50}.

Grow plans

GET/api/plans

List saved plans (up to 4 slots × 16 weeks each).

GET/api/plans/active

Active plan with current week + progress.

POST/api/plans/start

Start a plan. Body: {"slot": 1, "week_start": 0}.

POST/api/plans/stop

Stop the active plan, revert to stage presets.

Soil

GET/api/soil

Latest reading: temp, moisture %, EC mS/cm, pH, N, P, K mg/kg.

GET/api/soil/history?days=7

Soil time-series.

Smart plugs

GET/api/plugs

Configured plugs with state + last ping. 4 channels (humidifier, dehumidifier, heater, cooler).

POST/api/plugs/<channel>

Manual override (manual mode only). Body: {"on": true}.

POST/api/plugs/test/<channel>

Reachability test — pings the plug, returns round-trip time.

System

GET/api/system

Firmware version, uptime, heap, Wi-Fi/Ethernet status, MAC address.

GET/api/backup

Export full configuration as JSON (schedules, plans, plugs, calibration, thresholds).

POST/api/backup/restore

Restore from a JSON backup. Body: backup JSON.

POST/api/ota

Initiate OTA from a signed .bin file. Body: multipart with firmware field.

POST/api/reboot

Soft reboot.

GET/api/docs

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
One-off integrations we'll build with you

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.