---
name: "createLightRhythmsRefreshTimer"
mode: "api"
versionRequirements:
  - { name: "MiniKit", version: "3.7.6" }
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## createLightRhythmsRefreshTimer

> [VERSION] MiniKit >= 3.7.6 | @tuya-miniapp/cloud-api >= 1.0.5

> 💡 This API is a cloud capability and requires authorization before use. For details on cloud capabilities, see the [documentation](/cn/miniapp/common/desc/tech-stack/api). Currently, cloud capabilities are not available in the Developer Tools environment; you must package the app or debug on a real device.

### Description

Create a scheduled task to refresh circadian rhythm times

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `PostLightRhythmsRefreshTimerParams` | Yes | Request parameters: bizId (business ID), bizType (business type), cron (optional, cron expression). |

### Return Value

Type: `Promise<boolean>`

boolean

### Referenced Types

##### `interface` PostLightRhythmsRefreshTimerParams

| Property | Type | Description |
| --- | --- | --- |
| `bizId` | `string` | Business ID: device ID or group ID |
| `bizType` | `0 \| 1` | Business type: `0` device, `1` group |
| `cron` | `string` | Cron expression for the scheduled task; if omitted, the server default is used. The interval must be between 1 and 30 days. |


### Examples

#### Request example

```typescript
import { createLightRhythmsRefreshTimer } from '@tuya-miniapp/cloud-api';

createLightRhythmsRefreshTimer({
  bizId: 'vdevo167504******003',
  bizType: 0,
  cron: '0 0 0 * * ?',
})
  .then((response) => {
    console.log(response);
  })
  .catch();
```

#### Response example

```json
1
```


### FAQ

#### Why does the biological rhythm cloud capability call fail?

[Biological rhythm](https://developer.tuya.com/en/docs/iot/geographic_biorhythm?id=Kbn3r2z592at4) must have advanced capabilities enabled on the Tuya Developer Platform product feature definition page. Otherwise cloud capability calls will fail.

#### Failing to create a cloud task that refreshes biological rhythm times (sunrise/sunset/noon, etc.) on a cron schedule

When using a `cron` expression to create a cloud task that periodically refreshes biological rhythm times (sunrise/sunset/noon, etc.), you must save biological rhythm information in the device properties before calling this API. Otherwise the call will fail.
