The loads services provides access to all loads (e.g. lights, blinds) of your installation.
Do not forget to include the authentication token in all your requests!
To modify the state of a load, there are two possibilities:
- Using the API
target_state- Use
target_stateto set the desired end-state of a load using a value e.g.bri(brightness)
- Use
- Using the API
ctrl- Use
ctrlto invoke (simulate) a button-event, e.g.click,press,release
- Use
🐮 Help! I need somebody Help !
This example demonstrates how to get all connected loads (lights & blinds) of your wiser-by-feller-installation.
Request header:
GET /api/loads HTTP/1.1
Authorization: Bearer 60650cf4-5d26-4294-b1f2-6c06adc9d0d8
host: example.comResponse header:
HTTP/1.1 200 OK
Content-Type: application/jsonResponse body:
{
"data": [
{
"id": 1,
"type": "onoff",
"name": "0000133a_0",
"device": "0000133a",
"channel": 0,
"unused": false
},
{
"id": 2,
"type": "dim",
"name": "0000144b_0",
"device": "0000144b",
"channel": 0,
"unused": false
},
{
"id": 3,
"type": "motor",
"name": "0000155c_0",
"device": "0000155c",
"channel": 0,
"unused": false
}
],
"status": "success"
}Get all loads (lights & blinds) state of your wiser-installation.
Request header:
GET /api/loads/state HTTP/1.1
Authorization: Bearer 60650cf4-5d26-4294-b1f2-6c06adc9d0d8
host: example.comResponse header:
HTTP/1.1 200 OK
Content-Type: application/jsonResponse body:
{
"data": [
{
"id": 1,
"state": {
"bri": 10000
}
},
{
"id": 2,
"state": {
"bri": 0,
"flags": {
"over_current": 0,
"fading": 0,
"noise": 0,
"direction": 0,
"over_temperature": 0
}
}
},
{
"id": 3,
"state": {
"level": 8160,
"tilt": 0,
"moving": "stop",
"flags": {
"direction": 0,
"learning": 0,
"moving": 0,
"under_current": 0,
"over_current": 0,
"timeout": 0,
"locked": 0
}
}
}
],
"status": "success"
}Set the target state of a load.
Possible target_state values per load-type:
| Type | Attribute(s) |
|---|---|
| onoff | bri |
| dim | bri |
| motor | level, tilt |
Let's set the load state of an onoff type.
To turn on or off a load set the attribute bri (brightness) to the following values:
- Turn off set the
briattribute to0 - Turn on set the
briattribute to10000
Request header:
PUT /api/loads/1/target_state HTTP/1.1
Authorization: Bearer 60650cf4-5d26-4294-b1f2-6c06adc9d0d8
Content-Type: application/json
host: example.comRequest body:
{
"bri": 0
}Response header:
HTTP/1.1 200 OK
Content-Type: application/jsonResponse body:
{
"data": {
"id": 1,
"target_state": {
"bri": 0
}
},
"status": "success"
}Let's set the load state of a dim type.
On a dimmable light you can set the target brightness between 0% and 100% (0 - 10000).
- Turn
offset thebriattribute to0 - To dim set the
briattribute between 1 and 10000 (e.g. setbrito 5000, means 50% of brightness)
Request header:
PUT /api/loads/2/target_state HTTP/1.1
Authorization: Bearer 60650cf4-5d26-4294-b1f2-6c06adc9d0d8
Content-Type: application/json
host: example.comRequest body:
{
"bri": 5000
}Response header:
HTTP/1.1 200 OK
Content-Type: application/jsonResponse body:
{
"data": {
"id": 2,
"target_state": {
"bri": 5000
}
},
"status": "success"
}Let's set the load state of a motor type.
On a motor e.g. shutter/blind you can set the target level between 0% and 100% (0 - 10000) and a tilt value.
- To set the shutter in open position set the
levelattribute to0 - To set the shutter in close position set the
levelattribute to10000 - To control the shutter set the
levelattribute between 1 and 10000 (e.g. setlevelto 5000, means set the shutter/blind to position 50%)
- Tilt in number of
tiltcommands. Finally it's the motor running time, because we don't know the slat position in degrees
Request header:
PUT /api/loads/3/target_state HTTP/1.1
Authorization: Bearer 60650cf4-5d26-4294-b1f2-6c06adc9d0d8
Content-Type: application/json
host: example.comRequest body:
{
"level": 5000,
"tilt": 2
}Response header:
HTTP/1.1 200 OK
Content-Type: application/jsonResponse body:
{
"data": {
"id": 3,
"target_state": {
"level": 5000,
"tilt": 2
}
},
"status": "success"
}Possible button types: on, off, up, down, toggle
Possible button events:
| Event | Description |
|---|---|
| click | if the button was pressed shorter than 500ms |
| press | if the button was pressed 500ms or longer |
| release | must follow after a pressed event |
Let's control the load of an onoff type.
-
To turn on the light set the following attributes:
Attribute Value button onevent click -
To turn off the light set the following attributes:
Attribute Value button offevent click
Request header:
PUT /api/loads/1/ctrl HTTP/1.1
Authorization: Bearer 60650cf4-5d26-4294-b1f2-6c06adc9d0d8
Content-Type: application/json
host: example.comRequest body:
{
"button": "on",
"event": "click"
}Response header:
HTTP/1.1 200 OK
Content-Type: application/jsonResponse body:
{
"status": "success",
"data": {
"id": 1,
"ctrl": {
"button": "on",
"event": "click"
}
}
}Let's control the load of a dim type.
A dimmable light can be turned on (100%) or off (0%) on short button-click. If the button is pressed the dimmable light start to fade until the button is release.
-
To turn on a dimmable light set the following attributes:
Attribute Value button upevent click -
To turn off the dimmable light set the following attributes:
Attribute Value button downevent click -
To fade up a dimmable light set the following attributes:
Attribute Value button upevent pressWait shortly and then set the following attributes:
Attribute Value button upevent release -
To fade down a dimmable light set the following attributes:
Attribute Value button downevent pressWait shortly and then set the following attributes:
Attribute Value button downevent release
Let's control the load of a motor type.
On short button-click the slats of the shutter tilts one step (up/down).
If the button is pressed for a while and then released the motor e.g. shutter/blind starts moving (up/down) until reaching the end position. During the motor is moving it's possible to stop it with a short button-click.
-
To tilt up the slats of the shutter set the following attributes:
Attribute Value button upevent click -
To tilt down the slats of the shutter set the following attributes:
Attribute Value button downevent click -
To move up a motor until reaching the end position set the following attributes:
Attribute Value button upevent pressWait for a while and then set the following attributes:
Attribute Value button upevent release -
To move down a motor until reaching the end position set the following attributes:
Attribute Value button downevent pressWait for a while and then set the following attributes:
Attribute Value button downevent release -
To move up a motor until reaching the favorite position set the following attributes:
Attribute Value button upevent pressWait for a while and then set the following attributes:
Attribute Value button upevent releaseWait until the motor reaching the favorite position and then set the following attributes:
Attribute Value button upevent click -
To move down a motor until reaching your favorite position set the following attributes:
Attribute Value button downevent pressWait for a while and then set the following attributes:
Attribute Value button downevent releaseWait until the motor e.g. shutter/blind reach your favorite position and then set the following attributes:
Attribute Value button downevent click