Version: 1.0 Date: 2022-3-11
The device type is diylight (type=diylight) and the device API interface version is 1 (apivers=1).
NOTE: MINIR3 is a single-channel device, but it uses a multi-channel protocol. The protocol can control the switches of channels 1, 2, 3, and 4. MINIR3 uses the first channel.
URL: http://[ip]:[port]/zeroconf/switches
Return value format: json
Method: HTTP post
e.g.
{ "deviceid": "1000000001", "data": { "switches": [ { "switch": "on", "outlet": 0 }, { "switch": "on", "outlet": 1 }, { "switch": "off", "outlet": 2 }, { "switch": "off", "outlet": 3 } ] } } |
Attribute | Type | Optional | Description |
---|---|---|---|
switch | String | No | on: turn the switch on, off: turn the switch off |
outlet | Number | No | Ranges: [0,3]; Represents channels: 1-4 |
URL: http://[ip]:[port]/zeroconf/pulses
Return value format: json
Method: HTTP post
Request body
e.g.
{ |
Attribute | Type | Optional | Description |
---|---|---|---|
pulses | Array | No | Inching setting list |
pulse | String | No | on: activate the inching function; off: disable the inching function |
width | Number | Yes | Required when “pulse” is on, pulse time length, positive integer, ms, only supports multiples of 500 in range of 500~3599500 |
switch | String | No | You can set to on or off. The switch state after the end of inching. If set to on, after turning off the device, when the inching time is up, the device will be turned on. |
URL: http://[ip]:[port]/zeroconf/startups
Return value format: json
Method: HTTP post
e.g.
{ |
Attribute | Type | Optional | Description |
---|---|---|---|
startup | String | No | on: the device is on when power supply is recovered. off: the device is off when power supply is recovered. stay: the device status keeps as the same as the state before power supply is gone |
URL: http://[ip]:[port]/zeroconf/signal_strength
Return value format: json
Method: HTTP post
Request body
e.g.
1 2 3 4 | { "deviceid": "", "data": { } } |
Empty object, no attribute is required.
Response body
e.g.
1 2 3 4 5 6 7 | { "seq": 2, "error": 0, "data": { "signalStrength": -67 } } |
Attribute | Type | Optional | Description |
---|---|---|---|
signalStrength | Number | No | The WiFi signal strength currently received by the device, negative integer, dBm |
URL: http://[ip]:[port]/zeroconf/wifi
Return value format: json
Method: HTTP post
e.g.
1 | { |
Attribute | Type | Optional | Description |
---|---|---|---|
ssid | String | No | SSID of the WiFi network to which the device will connect |
password | String | No | password of the WiFi network to which the device will connect |
URL: http://[ip]:[port]/zeroconf/ota_unlock
Return value format: json
Method: HTTP post
e.g.
1 | { |
Empty object, no attribute is required.
The following failure codes are added to the error field of the response body:
– 500: The operation failed and the device has errors. For example, the device ID or API Key error which is not authenticated by the vendor’s OTA unlock service;
– 503: The operation failed and the device is not able to request the vendor’s OTA unlock service. For example, the device is not connected to WiFi, the device is not connected to the Internet, the manufacturer’s OTA unlock service is down, etc.
URL: http://[ip]:[port]/zeroconf/ota_flash
Return value format: json
Method: HTTP post
e.g.
1 | { |
Attribute | Type | Optional | Description |
---|---|---|---|
downloadUrl | String | No | The download address of the new firmware, only supports the HTTP protocol, the HTTP server must support the Range request header. |
sha256sum | String | No | SHA256 checksum (hash) of the new firmware, it is used to verify the integrity of the new firmware downloaded |
The following failure codes are added to the error field of the response body:
– 403: The operation failed and the OTA function was not unlocked. The interface “3.2.6 OTA function unlocking” must be successfully called first.
– 408: The operation failed and the pre-download firmware timed out. You can try to call this interface again after optimizing the network environment or increasing the network speed.
– 413: The operation failed and the request body size is too large. The size of the new OTA firmware exceeds the firmware size limit allowed by the device.
– 424: The operation failed and the firmware could not be downloaded. The URL address is unreachable (IP address is unreachable, HTTP protocol is unreachable, firmware does not exist, server does not support Range request header, etc.)
– 471: The operation failed and the firmware integrity check failed. The SHA256 checksum of the downloaded new firmware does not match the value of the request body’s sha256sum field. Restarting the device will cause bricking issue.
Note:
URL: http://[ip]:[port]/zeroconf/info
Return value format: json
Method: HTTP post
e.g.
1 2 3 4 | { "deviceid": "", "data": { } } |
Empty object, no attribute is required.
Response body
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | { |
Note: