HTTP Endpoints
HTTP endpoints of the embedded ESP
General Notes:
- No username/password, because TLS support is not yet implementend (and likely will never be due to device constraints)
- All success responses return 200 “Success”
- Error responses return “Error!” with HTTP 400/500 status codes
- Static resources are cached for 86400 seconds (24 hours)
Light Control
Endpoint | HTTP Verb | Parameters |
---|---|---|
/toggleLight | GET | - enabled (string): “0” or “1” |
/setLightColor | GET | - color (string): Hex color code (e.g., “#FF0000”) |
/setAutoBrightness | GET | - enabled (string): “0” or “1” |
/setBrightness | GET | - value (number): 0-255 |
TODO: that’s not particular RESTful. Move them to POST/PUT like the other endpoints.
Time Configuration
Endpoint | HTTP Verb | Parameters |
---|---|---|
/setTime | POST | - time (string): Time in HH:MM format |
/setNTPConfig | POST | - enabled (string): “0” or “1”- ntpHost (string): NTP server address- ntpInterval (number): Update interval- ntpTimezone (string): Timezone identifier |
/setLightSchedule | POST | - enabled (string): “0” or “1”- scheduleStart (string): Start time (HH:MM)- scheduleEnd (string): End time (HH:MM) |
System Configuration
Endpoint | HTTP Verb | Parameters |
---|---|---|
/setHaIntegration | POST | - enabled (string): “0” or “1”- mqttHost (string): MQTT broker address- mqttPort (number): MQTT port- mqttUsername (string, optional): MQTT username- mqttPassword (string, optional): MQTT password- mqttTopic (string): MQTT topic |
/setClockFace | POST | - option (string): “0” or “1” |
/resetConfig | POST | None |
Firmware Update
Endpoint | HTTP Verb | Parameters |
---|---|---|
/update | GET | None |
/update | POST | - updateType (string): “firmware” or “filesystem”- Binary file upload |
WiFi Setup
Endpoint | HTTP Verb | Parameters |
---|---|---|
/ | POST | - ssid (string): WiFi network name- wifi-pass (string): WiFi password |
Pages
Endpoint | HTTP Verb | Description |
---|---|---|
/ | GET | Redirects to /light |
/light | GET | Light control page |
/time | GET | Time configuration page |
/system | GET | System settings page |
Static Resources
Path | Description |
---|---|
/style.css | CSS stylesheet |
/index.js | JavaScript file |
/favicon.ico | Favicon |