Calendar-Based Schedule

Last Updated on : 2024-01-18 08:42:32download

The calendar-based schedule, which is one type of local schedules, enables users to schedule tasks with various recurring options. For example, it allows for repetition on odd or even days or at intervals of the specified hour(s).

Features

  • Repeat a schedule on odd or even days.
  • Repeat a schedule every x day(s).
  • Repeat a schedule every x hour(s).
  • Repeat a schedule on a weekly basis.
  • Set the start and end times for a schedule.

How it works

The calendar-based schedule works the same way as the local schedule.

Development guide

Open tuya_iot_config.h and check if the following macro is defined.

#define ENABLE_CALENDAR_TIMER 1

Reference the header

  • tuya_cloud_com_defs.h

How to use

  1. Create a product on the Tuya IoT Development Platform and then enter the product development process. Click the Function Definition tab, scroll down to Advanced Functions, and enable Cloud Timing.

    If you cannot find Cloud Timing in advanced functions, this is because the product solution does not have this function bound. To request binding it with your product, contact your account manager or submit a service ticket.

    Calendar-Based Schedule
  2. Click the Device Interaction tab and select a panel that supports calendar-based schedules.

    If the panel you have selected does not support this feature or if you are unsure which panel supports it, contact your account manager or submit a service ticket.

  3. During device initialization, the application registers the callbacks for processing object-type and raw-type DP commands.

  4. The TuyaOS framework initializes, adds, deletes, or modifies the scheduled task, without involving the application.

  5. When a scheduled task is due, the framework will notify the application using the DP command callback. The command source cmd_tp in the DP data receiving struct is DP_CMD_TIMER.

FAQs

See Local Schedule FAQs.