Skip to content

Factory Reset

Document Context

  • Purpose: Factory reset API endpoint for restoring device to original state with complete configuration erasure
  • When to use: Device troubleshooting, preparing for redeployment, resolving persistent configuration issues, security reset
  • Prerequisites: Administrative access, understanding of irreversible data loss, backup of critical configurations if needed
  • Related to: Device restart (restart.md), firmware updates (firmware-update.md), initial device setup procedures
  • Validates against: Factory state restoration requirements, configuration persistence boundaries, security reset protocols

Key Facts

  • Endpoint: /api/v1/restore - Triggers complete factory reset operation
  • Method: POST - Returns 204 No Content on success, irreversible operation
  • Data loss: ALL user settings, configurations, networks, passwords, certificates erased
  • Preservation: Firmware version, hardware info, factory certificates remain intact
  • Alternative access: Physical button, WebUI option, API endpoint - multiple reset methods

Authentication

When a Web UI password is set, HTTP endpoints require HTTP authentication.

Firmware 1.10.X and later: Uses HTTP Digest authentication - Server challenges with WWW-Authenticate: Digest … (realm is the device hostname) - Algorithm: MD5-sess (device advertises MD5-sess; integrity variant supported) - qop: auth (and optionally auth-int for requests with body integrity) - Nonce and opaque are issued by the device; the client must include cnonce and increment nc - Expired nonce: server may return 401 with WWW-Authenticate: …, stale=true. In that case, retry the same request once using the new server challenge, a new cnonce, and reset nc=00000001.

Firmware before 1.10.X: Uses HTTP Basic authentication - Server challenges with WWW-Authenticate: Basic realm="..." - Credentials are base64-encoded in Authorization: Basic <encoded-credentials>

Recommended approach: Use --anyauth in curl to automatically detect and use the appropriate method:

curl --anyauth -u ":<password>" http://whatwatt-ABCDEF.local/api/v1/system

Data Loss Warning

Factory reset will permanently erase ALL user settings, configurations, and data. This action cannot be undone!

Alternative Methods

  • Physical button press on the device
  • Factory reset from the device's WebUI

Endpoint Details

This endpoint allows you to restore your device to factory settings, erasing all user configuration and returning the device to its original state.

Parameter Value
Endpoint /api/v1/restore
Method POST
Response 204 No Content on success

What Gets Reset

Configuration Reset

  • Network Settings: Wi-Fi credentials, static IP configuration
  • MQTT Settings: Broker configuration, credentials, topics
  • Service Settings: All service configurations and schedules
  • User Accounts: WebUI passwords and authentication
  • Custom Settings: Actions, scalers, meter configurations
  • Certificates: TLS certificates and security settings

Example Request

curl -i -X POST http://192.168.1.100/api/v1/restore
curl -i -X POST --anyauth -u ":PASSWORD" http://192.168.1.100/api/v1/restore

Expected Response

HTTP/1.1 204 No Content
Content-Length: 0

Best Practices

Configuration Backup

Always backup current configuration before factory reset for potential restoration.

Network Planning

Plan how to reconnect to the device after reset, as network settings will be erased.

Physical Access

Ensure physical access to the device in case network recovery fails.

Documentation

Document current settings and configuration before reset for easier reconfiguration.