m2m In a world of more and more connected devices, it is important to provide simple access to the devices data and functionality. This ensures that the device can easily be integrated into the network and can become part of the smart system we are building.

The Telegea Smart Hub with its connected sensors and actuators interfaces with the physical world and can provide valuable data about it. Most of this data is now exposed via an HTTP API which allows third party applications and devices to access it. Any device connected to the same network (LAN) as the Telegea Smart Hub can send a simple HTTP request to it and will receive the response with the requested data. A temperature or humidity sensor can be queried as well as the current value of a pulse counter or a status signal (on/off).

Requesting this kind of data is as easy as sending a request like this:

http://telegea.local/input/command.php?plant_id=0&dev_cmd=[{"mod":1,"reg":15}]

The answer will be a JSON formatted string containing the requested value:

{"result":[{"reg":15,"val":359,"mod":1}]

This API has the same syntax as the “Sending device commands” API provided by the Telegea Server. However, while the Telegea Server API is used by devices connected to the public Internet, the Smart Hub API allows a direct connection without access to the Telegea server. It works completely in the local network, there is no the need for an external Internet connection. In this way the Telegea Smart Hub can be accessed independently from the Telegea Web services, which means it can be integrated as external device into third party projects like e.g. smart home systems.

The detailed API documentation, together with the source code, is available as usually on GitHub.

Leave a Reply

Your email address will not be published. Required fields are marked *