Overview¶
Bidirectional communication was added with IoTC v1.6 to support sending commands from IoTC to EnOcean devices. This allows controlling TRV's and switching ON/OFF light relay switches. Communication from IoTC to EnOcean devices is managed through MQTT using RPC topics (Remote Procedure Call). To support sending data to energy harvesting devices, IoTC also supports queuing commands until the device is ready. The application can manage data in the queue and will get status notifications from IoTC through MQTT RPC topics.
Commissioning of Bidirectional Devices¶
Bidirectional devices are commissioned using the POST /devices
API as described here. Once a device is commissioned it must be configured for bidirectional communication. As the configuration procedure is device specific, it is required to follow the configuration procedure described for the specific device. The following list of devices are currently supported:
Controlling bidirectional devices¶
Communication from IoTC to EnOcean devices is managed through MQTT using RPC topics (Remote Procedure Call). The communication and RPC topic flow is shown in below diagrams. To send a command the application will initiate a request using the device/{device_id}/rpc/command
topic. IoTC puts the command in the queue and returns a status notification using the device/{device_id}/rpc/result
topic. The queue will examine if the device is an energy harvesting device or if the command can be sent immediatly to the device. In case the device is an energy harvesting device, IoTC will keep the command in queue until receiving any data from the device like regular telemetry data. Data from the device is used to indicate the device is awake and can receive data. Once data is sent to the device IoTC will notify the application using the device/{device_id}/rpc/result
topic.
The application may cancel data in the queue by using the device/{device_id}/rpc/cancel
topic as shown in below diagram. IoTC will cancel the request and notify the application using the device/{device_id}/rpc/result
topic.