API Reference & Examples
Device Management
GET/api/devices - List all devices
curl -X GET http://localhost:3000/api/devices
GET/api/devices/:deviceId - Get device details
curl -X GET http://localhost:3000/api/devices/AQU57E83CAD
POST/api/devices/register - Register device
curl -X POST http://localhost:3000/api/devices/register \
-H "Content-Type: application/json" \
-d '{"deviceId": "AQU57E83CAD", "deviceName": "My Device", "locationId": "harnosand1"}'
Light Control
POST/api/devices/:deviceId/light/on - Turn light on
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/light/on \
-H "Content-Type: application/json" \
-d '{"brightness": 100, "duration": 60}'
POST/api/devices/:deviceId/light/off - Turn light off
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/light/off
Pump Control
POST/api/devices/:deviceId/pumps/:pumpNumber/on - Turn pump on
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/pumps/1/on \
-H "Content-Type: application/json" \
-d '{"duration": 30}'
POST/api/devices/:deviceId/pumps/:pumpNumber/off - Turn pump off
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/pumps/1/off
Recipe Control
POST/api/devices/:deviceId/recipe/start - Start recipe
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/recipe/start \
-H "Content-Type: application/json" \
-d '{"recipeNumber": 1}'
POST/api/devices/:deviceId/recipe/stop - Stop recipe
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/recipe/stop
Direct Command
POST/api/devices/:deviceId/command - Send MQTT command
curl -X POST http://localhost:3000/api/devices/AQU57E83CAD/command \
-H "Content-Type: application/json" \
-d '{"cmd": "getDeviceInfo", "timeout": 10000}'
System Status
GET/status - System status
curl -X GET http://localhost:3000/status