On this page

Clocks and reminders

Use the echolink module in @tuya-miniapp/cloud-api to manage clocks and reminders on smart speaker devices.

Prerequisites

  • Use a version of @tuya-miniapp/cloud-api that includes the following APIs. See each API page for its minimum version.
  • The user must be logged in and have access to the target device.
  • The miniapp must be authorized to use the Smart Speaker Clock and Reminder Capability (智能音箱闹钟与提醒能力).

APIs

APIDescription
getEcholinkClockListQuery device clocks with pagination
addEcholinkClockAdd a device clock
updateEcholinkClockUpdate a device clock
deleteEcholinkClockDelete a device clock
enableEcholinkClockEnable or disable a device clock
getEcholinkAlarmListQuery device reminders with pagination
deleteEcholinkAlarmDelete a device reminder

Workflow

  1. Call getEcholinkClockList to query clocks, or getEcholinkAlarmList to query reminders. Records are in the data field of the returned object.
  2. Call addEcholinkClock to add a clock. It returns a boolean; query the list again to obtain the clock ID.
  3. Use the timeId from the clock list to update, delete, enable, or disable a clock. To delete a reminder, use the timeId from the reminder list.
  4. Updating a clock also enables it. To disable it afterward, call enableEcholinkClock with enable: false.

Usage notes

  • All seven APIs use POST over Highway. The SDK sends parameters in the request body, including for both list APIs.
  • Add, update, delete, and enable/disable operations return a boolean. The business result can be false, so check the returned value.
  • This capability provides list and delete APIs for reminders. Clocks and reminders are separate records; use the corresponding APIs for each.