Control appliances
Switching a relay
PUT /core/appliances;id={appliance_id}/relay HTTP/1.1
GET /user/
<relay_functionality>
<state>on</state>
</relay_functionality>
This endpoint switches the relay state of a relay-enabled appliance, such as a smart plug. Sending a PUT request with the desired state will toggle the relay accordingly.
Path parameters
| Parameter | Type | Description |
|---|---|---|
appliance_id | string | Unique identifier of the appliance whose relay is to be switched. |
Request body
The request body must be XML containing a <relay_functionality> element:
<relay_functionality>
<state>on</state>
</relay_functionality>
| Element | Type | Description |
|---|---|---|
state | string | Desired relay state. Accepted values: on, off |
Example request
PUT /core/appliances;id=ca4d2c9e16d5498e839cc9733e23f90d/relay
<relay_functionality>
<state>on</state>
</relay_functionality>
Example response
A successful request returns HTTP 202 Accepted with an empty body, indicating the command has been received and will be applied.