Device Relationship

Last Updated on : 2025-03-24 07:40:43download

PLC specifications define certain special features to make PLC devices easy to use, for example, local groups, scenes, and finding & binding. TuyaOS comes with simplified interfaces to support these features. For more information, see the specific framework development guide.

Local group

TuyaOS supports PLC standard groups. Multiple PLC sub-devices can be added to the same group. Each PLC sub-device can be added to multiple groups. Group control allows users to control multiple devices in a group with just one command, instead of sending this command respectively to each device through unicast communication. This feature minimizes the number of over-the-air packets. Devices in the same group can receive the command nearly at the same time and thus keep their status synced with each other.

TuyaOS provides PLC standard interfaces for sending group commands and callbacks to invoke when these commands are received. For example, adding or deleting groups can be implemented in this way. Therefore, your development can be accelerated by PLC groups.

The maximum number of groups supported by TuyaOS can vary, depending on different chip platforms. For more information, see the documentation on the respective development framework.

Local scene

TuyaOS supports PLC standard scenes. Each scene is a combination of states or attribute values supported by a device. This group of values is stored as a snapshot on the device and assigned a scene ID for indexing. Then, users can send a command to the device anytime to invoke the scene and restore the specified status. This can minimize the number of control commands that restore multiple states of a device.

For example, add a scene to a light, including details such as on/off, brightness, and color temperature. When this scene is recalled, the pre-defined states related to on/off, brightness, color temperature, and more are restored on the light.

TuyaOS provides PLC standard callbacks to invoke when scene commands are received. For example, adding, recalling, or deleting scenes can be implemented in this way.

After the command of saving a scene is received, TuyaOS allows users to save the selected states or attribute values to non-volatile memory (NVM). When users send a command to recall the scene in the future, these values can be restored easily.

Binding and unbinding

This feature enables direct control between PLC devices, without the need for command conversion by additional devices such as gateways. The device that sends a control command is known as the initiator and the device that receives the control command is known as the target device. The initiator and the target device open the binding window. The initiator initiates the binding process. The target device records the information of the initiator and can then be controlled by the initiator.

Support and help

If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.