As the name already says, some buttons in your Wiser-by-Feller environment are smart. But don't worry, they are not smart at all, you still have to press the (smart-)button yourself.
A smartbutton can de married with a job. That means, by pressing the smartbutton a configured job will be executed.
Do not forget to include the authentication token in all your requests!
🐮 I have not get married yet, probably a smart decision?
They are two kind of smartbuttons:
-
Smartbuttons from type:
scene
-
Smartbuttons from type:
groupctrl
The configuration of a smartbutton consists of the following steps:
-
Activated the programming mode (program)
- Choose between
scene
orgroupctrl
smartbuttons - Configure the blink-time. The default is 60 seconds
- At this point the smartbuttons do not blinking yet
- Choose between
-
Run the notify (notify)
- Now the available smartbuttons will start blinking
scene
-smartbuttons (will blinkingpurple
)groupctrl
-smartbuttons (will blinkingyellow
)
- As soon as one of the blinking smartbutton is pressed, all smartbuttons stop blinking and the notify request comes back with a response
- Now the available smartbuttons will start blinking
-
The Marriage
Activated the smartbutton programming-mode.
Possible attributes:
Key | Description |
---|---|
on | true to prepare programming mode or false to abort it (default: false ) |
timeout | time in seconds to stay in programming mode (default: 60 ) |
button_type | type of buttons to program. scene or groupctrl (default: scene ) |
Request header:
POST /api/smartbuttons/program HTTP/1.1
Content-Type: application/json
host: example.com
Request body:
{
"on": true,
"timeout": 60,
"button_type": "scene"
}
Response header:
HTTP/1.1 200 OK
Content-Type: application/json
Response body:
{
"data": {
"on": true,
"button_type": "scene",
"timeout": 60,
"owner": "user"
},
"status": "success"
}
Start blinking the smartbuttons and wait until one is pressed. This is a long lasting REST-API call. It blocks and wait until a smartbutton is pressed or the timeout is reached.
Request header:
GET /api/smartbuttons/notify HTTP/1.1
host: example.com
Wait until until a smartbutton is pressed.
Response body:
{
"data": {
"button": 50
},
"status": "success"
}
Finally we will get married!
The request-body contains the unique job-id.
Request header:
PATCH /api/smartbuttons/50 HTTP/1.1
Content-Type: application/json
host: example.com
Request body:
{
"job": 20
}
Response header:
HTTP/1.1 200 OK
Content-Type: application/json
Response body:
{
"data": {
"id": 50,
"input_channel": 0,
"device_addr": 48879,
"device": "000BEEF",
"input_type": 2,
"job": 20,
},
"status": "success"
}
Just married, press the smartbutton and the job is executed.
🐮 This will be an everlasting love ❤️