API - control interface

API online

Service call syntax

Calling the API online by sending an HTTP request has the following syntax:

https://vektiva.online/api/<REMOTE_ID>/<API_KEY>/<DEVICE_ID>/<command>

Each physical device (SMARWI) has its unique DEVICE ID. You will obtain REMOTE ID and API KEY, after signing up at vektiva.online (under the “API” menu). IDs are common to all devices under your account.

<command> is one of following commands

  • open Open window action. It is possible to use another optional parameter (percentage opening size). To do that add to the URL /<INTEGER[1..100]>

  • close Close window action

  • stop Stop movement action

  • fix Window fixation action

  • prio Activity trigering with priority for specific time (since firmware 203.2.0)

    Note

    Activity is a “program” (set of conditions & actions), which determines device behavior during its run.

    full syntax prio/<delay_seconds>/<duration_seconds>/<ActivityName>[/param1[/[param2[/param3]]]

    • delay_seconds is the number of seconds to run the activity
    • duration_seconds is the activity time in seconds
    • ActivityName activity name as defined in the device
    • param1..param3 respective activity parameters

    This activity is then performed “in priority” at the given interval, ie if the same activity is running at the same time according the plan it will be overwriten with its parameters.

  • queue Triger action with time delay (since firmware 203.2.0)

    Note

    The action is one activity the device can perform - for example, close the window

    full syntaxe queue/<delay_seconds>/<ActionName>[/param1[/[param2[/param3]]]

    • delay_seconds number of seconds until action execution.
    • ActionName name of action supported by device, except prio a queue. (open, close, stop, fix…)
    • param1..param3 optional activity parameters

API over local network

API call within your internal network by sending http request has following syntax:

http://IP/cmd/<command>

Where IP is IP address of given SMARWI.

Examples

Example 1 - local network, close SMARWI at IP address 1.2.3.4

https://1.2.3.4/cmd/close

Example 2 - online, close SMARWI with ID 1111111111

https://vektiva.online/api/dndptketzd/12abc34def/1111111111/close

Example 3 – online, open SMARWI with ID 1111111111 on 30%

https://vektiva.online/api/dndptketzd/12abc34def/1111111111/open/30

Example 4 - local network, activity planning

http://1.2.3.4/cmd/prio/10/20/ventilate/50

Runs activity “ventilate” from “now”+10 seconds unitl “now”+30 seconds, activity parameter is 50 – in this example 50% opening, but parametr meaning depends on activity definition

Example 5 - online, activity planning

https://vektiva.online/api/dndptketzd/12abc34def/1111111111/prio/10/20/ventilate/50

Runs activity “ventilate” from “now”+10 seconds unitl “now”+30 seconds, activity parameter is 50 – in this example 50% opening, but parametr meaning depends on activity definition

Example 6 - online, action planning

https://vektiva.online/api/dndptketzd/12abc34def/1111111111/queue/20/open/50

In 20 seconds run action ‘open’ with parameter 50 – open window on 50%

You can easily test the API call function by typing a request to your URL browser. After sending, the desired action is performed.