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

EndpointHTTP VerbParameters
/toggleLightGET- enabled (string): “0” or “1”
/setLightColorGET- color (string): Hex color code (e.g., “#FF0000”)
/setAutoBrightnessGET- enabled (string): “0” or “1”
/setBrightnessGET- value (number): 0-255

TODO: that’s not particular RESTful. Move them to POST/PUT like the other endpoints.

Time Configuration

EndpointHTTP VerbParameters
/setTimePOST- time (string): Time in HH:MM format
/setNTPConfigPOST- enabled (string): “0” or “1”
- ntpHost (string): NTP server address
- ntpInterval (number): Update interval
- ntpTimezone (string): Timezone identifier
/setLightSchedulePOST- enabled (string): “0” or “1”
- scheduleStart (string): Start time (HH:MM)
- scheduleEnd (string): End time (HH:MM)

System Configuration

EndpointHTTP VerbParameters
/setHaIntegrationPOST- 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
/setClockFacePOST- option (string): “0” or “1”
/resetConfigPOSTNone

Firmware Update

EndpointHTTP VerbParameters
/updateGETNone
/updatePOST- updateType (string): “firmware” or “filesystem”
- Binary file upload

WiFi Setup

EndpointHTTP VerbParameters
/POST- ssid (string): WiFi network name
- wifi-pass (string): WiFi password

Pages

EndpointHTTP VerbDescription
/GETRedirects to /light
/lightGETLight control page
/timeGETTime configuration page
/systemGETSystem settings page

Static Resources

PathDescription
/style.cssCSS stylesheet
/index.jsJavaScript file
/favicon.icoFavicon