Panel Development FAQs
Why are the data points (DPs) for virtual device debugging and device schema empty?
Possible causes:
Your device is connected through TuyaLink. The method for obtaining the DPs of TuyaLink-based devices differs from that for TuyaOS-based devices. Currently, the virtual device plugin and project template do not support TuyaLink, but we will add this support soon.
Solutions:
You can encapsulate the implementation using the APIs for the DP model.
- Get the DPs of a device through
getDeviceThingModelInfo. - Control a device through
publishThingModelMessage. - Listen for DPs through
onReceivedThingModelMessage.
How can I identify a single device and group?
Based on whether the groupId is included in the start parameters.
How can I debug a device group?
Set groupId in the start parameter in the developer tool.
How can I control multiple devices?
To control multiple devices with one panel, store the IDs of the additional devices in the current device's properties.
- Call getLinkageDeviceList in the current panel to get the device ID.
- Call getDeviceListByDevIds to get the device information.
- Show the device list on the user interface or use an alternative method to identify the IDs of devices for control.
- Call setDeviceProperty to store the device ID.
- You can then get the device ID through getDeviceProperty for control.
How can I get the device ID (deviceId)?
Open the device panel on the mobile app. Tap the top right corner and select Device Information. The Virtual ID is the device ID.