Device Control
We can control devices in two ways:
- Update device status
- Call device function
Update Device Status
Add Node
Right-Click anywhere on canvas, select IoT/Update Device Status by Reference
From the left panel, find the device you want to update, then drag it to the canvas. Connect the Device
node to Update Device Status by Reference
node:
We can manually input property ID on Update Device Status by Reference
node, or we can connect the handle on Device
node to the Property
handle of the Update Device Status by Reference
node:
Now if we press Run
button, the device will be updated.
Notice
After we send our message to device, the device must reply a message on this topic: /message/property/write/reply within a time limit.
Update Device Status by Device ID
In some cases, we are unable to get a reference of our device, for example, if user say:
Turn on the 12th light
In this case, we can firstly build a map (12->device ID), then use Update Device Status by Device ID
node to update device status:
TIP
Since we only have device ID, we don't know which platform or environment the device belongs to, so we need to select the platform or environment first.
Call Device Function
Right-Click anywhere on canvas, select IoT/Update Device Status by Reference
Similar to Update Device Status by Reference
, we can also call device function by reference. The difference is that we need to input Function ID
:
Notice
Same as updating device status, device must reply a message on this topic: /message/property/write/reply within a time limit.
We can also call device function by device ID: