Added dp for errors for thermometer

Panel mini-program development related product technical discussions, including panel mini-programs, intelligent mini-programs, React Native, Ray cross-platform framework, Panel SDK, WeChat mini-programs, mini-program development tools (IDE), and other related development technologies.


Post Reply
n0b0dy
Posts: 1

IDE 0.10.9
Smartlife 7.11.0(int)
@ray-js/cli": "1.7.55"
@ray-js/panel-sdk": "1.14.1"
Realme 8 pro, Andr. 13
Product ID: idqdrp5x
Can't read log for dp101 (1w error code), dp102 (CRC error rate)
I need the log itself, not just a display of the current value.

► Show Spoiler

Shows "Log API methods not found in SDK"

7ingyuan
Posts: 1

Re: Added dp for errors for thermometer

Hello,
To query historical DP logs reported by the device, please use the official getAnalyticsLogsStatusLog API:
View the getAnalyticsLogsStatusLog documentation
This API requires @tuya-miniapp/cloud-api version 1.0.5 or later and is not available under ty.device:

Code: Select all

import { getAnalyticsLogsStatusLog } from '@tuya-miniapp/cloud-api';

const result = await getAnalyticsLogsStatusLog({
  devId,
  dpIds: '101,102',
  offset: 0,
  limit: 50,
  startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000), // Defaults to the timestamp from 7 days ago if omitted
  endTime: String(Date.now()), // Defaults to the current timestamp if omitted
  sortType: 'DESC',
});

const logs = result?.dps ?? [];

Please note:

  • This is a cloud capability and requires authorization.
  • Cloud capabilities are not available in the Developer Tools environment; package the MiniApp or test on a real device.
  • The available history range depends on the device log storage service. The free edition supports logs from the most recent seven days. Please refer to the documentation for details.

For further questions about Ray APIs, you can also try Tuya MiniApp AI in the lower-right corner of the official documentation page : )

Post Reply