Skip to content

Devices

Richard Willars edited this page Sep 19, 2016 · 3 revisions

In Thinglator, internet of things and home automation products are known as devices. These devices are broken down into categories - speakers, switches, sensors, plugs, bulbs etc. Each category of devices has very different capabilities (a switch may only be able to be turned on and off but a bulb may also be able to change colour and brightness). For this reason each category has a list of capabilities - you can learn about these on the devices pages listed in the menu.

However, most home automation devices are very different and may support any number of category capabilities. You can use the APIs listed below to determine the capabilities of each device on your network, and you can learn what the capabilities are and how to control them on the device pages listed in the menu.

Support for a particular device in Thinglator is provided by creating a driver. A driver tells Thinglator about the device's capabilities and allows Thinglator to talk to the device.

##APIs

There are a number of APIs that let you discover and gather information about devices on your network.

###GET discover/:type/:driver

E.g. GET discover/speaker/sonos

Tells a particular driver to search for devices on the network (in the above example it will search for Sonos speakers using the 'sonos' speaker driver). Any newly found devices are added to thinglator. Any existing ones are updated. Any non-existant ones are removed from thinglator. Once discovery is completed it'll return the list of devices.

###GET devices/:type

E.g. GET devices/speaker

Returns a list of all devices of a certain type added to Thinglator. In the example above it is returning a list of all speakers added to Thinglator.

###GET devices/:type/:driver

E.g. GET devices/speaker/sonos

Returns a list of all devices of a certain type and using a certain driver that have been added to Thinglator. In the example above it is returning a list of all speakers using the 'sonos' driver.

###GET device/:_id

E.g. GET device/abc123

Returns information about a particular device and all it's capabilities.

###POST device/:_id/:command

E.g. POST device/abc123/on

Sends a command to a particular device. In the above example we are issuing the 'on' command to the device with id 'abc123'. The list of commands/capabilities available for a particular device can be obtained by called GET device/:_id.

Clone this wiki locally