Last Updated on : 2024-06-24 10:17:49download
A local schedule is downloaded to the device for execution. The device checks if the timer has expired to run a scheduled task. A local schedule does not depend on a cloud connection and can run as expected even if the device goes offline.
There are two types of schedules based on how they are updated:
Wi-Fi and wired based schedules
If the device is connected to the internet, it will proactively request the schedule from the cloud when there are updates to scheduled tasks.
Bluetooth based schedules
If a Wi-Fi and Bluetooth combo device is offline from the internet but connected over Bluetooth, it receives scheduled tasks through the app instead of directly from the cloud. In this case, when users add, delete, or modify a schedule, the app sends the update to the device over a Bluetooth connection. The device is passively notified of the schedule information.
Open tuya_iot_config.h
and check if the following macro is defined.
All the Networked Product Development Frameworks support Wi-Fi and wired based schedules.
#define ENABLE_BT_TIMER 1 // Bluetooth based schedule
tuya_cloud_com_defs.h
Create a product on the Tuya Developer 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.
During device initialization, the application registers the callbacks for processing object-type and raw-type DP commands.
The TuyaOS framework initializes, adds, deletes, or modifies the scheduled task, without involving the application.
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
.
Once a schedule has been downloaded to the device, it can be executed without an internet connection.
Yes, it supports DST. The framework will check if DST is in effect before executing a schedule. If DST is in effect, the schedule will be executed according to DST.
Up to 30 local schedules are supported.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback