Skip to content

Server that processing web requests from Laitis

Sergey Mikolaytis edited this page Jan 14, 2018 · 1 revision

If you have:

  • A smart home management system that has a web interface and you want to manage a smart home through Laitis
  • A service that provides any services and you want to receive requests from users of Laitis

You can create smart commands that will send HTTP requests to your server.

Laitis has several actions to work with http:

Action Description
Open a web page in the active browser or in the default browser In the query, you can specify various arguments, a clear example is at the end of the article "How to create consecutive commands in Laitis"
Open the content of one of the web pages in a pop-up window of a web browser in the corner of the screen Successful examples of such commands are in the collection Services.
Send HTTP POST/GET request without opening browser In this case, the server can return a response with a list of commands in the JSON format that Laitis will execute. The details are below.

An example of commands that send a Web request to Laitis:

Voice commands Actions
Okay smart home turn on the light GET Web Request: http://192.168.0.1/sh/toggleLight

A command that sends a portion of the user's phrase to the server:

Voice commands Actions
Okay smart house {text} Web request for GET: http://192.168.0.1/sh/request?text={text}

How to return a response from the server with a list of actions that Laitis will perform:

  • Receive requests from Laitis you must on a separate page/method of your website.
  • Laitis will send requests to your page when the user calls a command with the action of sending a request to your server.
  • In response, the server should return an array of objects of type CommandAction in JSON format
  • Read the article "Actions that can be sent to Laitis"

Note: server can return nothing